Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
6d693005
Commit
6d693005
authored
Jun 02, 2002
by
Rusty Russell
Committed by
Linus Torvalds
Jun 02, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] AUDIT 2.5.19: Continuing copy_to/from_user & clear_user
parent
866559c1
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
27 additions
and
27 deletions
+27
-27
arch/ppc/kernel/syscalls.c
arch/ppc/kernel/syscalls.c
+1
-1
arch/s390/kernel/debug.c
arch/s390/kernel/debug.c
+3
-4
arch/s390/kernel/ptrace.c
arch/s390/kernel/ptrace.c
+3
-3
arch/s390/kernel/signal.c
arch/s390/kernel/signal.c
+2
-1
arch/s390/math-emu/math.c
arch/s390/math-emu/math.c
+2
-2
arch/s390x/kernel/debug.c
arch/s390x/kernel/debug.c
+3
-4
arch/s390x/kernel/ptrace.c
arch/s390x/kernel/ptrace.c
+1
-1
arch/s390x/kernel/signal.c
arch/s390x/kernel/signal.c
+2
-1
arch/sparc/kernel/sys_sunos.c
arch/sparc/kernel/sys_sunos.c
+1
-1
arch/sparc64/kernel/sys_sparc.c
arch/sparc64/kernel/sys_sparc.c
+1
-1
drivers/char/rio/rioctrl.c
drivers/char/rio/rioctrl.c
+2
-2
drivers/ieee1394/pcilynx.c
drivers/ieee1394/pcilynx.c
+1
-1
drivers/s390/misc/chandev.c
drivers/s390/misc/chandev.c
+1
-1
drivers/sbus/char/openprom.c
drivers/sbus/char/openprom.c
+3
-3
sound/isa/sb/sb16_csp.c
sound/isa/sb/sb16_csp.c
+1
-1
No files found.
arch/ppc/kernel/syscalls.c
View file @
6d693005
...
@@ -117,7 +117,7 @@ sys_ipc (uint call, int first, int second, int third, void *ptr, long fifth)
...
@@ -117,7 +117,7 @@ sys_ipc (uint call, int first, int second, int third, void *ptr, long fifth)
if
((
ret
=
verify_area
(
VERIFY_READ
,
ptr
,
sizeof
(
tmp
)))
if
((
ret
=
verify_area
(
VERIFY_READ
,
ptr
,
sizeof
(
tmp
)))
||
(
ret
=
copy_from_user
(
&
tmp
,
||
(
ret
=
copy_from_user
(
&
tmp
,
(
struct
ipc_kludge
*
)
ptr
,
(
struct
ipc_kludge
*
)
ptr
,
sizeof
(
tmp
))
)
)
sizeof
(
tmp
))
?
-
EFAULT
:
0
)
break
;
break
;
ret
=
sys_msgrcv
(
first
,
tmp
.
msgp
,
second
,
tmp
.
msgtyp
,
ret
=
sys_msgrcv
(
first
,
tmp
.
msgp
,
second
,
tmp
.
msgtyp
,
third
);
third
);
...
...
arch/s390/kernel/debug.c
View file @
6d693005
...
@@ -424,7 +424,6 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
...
@@ -424,7 +424,6 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
{
{
size_t
count
=
0
;
size_t
count
=
0
;
size_t
entry_offset
,
size
=
0
;
size_t
entry_offset
,
size
=
0
;
int
rc
;
file_private_info_t
*
p_info
;
file_private_info_t
*
p_info
;
p_info
=
((
file_private_info_t
*
)
file
->
private_data
);
p_info
=
((
file_private_info_t
*
)
file
->
private_data
);
...
@@ -440,9 +439,9 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
...
@@ -440,9 +439,9 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
size
=
MIN
((
len
-
count
),
(
size
-
entry_offset
));
size
=
MIN
((
len
-
count
),
(
size
-
entry_offset
));
if
(
size
){
if
(
size
){
if
(
(
rc
=
copy_to_user
(
user_buf
+
count
,
if
(
copy_to_user
(
user_buf
+
count
,
p_info
->
temp_buf
+
entry_offset
,
size
))
)
p_info
->
temp_buf
+
entry_offset
,
size
))
return
rc
;
return
-
EFAULT
;
}
}
count
+=
size
;
count
+=
size
;
entry_offset
=
0
;
entry_offset
=
0
;
...
...
arch/s390/kernel/ptrace.c
View file @
6d693005
...
@@ -116,14 +116,14 @@ int ptrace_usercopy(addr_t realuseraddr,addr_t copyaddr,int len,int tofromuser,i
...
@@ -116,14 +116,14 @@ int ptrace_usercopy(addr_t realuseraddr,addr_t copyaddr,int len,int tofromuser,i
{
{
if
(
writeuser
)
if
(
writeuser
)
{
{
retval
=
copy_from_user
((
void
*
)
realuseraddr
,(
void
*
)
copyaddr
,
len
);
retval
=
copy_from_user
((
void
*
)
realuseraddr
,(
void
*
)
copyaddr
,
len
)
?
-
EFAULT
:
0
;
}
}
else
else
{
{
if
(
realuseraddr
==
(
addr_t
)
NULL
)
if
(
realuseraddr
==
(
addr_t
)
NULL
)
retval
=
(
clear_user
((
void
*
)
copyaddr
,
len
)
==-
EFAULT
?
-
EIO
:
0
);
retval
=
(
clear_user
((
void
*
)
copyaddr
,
len
)
?
-
EIO
:
0
);
else
else
retval
=
(
copy_to_user
((
void
*
)
copyaddr
,(
void
*
)
realuseraddr
,
len
)
==-
EFAULT
?
-
EIO
:
0
);
retval
=
(
copy_to_user
((
void
*
)
copyaddr
,(
void
*
)
realuseraddr
,
len
)
?
-
EIO
:
0
);
}
}
}
}
else
else
...
...
arch/s390/kernel/signal.c
View file @
6d693005
...
@@ -141,7 +141,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
...
@@ -141,7 +141,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
/* Returns non-zero on fault. */
static
int
save_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
static
int
save_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
{
{
int
err
;
int
err
;
...
@@ -157,6 +157,7 @@ static int save_sigregs(struct pt_regs *regs,_sigregs *sregs)
...
@@ -157,6 +157,7 @@ static int save_sigregs(struct pt_regs *regs,_sigregs *sregs)
}
}
/* Returns positive number on error */
static
int
restore_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
static
int
restore_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
{
{
int
err
;
int
err
;
...
...
arch/s390/math-emu/math.c
View file @
6d693005
...
@@ -86,13 +86,13 @@ int sysctl_ieee_emulation_warnings=1;
...
@@ -86,13 +86,13 @@ int sysctl_ieee_emulation_warnings=1;
#define mathemu_copy_from_user(d, s, n)\
#define mathemu_copy_from_user(d, s, n)\
do { \
do { \
if (copy_from_user((d),(s),(n))
== -EFAULT
) \
if (copy_from_user((d),(s),(n))
!= 0
) \
return SIGSEGV; \
return SIGSEGV; \
} while (0)
} while (0)
#define mathemu_copy_to_user(d, s, n) \
#define mathemu_copy_to_user(d, s, n) \
do { \
do { \
if (copy_to_user((d),(s),(n))
== -EFAULT
) \
if (copy_to_user((d),(s),(n))
!= 0
) \
return SIGSEGV; \
return SIGSEGV; \
} while (0)
} while (0)
...
...
arch/s390x/kernel/debug.c
View file @
6d693005
...
@@ -427,7 +427,6 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
...
@@ -427,7 +427,6 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
{
{
size_t
count
=
0
;
size_t
count
=
0
;
size_t
entry_offset
,
size
=
0
;
size_t
entry_offset
,
size
=
0
;
int
rc
;
file_private_info_t
*
p_info
;
file_private_info_t
*
p_info
;
p_info
=
((
file_private_info_t
*
)
file
->
private_data
);
p_info
=
((
file_private_info_t
*
)
file
->
private_data
);
...
@@ -443,9 +442,9 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
...
@@ -443,9 +442,9 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
size
=
MIN
((
len
-
count
),
(
size
-
entry_offset
));
size
=
MIN
((
len
-
count
),
(
size
-
entry_offset
));
if
(
size
){
if
(
size
){
if
(
(
rc
=
copy_to_user
(
user_buf
+
count
,
if
(
copy_to_user
(
user_buf
+
count
,
p_info
->
temp_buf
+
entry_offset
,
size
))
)
p_info
->
temp_buf
+
entry_offset
,
size
))
return
rc
;
return
-
EFAULT
;
}
}
count
+=
size
;
count
+=
size
;
entry_offset
=
0
;
entry_offset
=
0
;
...
...
arch/s390x/kernel/ptrace.c
View file @
6d693005
...
@@ -122,7 +122,7 @@ int ptrace_usercopy(addr_t realuseraddr, addr_t copyaddr, int len,
...
@@ -122,7 +122,7 @@ int ptrace_usercopy(addr_t realuseraddr, addr_t copyaddr, int len,
retval
=
clear_user
(
copyptr
,
len
);
retval
=
clear_user
(
copyptr
,
len
);
else
else
retval
=
copy_to_user
(
copyptr
,
realuserptr
,
len
);
retval
=
copy_to_user
(
copyptr
,
realuserptr
,
len
);
retval
=
(
retval
==
-
EFAULT
)
?
-
EIO
:
0
;
retval
=
retval
?
-
EIO
:
0
;
}
}
}
else
{
}
else
{
if
(
writeuser
)
if
(
writeuser
)
...
...
arch/s390x/kernel/signal.c
View file @
6d693005
...
@@ -141,7 +141,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
...
@@ -141,7 +141,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
/* Returns non-zero on fault */
static
int
save_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
static
int
save_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
{
{
int
err
;
int
err
;
...
@@ -157,6 +157,7 @@ static int save_sigregs(struct pt_regs *regs,_sigregs *sregs)
...
@@ -157,6 +157,7 @@ static int save_sigregs(struct pt_regs *regs,_sigregs *sregs)
}
}
/* Returns positive number on error */
static
int
restore_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
static
int
restore_sigregs
(
struct
pt_regs
*
regs
,
_sigregs
*
sregs
)
{
{
int
err
;
int
err
;
...
...
arch/sparc/kernel/sys_sunos.c
View file @
6d693005
...
@@ -487,7 +487,7 @@ asmlinkage int sunos_uname(struct sunos_utsname *name)
...
@@ -487,7 +487,7 @@ asmlinkage int sunos_uname(struct sunos_utsname *name)
ret
|=
__copy_to_user
(
&
name
->
mach
[
0
],
&
system_utsname
.
machine
[
0
],
sizeof
(
name
->
mach
)
-
1
);
ret
|=
__copy_to_user
(
&
name
->
mach
[
0
],
&
system_utsname
.
machine
[
0
],
sizeof
(
name
->
mach
)
-
1
);
}
}
up_read
(
&
uts_sem
);
up_read
(
&
uts_sem
);
return
ret
;
return
ret
?
-
EFAULT
:
0
;
}
}
asmlinkage
int
sunos_nosys
(
void
)
asmlinkage
int
sunos_nosys
(
void
)
...
...
arch/sparc64/kernel/sys_sparc.c
View file @
6d693005
...
@@ -252,7 +252,7 @@ asmlinkage int sparc64_newuname(struct new_utsname * name)
...
@@ -252,7 +252,7 @@ asmlinkage int sparc64_newuname(struct new_utsname * name)
int
ret
=
sys_newuname
(
name
);
int
ret
=
sys_newuname
(
name
);
if
(
current
->
personality
==
PER_LINUX32
&&
!
ret
)
{
if
(
current
->
personality
==
PER_LINUX32
&&
!
ret
)
{
ret
=
copy_to_user
(
name
->
machine
,
"sparc
\0\0
"
,
8
);
ret
=
copy_to_user
(
name
->
machine
,
"sparc
\0\0
"
,
8
)
?
-
EFAULT
:
0
;
}
}
return
ret
;
return
ret
;
}
}
...
...
drivers/char/rio/rioctrl.c
View file @
6d693005
...
@@ -139,7 +139,7 @@ int copyin (int arg, caddr_t dp, int siz)
...
@@ -139,7 +139,7 @@ int copyin (int arg, caddr_t dp, int siz)
rio_dprintk
(
RIO_DEBUG_CTRL
,
"Copying %d bytes from user %p to %p.
\n
"
,
siz
,
(
void
*
)
arg
,
dp
);
rio_dprintk
(
RIO_DEBUG_CTRL
,
"Copying %d bytes from user %p to %p.
\n
"
,
siz
,
(
void
*
)
arg
,
dp
);
rv
=
copy_from_user
(
dp
,
(
void
*
)
arg
,
siz
);
rv
=
copy_from_user
(
dp
,
(
void
*
)
arg
,
siz
);
if
(
rv
<
0
)
return
COPYFAIL
;
if
(
rv
)
return
COPYFAIL
;
else
return
rv
;
else
return
rv
;
}
}
...
@@ -150,7 +150,7 @@ int copyout (caddr_t dp, int arg, int siz)
...
@@ -150,7 +150,7 @@ int copyout (caddr_t dp, int arg, int siz)
rio_dprintk
(
RIO_DEBUG_CTRL
,
"Copying %d bytes to user %p from %p.
\n
"
,
siz
,
(
void
*
)
arg
,
dp
);
rio_dprintk
(
RIO_DEBUG_CTRL
,
"Copying %d bytes to user %p from %p.
\n
"
,
siz
,
(
void
*
)
arg
,
dp
);
rv
=
copy_to_user
((
void
*
)
arg
,
dp
,
siz
);
rv
=
copy_to_user
((
void
*
)
arg
,
dp
,
siz
);
if
(
rv
<
0
)
return
COPYFAIL
;
if
(
rv
)
return
COPYFAIL
;
else
return
rv
;
else
return
rv
;
}
}
...
...
drivers/ieee1394/pcilynx.c
View file @
6d693005
...
@@ -880,7 +880,7 @@ static ssize_t mem_read(struct file *file, char *buffer, size_t count,
...
@@ -880,7 +880,7 @@ static ssize_t mem_read(struct file *file, char *buffer, size_t count,
retval
=
copy_to_user
(
buffer
,
md
->
lynx
->
mem_dma_buffer
,
count
);
retval
=
copy_to_user
(
buffer
,
md
->
lynx
->
mem_dma_buffer
,
count
);
up
(
&
md
->
lynx
->
mem_dma_mutex
);
up
(
&
md
->
lynx
->
mem_dma_mutex
);
if
(
retval
<
0
)
return
retval
;
if
(
retval
)
return
-
EFAULT
;
*
offset
+=
count
;
*
offset
+=
count
;
return
count
;
return
count
;
}
}
...
...
drivers/s390/misc/chandev.c
View file @
6d693005
...
@@ -3151,7 +3151,7 @@ static int chandev_write_proc(struct file *file, const char *buffer,
...
@@ -3151,7 +3151,7 @@ static int chandev_write_proc(struct file *file, const char *buffer,
buff
=
vmalloc
(
count
+
1
);
buff
=
vmalloc
(
count
+
1
);
if
(
buff
)
if
(
buff
)
{
{
rc
=
copy_from_user
(
buff
,
buffer
,
count
);
rc
=
copy_from_user
(
buff
,
buffer
,
count
)
?
-
EFAULT
:
0
;
if
(
rc
)
if
(
rc
)
goto
chandev_write_exit
;
goto
chandev_write_exit
;
chandev_do_setup
(
FALSE
,
buff
,
count
);
chandev_do_setup
(
FALSE
,
buff
,
count
);
...
...
drivers/sbus/char/openprom.c
View file @
6d693005
...
@@ -408,9 +408,9 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
...
@@ -408,9 +408,9 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
tmp
[
len
]
=
'\0'
;
tmp
[
len
]
=
'\0'
;
error
=
__copy_to_user
((
void
*
)
arg
,
&
op
,
sizeof
(
op
));
if
(
__copy_to_user
((
void
*
)
arg
,
&
op
,
sizeof
(
op
))
!=
0
if
(
!
error
)
||
copy_to_user
(
op
.
op_buf
,
tmp
,
len
)
!=
0
)
error
=
copy_to_user
(
op
.
op_buf
,
tmp
,
len
)
;
error
=
-
EFAULT
;
kfree
(
tmp
);
kfree
(
tmp
);
kfree
(
str
);
kfree
(
str
);
...
...
sound/isa/sb/sb16_csp.c
View file @
6d693005
...
@@ -215,7 +215,7 @@ static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cm
...
@@ -215,7 +215,7 @@ static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cm
info
.
run_width
=
p
->
run_width
;
info
.
run_width
=
p
->
run_width
;
info
.
version
=
p
->
version
;
info
.
version
=
p
->
version
;
info
.
state
=
p
->
running
;
info
.
state
=
p
->
running
;
err
=
copy_to_user
((
void
*
)
arg
,
&
info
,
sizeof
(
info
));
err
=
copy_to_user
((
void
*
)
arg
,
&
info
,
sizeof
(
info
))
?
-
EFAULT
:
0
;
break
;
break
;
/* load CSP microcode */
/* load CSP microcode */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment