Skip to content

Commit

Permalink
[CVE-2009-0029] System call wrappers part 25
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 e48fbb6 commit d5460c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions ipc/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ static struct file *do_open(struct dentry *dentry, int oflag)
return dentry_open(dentry, mqueue_mnt, oflag, cred);
}

asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
struct mq_attr __user *u_attr)
SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode,
struct mq_attr __user *, u_attr)
{
struct dentry *dentry;
struct file *filp;
Expand Down Expand Up @@ -721,7 +721,7 @@ asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
return fd;
}

asmlinkage long sys_mq_unlink(const char __user *u_name)
SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
{
int err;
char *name;
Expand Down
9 changes: 5 additions & 4 deletions ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp,
return 0;
}

asmlinkage long sys_semget(key_t key, int nsems, int semflg)
SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg)
{
struct ipc_namespace *ns;
struct ipc_ops sem_ops;
Expand Down Expand Up @@ -1055,8 +1055,8 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)
return un;
}

asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,
unsigned nsops, const struct timespec __user *timeout)
SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
unsigned, nsops, const struct timespec __user *, timeout)
{
int error = -EINVAL;
struct sem_array *sma;
Expand Down Expand Up @@ -1232,7 +1232,8 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,
return error;
}

asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops)
SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops,
unsigned, nsops)
{
return sys_semtimedop(semid, tsops, nsops, NULL);
}
Expand Down
8 changes: 4 additions & 4 deletions ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp,
return 0;
}

asmlinkage long sys_shmget (key_t key, size_t size, int shmflg)
SYSCALL_DEFINE3(shmget, key_t, key, size_t, size, int, shmflg)
{
struct ipc_namespace *ns;
struct ipc_ops shm_ops;
Expand Down Expand Up @@ -621,7 +621,7 @@ static int shmctl_down(struct ipc_namespace *ns, int shmid, int cmd,
return err;
}

asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf)
SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
{
struct shmid_kernel *shp;
int err, version;
Expand Down Expand Up @@ -939,7 +939,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
goto out_nattch;
}

asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
{
unsigned long ret;
long err;
Expand All @@ -955,7 +955,7 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
* detach and kill segment if marked destroyed.
* The work is done in shm_close.
*/
asmlinkage long sys_shmdt(char __user *shmaddr)
SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma, *next;
Expand Down

0 comments on commit d5460c9

Please sign in to comment.