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
nexedi
linux
Commits
a2e80cf8
Commit
a2e80cf8
authored
May 28, 2004
by
Alexander Viro
Committed by
Linus Torvalds
May 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: trivial part of kernel/* __user annotation
parent
c4787237
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
61 additions
and
51 deletions
+61
-51
arch/mips/kernel/irixsig.c
arch/mips/kernel/irixsig.c
+1
-1
arch/mips/kernel/sysirix.c
arch/mips/kernel/sysirix.c
+1
-1
include/linux/compat.h
include/linux/compat.h
+3
-3
include/linux/syscalls.h
include/linux/syscalls.h
+1
-1
kernel/acct.c
kernel/acct.c
+1
-1
kernel/compat.c
kernel/compat.c
+43
-34
kernel/exit.c
kernel/exit.c
+6
-5
kernel/futex.c
kernel/futex.c
+1
-1
kernel/sys.c
kernel/sys.c
+2
-2
kernel/time.c
kernel/time.c
+2
-2
No files found.
arch/mips/kernel/irixsig.c
View file @
a2e80cf8
...
...
@@ -549,7 +549,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
#define P_PGID 2
#define P_ALL 7
extern
int
getrusage
(
struct
task_struct
*
,
int
,
struct
rusage
*
);
extern
int
getrusage
(
struct
task_struct
*
,
int
,
struct
rusage
__user
*
);
#define W_EXITED 1
#define W_TRAPPED 2
...
...
arch/mips/kernel/sysirix.c
View file @
a2e80cf8
...
...
@@ -235,7 +235,7 @@ asmlinkage int irix_prctl(struct pt_regs *regs)
#undef DEBUG_PROCGRPS
extern
unsigned
long
irix_mapelf
(
int
fd
,
struct
elf_phdr
*
user_phdrp
,
int
cnt
);
extern
int
getrusage
(
struct
task_struct
*
p
,
int
who
,
struct
rusage
*
ru
);
extern
int
getrusage
(
struct
task_struct
*
p
,
int
who
,
struct
rusage
__user
*
ru
);
extern
char
*
prom_getenv
(
char
*
name
);
extern
long
prom_setenv
(
char
*
name
,
char
*
value
);
...
...
include/linux/compat.h
View file @
a2e80cf8
...
...
@@ -46,9 +46,9 @@ typedef struct {
compat_sigset_word
sig
[
_COMPAT_NSIG_WORDS
];
}
compat_sigset_t
;
extern
int
cp_compat_stat
(
struct
kstat
*
,
struct
compat_stat
*
);
extern
int
get_compat_timespec
(
struct
timespec
*
,
const
struct
compat_timespec
*
);
extern
int
put_compat_timespec
(
const
struct
timespec
*
,
struct
compat_timespec
*
);
extern
int
cp_compat_stat
(
struct
kstat
*
,
struct
compat_stat
__user
*
);
extern
int
get_compat_timespec
(
struct
timespec
*
,
const
struct
compat_timespec
__user
*
);
extern
int
put_compat_timespec
(
const
struct
timespec
*
,
struct
compat_timespec
__user
*
);
struct
compat_iovec
{
compat_uptr_t
iov_base
;
...
...
include/linux/syscalls.h
View file @
a2e80cf8
...
...
@@ -160,7 +160,7 @@ asmlinkage long sys_kexec_load(void *entry, unsigned long nr_segments,
asmlinkage
long
sys_exit
(
int
error_code
);
asmlinkage
void
sys_exit_group
(
int
error_code
);
asmlinkage
long
sys_wait4
(
pid_t
pid
,
unsigned
int
*
stat_addr
,
asmlinkage
long
sys_wait4
(
pid_t
pid
,
unsigned
int
__user
*
stat_addr
,
int
options
,
struct
rusage
__user
*
ru
);
asmlinkage
long
sys_waitpid
(
pid_t
pid
,
unsigned
int
__user
*
stat_addr
,
int
options
);
asmlinkage
long
sys_set_tid_address
(
int
__user
*
tidptr
);
...
...
kernel/acct.c
View file @
a2e80cf8
...
...
@@ -204,7 +204,7 @@ void acct_file_reopen(struct file *file)
* should be written. If the filename is NULL, accounting will be
* shutdown.
*/
asmlinkage
long
sys_acct
(
const
char
*
name
)
asmlinkage
long
sys_acct
(
const
char
__user
*
name
)
{
struct
file
*
file
=
NULL
;
char
*
tmp
;
...
...
kernel/compat.c
View file @
a2e80cf8
...
...
@@ -23,14 +23,14 @@
#include <asm/uaccess.h>
int
get_compat_timespec
(
struct
timespec
*
ts
,
const
struct
compat_timespec
*
cts
)
int
get_compat_timespec
(
struct
timespec
*
ts
,
const
struct
compat_timespec
__user
*
cts
)
{
return
(
verify_area
(
VERIFY_READ
,
cts
,
sizeof
(
*
cts
))
||
__get_user
(
ts
->
tv_sec
,
&
cts
->
tv_sec
)
||
__get_user
(
ts
->
tv_nsec
,
&
cts
->
tv_nsec
))
?
-
EFAULT
:
0
;
}
int
put_compat_timespec
(
const
struct
timespec
*
ts
,
struct
compat_timespec
*
cts
)
int
put_compat_timespec
(
const
struct
timespec
*
ts
,
struct
compat_timespec
__user
*
cts
)
{
return
(
verify_area
(
VERIFY_WRITE
,
cts
,
sizeof
(
*
cts
))
||
__put_user
(
ts
->
tv_sec
,
&
cts
->
tv_sec
)
||
...
...
@@ -40,7 +40,7 @@ int put_compat_timespec(const struct timespec *ts, struct compat_timespec *cts)
static
long
compat_nanosleep_restart
(
struct
restart_block
*
restart
)
{
unsigned
long
expire
=
restart
->
arg0
,
now
=
jiffies
;
struct
compat_timespec
*
rmtp
;
struct
compat_timespec
__user
*
rmtp
;
/* Did it expire while we handled signals? */
if
(
!
time_after
(
expire
,
now
))
...
...
@@ -51,7 +51,7 @@ static long compat_nanosleep_restart(struct restart_block *restart)
if
(
expire
==
0
)
return
0
;
rmtp
=
(
struct
compat_timespec
*
)
restart
->
arg1
;
rmtp
=
(
struct
compat_timespec
__user
*
)
restart
->
arg1
;
if
(
rmtp
)
{
struct
compat_timespec
ct
;
struct
timespec
t
;
...
...
@@ -66,8 +66,8 @@ static long compat_nanosleep_restart(struct restart_block *restart)
return
-
ERESTART_RESTARTBLOCK
;
}
asmlinkage
long
compat_sys_nanosleep
(
struct
compat_timespec
*
rqtp
,
struct
compat_timespec
*
rmtp
)
asmlinkage
long
compat_sys_nanosleep
(
struct
compat_timespec
__user
*
rqtp
,
struct
compat_timespec
__user
*
rmtp
)
{
struct
timespec
t
;
struct
restart_block
*
restart
;
...
...
@@ -98,7 +98,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec *rqtp,
}
static
inline
long
get_compat_itimerval
(
struct
itimerval
*
o
,
struct
compat_itimerval
*
i
)
struct
compat_itimerval
__user
*
i
)
{
return
(
!
access_ok
(
VERIFY_READ
,
i
,
sizeof
(
*
i
))
||
(
__get_user
(
o
->
it_interval
.
tv_sec
,
&
i
->
it_interval
.
tv_sec
)
|
...
...
@@ -107,7 +107,7 @@ static inline long get_compat_itimerval(struct itimerval *o,
__get_user
(
o
->
it_value
.
tv_usec
,
&
i
->
it_value
.
tv_usec
)));
}
static
inline
long
put_compat_itimerval
(
struct
compat_itimerval
*
o
,
static
inline
long
put_compat_itimerval
(
struct
compat_itimerval
__user
*
o
,
struct
itimerval
*
i
)
{
return
(
!
access_ok
(
VERIFY_WRITE
,
o
,
sizeof
(
*
o
))
||
...
...
@@ -117,7 +117,8 @@ static inline long put_compat_itimerval(struct compat_itimerval *o,
__put_user
(
i
->
it_value
.
tv_usec
,
&
o
->
it_value
.
tv_usec
)));
}
asmlinkage
long
compat_sys_getitimer
(
int
which
,
struct
compat_itimerval
*
it
)
asmlinkage
long
compat_sys_getitimer
(
int
which
,
struct
compat_itimerval
__user
*
it
)
{
struct
itimerval
kit
;
int
error
;
...
...
@@ -128,8 +129,9 @@ asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it)
return
error
;
}
asmlinkage
long
compat_sys_setitimer
(
int
which
,
struct
compat_itimerval
*
in
,
struct
compat_itimerval
*
out
)
asmlinkage
long
compat_sys_setitimer
(
int
which
,
struct
compat_itimerval
__user
*
in
,
struct
compat_itimerval
__user
*
out
)
{
struct
itimerval
kin
,
kout
;
int
error
;
...
...
@@ -148,7 +150,7 @@ asmlinkage long compat_sys_setitimer(int which, struct compat_itimerval *in,
return
0
;
}
asmlinkage
long
compat_sys_times
(
struct
compat_tms
*
tbuf
)
asmlinkage
long
compat_sys_times
(
struct
compat_tms
__user
*
tbuf
)
{
/*
* In the SMP world we might just be unlucky and have one of
...
...
@@ -173,7 +175,7 @@ asmlinkage long compat_sys_times(struct compat_tms *tbuf)
* types that can be passed to put_user()/get_user().
*/
asmlinkage
long
compat_sys_sigpending
(
compat_old_sigset_t
*
set
)
asmlinkage
long
compat_sys_sigpending
(
compat_old_sigset_t
__user
*
set
)
{
old_sigset_t
s
;
long
ret
;
...
...
@@ -187,8 +189,8 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t *set)
return
ret
;
}
asmlinkage
long
compat_sys_sigprocmask
(
int
how
,
compat_old_sigset_t
*
set
,
compat_old_sigset_t
*
oset
)
asmlinkage
long
compat_sys_sigprocmask
(
int
how
,
compat_old_sigset_t
__user
*
set
,
compat_old_sigset_t
__user
*
oset
)
{
old_sigset_t
s
;
long
ret
;
...
...
@@ -207,8 +209,8 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
}
#ifdef CONFIG_FUTEX
asmlinkage
long
compat_sys_futex
(
u32
*
uaddr
,
int
op
,
int
val
,
struct
compat_timespec
*
utime
,
u32
*
uaddr2
)
asmlinkage
long
compat_sys_futex
(
u32
__user
*
uaddr
,
int
op
,
int
val
,
struct
compat_timespec
__user
*
utime
,
u32
__user
*
uaddr2
)
{
struct
timespec
t
;
unsigned
long
timeout
=
MAX_SCHEDULE_TIMEOUT
;
...
...
@@ -227,7 +229,8 @@ asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val,
}
#endif
asmlinkage
long
compat_sys_setrlimit
(
unsigned
int
resource
,
struct
compat_rlimit
*
rlim
)
asmlinkage
long
compat_sys_setrlimit
(
unsigned
int
resource
,
struct
compat_rlimit
__user
*
rlim
)
{
struct
rlimit
r
;
int
ret
;
...
...
@@ -253,7 +256,8 @@ asmlinkage long compat_sys_setrlimit(unsigned int resource, struct compat_rlimit
#ifdef COMPAT_RLIM_OLD_INFINITY
asmlinkage
long
compat_sys_old_getrlimit
(
unsigned
int
resource
,
struct
compat_rlimit
*
rlim
)
asmlinkage
long
compat_sys_old_getrlimit
(
unsigned
int
resource
,
struct
compat_rlimit
__user
*
rlim
)
{
struct
rlimit
r
;
int
ret
;
...
...
@@ -279,7 +283,8 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource, struct compat_rl
#endif
asmlinkage
long
compat_sys_getrlimit
(
unsigned
int
resource
,
struct
compat_rlimit
*
rlim
)
asmlinkage
long
compat_sys_getrlimit
(
unsigned
int
resource
,
struct
compat_rlimit
__user
*
rlim
)
{
struct
rlimit
r
;
int
ret
;
...
...
@@ -302,7 +307,7 @@ asmlinkage long compat_sys_getrlimit (unsigned int resource, struct compat_rlimi
return
ret
;
}
static
long
put_compat_rusage
(
struct
compat_rusage
*
ru
,
struct
rusage
*
r
)
static
long
put_compat_rusage
(
struct
compat_rusage
__user
*
ru
,
struct
rusage
*
r
)
{
if
(
!
access_ok
(
VERIFY_WRITE
,
ru
,
sizeof
(
*
ru
))
||
__put_user
(
r
->
ru_utime
.
tv_sec
,
&
ru
->
ru_utime
.
tv_sec
)
||
...
...
@@ -327,7 +332,7 @@ static long put_compat_rusage (struct compat_rusage *ru, struct rusage *r)
return
0
;
}
asmlinkage
long
compat_sys_getrusage
(
int
who
,
struct
compat_rusage
*
ru
)
asmlinkage
long
compat_sys_getrusage
(
int
who
,
struct
compat_rusage
__user
*
ru
)
{
struct
rusage
r
;
int
ret
;
...
...
@@ -347,8 +352,8 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage *ru)
}
asmlinkage
long
compat_sys_wait4
(
compat_pid_t
pid
,
compat_uint_t
*
stat_addr
,
int
options
,
struct
compat_rusage
*
ru
)
compat_sys_wait4
(
compat_pid_t
pid
,
compat_uint_t
__user
*
stat_addr
,
int
options
,
struct
compat_rusage
__user
*
ru
)
{
if
(
!
ru
)
{
return
sys_wait4
(
pid
,
stat_addr
,
options
,
NULL
);
...
...
@@ -374,7 +379,7 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options,
asmlinkage
long
compat_sys_sched_setaffinity
(
compat_pid_t
pid
,
unsigned
int
len
,
compat_ulong_t
*
user_mask_ptr
)
compat_ulong_t
__user
*
user_mask_ptr
)
{
unsigned
long
kernel_mask
;
mm_segment_t
old_fs
;
...
...
@@ -394,7 +399,7 @@ asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
}
asmlinkage
int
compat_sys_sched_getaffinity
(
compat_pid_t
pid
,
unsigned
int
len
,
compat_ulong_t
*
user_mask_ptr
)
compat_ulong_t
__user
*
user_mask_ptr
)
{
unsigned
long
kernel_mask
;
mm_segment_t
old_fs
;
...
...
@@ -417,7 +422,7 @@ asmlinkage int compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
}
static
int
get_compat_itimerspec
(
struct
itimerspec
*
dst
,
struct
compat_itimerspec
*
src
)
struct
compat_itimerspec
__user
*
src
)
{
if
(
get_compat_timespec
(
&
dst
->
it_interval
,
&
src
->
it_interval
)
||
get_compat_timespec
(
&
dst
->
it_value
,
&
src
->
it_value
))
...
...
@@ -425,7 +430,7 @@ static int get_compat_itimerspec(struct itimerspec *dst,
return
0
;
}
static
int
put_compat_itimerspec
(
struct
compat_itimerspec
*
dst
,
static
int
put_compat_itimerspec
(
struct
compat_itimerspec
__user
*
dst
,
struct
itimerspec
*
src
)
{
if
(
put_compat_timespec
(
&
src
->
it_interval
,
&
dst
->
it_interval
)
||
...
...
@@ -435,8 +440,8 @@ static int put_compat_itimerspec(struct compat_itimerspec *dst,
}
long
compat_timer_settime
(
timer_t
timer_id
,
int
flags
,
struct
compat_itimerspec
*
new
,
struct
compat_itimerspec
*
old
)
struct
compat_itimerspec
__user
*
new
,
struct
compat_itimerspec
__user
*
old
)
{
long
err
;
mm_segment_t
oldfs
;
...
...
@@ -455,7 +460,8 @@ long compat_timer_settime(timer_t timer_id, int flags,
return
err
;
}
long
compat_timer_gettime
(
timer_t
timer_id
,
struct
compat_itimerspec
*
setting
)
long
compat_timer_gettime
(
timer_t
timer_id
,
struct
compat_itimerspec
__user
*
setting
)
{
long
err
;
mm_segment_t
oldfs
;
...
...
@@ -469,7 +475,8 @@ long compat_timer_gettime(timer_t timer_id, struct compat_itimerspec *setting)
return
err
;
}
long
compat_clock_settime
(
clockid_t
which_clock
,
struct
compat_timespec
*
tp
)
long
compat_clock_settime
(
clockid_t
which_clock
,
struct
compat_timespec
__user
*
tp
)
{
long
err
;
mm_segment_t
oldfs
;
...
...
@@ -483,7 +490,8 @@ long compat_clock_settime(clockid_t which_clock, struct compat_timespec *tp)
return
err
;
}
long
compat_clock_gettime
(
clockid_t
which_clock
,
struct
compat_timespec
*
tp
)
long
compat_clock_gettime
(
clockid_t
which_clock
,
struct
compat_timespec
__user
*
tp
)
{
long
err
;
mm_segment_t
oldfs
;
...
...
@@ -497,7 +505,8 @@ long compat_clock_gettime(clockid_t which_clock, struct compat_timespec *tp)
return
err
;
}
long
compat_clock_getres
(
clockid_t
which_clock
,
struct
compat_timespec
*
tp
)
long
compat_clock_getres
(
clockid_t
which_clock
,
struct
compat_timespec
__user
*
tp
)
{
long
err
;
mm_segment_t
oldfs
;
...
...
kernel/exit.c
View file @
a2e80cf8
...
...
@@ -32,7 +32,7 @@
extern
void
sem_exit
(
void
);
extern
struct
task_struct
*
child_reaper
;
int
getrusage
(
struct
task_struct
*
,
int
,
struct
rusage
*
);
int
getrusage
(
struct
task_struct
*
,
int
,
struct
rusage
__user
*
);
static
void
__unhash_process
(
struct
task_struct
*
p
)
{
...
...
@@ -936,7 +936,7 @@ static int eligible_child(pid_t pid, int options, task_t *p)
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
static
int
wait_task_zombie
(
task_t
*
p
,
unsigned
int
*
stat_addr
,
struct
rusage
*
ru
)
static
int
wait_task_zombie
(
task_t
*
p
,
unsigned
int
__user
*
stat_addr
,
struct
rusage
__user
*
ru
)
{
unsigned
long
state
;
int
retval
;
...
...
@@ -1009,7 +1009,8 @@ static int wait_task_zombie(task_t *p, unsigned int *stat_addr, struct rusage *r
* released the lock and the system call should return.
*/
static
int
wait_task_stopped
(
task_t
*
p
,
int
delayed_group_leader
,
unsigned
int
*
stat_addr
,
struct
rusage
*
ru
)
unsigned
int
__user
*
stat_addr
,
struct
rusage
__user
*
ru
)
{
int
retval
,
exit_code
;
...
...
@@ -1079,7 +1080,7 @@ static int wait_task_stopped(task_t *p, int delayed_group_leader,
return
retval
;
}
asmlinkage
long
sys_wait4
(
pid_t
pid
,
unsigned
int
*
stat_addr
,
int
options
,
struct
rusage
*
ru
)
asmlinkage
long
sys_wait4
(
pid_t
pid
,
unsigned
int
__user
*
stat_addr
,
int
options
,
struct
rusage
__user
*
ru
)
{
DECLARE_WAITQUEUE
(
wait
,
current
);
struct
task_struct
*
tsk
;
...
...
@@ -1168,7 +1169,7 @@ asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struc
* sys_waitpid() remains for compatibility. waitpid() should be
* implemented by calling sys_wait4() from libc.a.
*/
asmlinkage
long
sys_waitpid
(
pid_t
pid
,
unsigned
int
*
stat_addr
,
int
options
)
asmlinkage
long
sys_waitpid
(
pid_t
pid
,
unsigned
__user
*
stat_addr
,
int
options
)
{
return
sys_wait4
(
pid
,
stat_addr
,
options
,
NULL
);
}
...
...
kernel/futex.c
View file @
a2e80cf8
...
...
@@ -459,7 +459,7 @@ static int futex_wait(unsigned long uaddr, int val, unsigned long time)
* We hold the mmap semaphore, so the mapping cannot have changed
* since we looked it up.
*/
if
(
get_user
(
curval
,
(
int
*
)
uaddr
)
!=
0
)
{
if
(
get_user
(
curval
,
(
int
__user
*
)
uaddr
)
!=
0
)
{
ret
=
-
EFAULT
;
goto
out_unqueue
;
}
...
...
kernel/sys.c
View file @
a2e80cf8
...
...
@@ -819,7 +819,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
return
security_task_post_setuid
(
old_ruid
,
old_euid
,
old_suid
,
LSM_SETID_RES
);
}
asmlinkage
long
sys_getresuid
(
uid_t
*
ruid
,
uid_t
*
euid
,
uid_t
*
suid
)
asmlinkage
long
sys_getresuid
(
uid_t
__user
*
ruid
,
uid_t
__user
*
euid
,
uid_t
__user
*
suid
)
{
int
retval
;
...
...
@@ -868,7 +868,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
return
0
;
}
asmlinkage
long
sys_getresgid
(
gid_t
*
rgid
,
gid_t
*
egid
,
gid_t
*
sgid
)
asmlinkage
long
sys_getresgid
(
gid_t
__user
*
rgid
,
gid_t
__user
*
egid
,
gid_t
__user
*
sgid
)
{
int
retval
;
...
...
kernel/time.c
View file @
a2e80cf8
...
...
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(sys_tz);
*
* XXX This function is NOT 64-bit clean!
*/
asmlinkage
long
sys_time
(
int
*
tloc
)
asmlinkage
long
sys_time
(
int
__user
*
tloc
)
{
int
i
;
struct
timeval
tv
;
...
...
@@ -71,7 +71,7 @@ asmlinkage long sys_time(int * tloc)
* architectures that need it).
*/
asmlinkage
long
sys_stime
(
time_t
*
tptr
)
asmlinkage
long
sys_stime
(
time_t
__user
*
tptr
)
{
struct
timespec
tv
;
...
...
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