Skip to content

Commit

Permalink
[CVE-2009-0029] System call wrappers part 32
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 836f92a commit d4e8204
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
5 changes: 2 additions & 3 deletions fs/eventfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ struct file *eventfd_fget(int fd)
return file;
}

asmlinkage long sys_eventfd2(unsigned int count, int flags)
SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
{
int fd;
struct eventfd_ctx *ctx;
Expand Down Expand Up @@ -228,8 +228,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags)
return fd;
}

asmlinkage long sys_eventfd(unsigned int count)
SYSCALL_DEFINE1(eventfd, unsigned int, count)
{
return sys_eventfd2(count, 0);
}

2 changes: 1 addition & 1 deletion fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ int do_pipe(int *fd)
* sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way Unix traditionally does this, though.
*/
asmlinkage long sys_pipe2(int __user *fildes, int flags)
SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
{
int fd[2];
int error;
Expand Down
3 changes: 2 additions & 1 deletion fs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset
return -EFAULT;
}

asmlinkage long sys_old_readdir(unsigned int fd, struct old_linux_dirent __user * dirent, unsigned int count)
SYSCALL_DEFINE3(old_readdir, unsigned int, fd,
struct old_linux_dirent __user *, dirent, unsigned int, count)
{
int error;
struct file * file;
Expand Down
11 changes: 6 additions & 5 deletions fs/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,9 @@ static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp,
* which has a pointer to the sigset_t itself followed by a size_t containing
* the sigset size.
*/
asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp,
fd_set __user *exp, struct timespec __user *tsp, void __user *sig)
SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp,
fd_set __user *, exp, struct timespec __user *, tsp,
void __user *, sig)
{
size_t sigsetsize = 0;
sigset_t __user *up = NULL;
Expand Down Expand Up @@ -889,9 +890,9 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
}

#ifdef HAVE_SET_RESTORE_SIGMASK
asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
struct timespec __user *tsp, const sigset_t __user *sigmask,
size_t sigsetsize)
SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds,
struct timespec __user *, tsp, const sigset_t __user *, sigmask,
size_t, sigsetsize)
{
sigset_t ksigmask, sigsaved;
struct timespec ts, end_time, *to = NULL;
Expand Down
2 changes: 1 addition & 1 deletion fs/timerfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags,
return 0;
}

asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr)
SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct itimerspec __user *, otmr)
{
struct file *file;
struct timerfd_ctx *ctx;
Expand Down
7 changes: 7 additions & 0 deletions include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,13 @@ asmlinkage long sys_eventfd(unsigned int count);
asmlinkage long sys_eventfd2(unsigned int count, int flags);
asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int);
asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,
fd_set __user *, struct timespec __user *,
void __user *);
asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int,
struct timespec __user *, const sigset_t __user *,
size_t);
asmlinkage long sys_pipe2(int __user *, int);

int kernel_execve(const char *filename, char *const argv[], char *const envp[]);

Expand Down
11 changes: 5 additions & 6 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2491,11 +2491,10 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set,
#endif /* __ARCH_WANT_SYS_SIGPROCMASK */

#ifdef __ARCH_WANT_SYS_RT_SIGACTION
asmlinkage long
sys_rt_sigaction(int sig,
const struct sigaction __user *act,
struct sigaction __user *oact,
size_t sigsetsize)
SYSCALL_DEFINE4(rt_sigaction, int, sig,
const struct sigaction __user *, act,
struct sigaction __user *, oact,
size_t, sigsetsize)
{
struct k_sigaction new_sa, old_sa;
int ret = -EINVAL;
Expand Down Expand Up @@ -2578,7 +2577,7 @@ SYSCALL_DEFINE0(pause)
#endif

#ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND
asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize)
{
sigset_t newset;

Expand Down

0 comments on commit d4e8204

Please sign in to comment.