Skip to content

Commit

Permalink
[CVE-2009-0029] System call wrappers part 07
Browse files Browse the repository at this point in the history
Signed-off-by: Heiko Carstens <[email protected]>
  • Loading branch information
heicarst committed Jan 14, 2009
1 parent 5add95d commit 754fe8d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ NORET_TYPE void complete_and_exit(struct completion *comp, long code)

EXPORT_SYMBOL(complete_and_exit);

asmlinkage long sys_exit(int error_code)
SYSCALL_DEFINE1(exit, int, error_code)
{
do_exit((error_code&0xff)<<8);
}
Expand Down Expand Up @@ -1182,7 +1182,7 @@ do_group_exit(int exit_code)
* wait4()-ing process will get the correct exit code - even if this
* thread is not the thread group leader.
*/
asmlinkage long sys_exit_group(int error_code)
SYSCALL_DEFINE1(exit_group, int, error_code)
{
do_group_exit((error_code & 0xff) << 8);
/* NOTREACHED */
Expand Down Expand Up @@ -1795,8 +1795,8 @@ asmlinkage long sys_waitid(int which, pid_t upid,
return ret;
}

asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr,
int options, struct rusage __user *ru)
SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr,
int, options, struct rusage __user *, ru)
{
struct pid *pid = NULL;
enum pid_type type;
Expand Down
5 changes: 2 additions & 3 deletions kernel/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,8 @@ struct kimage *kexec_crash_image;

static DEFINE_MUTEX(kexec_mutex);

asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
struct kexec_segment __user *segments,
unsigned long flags)
SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
struct kexec_segment __user *, segments, unsigned long, flags)
{
struct kimage **dest_image, *image;
int result;
Expand Down
4 changes: 2 additions & 2 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -5869,8 +5869,8 @@ SYSCALL_DEFINE1(sched_get_priority_min, int, policy)
* this syscall writes the default timeslice value of a given process
* into the user-space timespec buffer. A value of '0' means infinity.
*/
asmlinkage
long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
SYSCALL_DEFINE4(sched_rr_get_interval, pid_t, pid,
struct timespec __user *, interval)
{
struct task_struct *p;
unsigned int time_slice;
Expand Down
2 changes: 1 addition & 1 deletion kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ EXPORT_SYMBOL(unblock_all_signals);
* System call entry points.
*/

asmlinkage long sys_restart_syscall(void)
SYSCALL_DEFINE0(restart_syscall)
{
struct restart_block *restart = &current_thread_info()->restart_block;
return restart->fn(restart);
Expand Down
7 changes: 4 additions & 3 deletions kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static int set_one_prio(struct task_struct *p, int niceval, int error)
return error;
}

asmlinkage long sys_setpriority(int which, int who, int niceval)
SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
{
struct task_struct *g, *p;
struct user_struct *user;
Expand Down Expand Up @@ -208,7 +208,7 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
* has been offset by 20 (ie it returns 40..1 instead of -20..19)
* to stay compatible.
*/
asmlinkage long sys_getpriority(int which, int who)
SYSCALL_DEFINE2(getpriority, int, which, int, who)
{
struct task_struct *g, *p;
struct user_struct *user;
Expand Down Expand Up @@ -355,7 +355,8 @@ EXPORT_SYMBOL_GPL(kernel_power_off);
*
* reboot doesn't sync: do that yourself before calling this.
*/
asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user * arg)
SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
void __user *, arg)
{
char buffer[256];

Expand Down
2 changes: 1 addition & 1 deletion net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ asmlinkage long sys_getsockopt(int fd, int level, int optname,
* Shutdown a socket.
*/

asmlinkage long sys_shutdown(int fd, int how)
SYSCALL_DEFINE2(shutdown, int, fd, int, how)
{
int err, fput_needed;
struct socket *sock;
Expand Down

0 comments on commit 754fe8d

Please sign in to comment.