Skip to content

Commit

Permalink
[CVE-2009-0029] System call wrappers part 15
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 3480b25 commit a26eab2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions fs/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int get_close_on_exec(unsigned int fd)
return res;
}

asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
{
int err = -EBADF;
struct file * file, *tofree;
Expand Down Expand Up @@ -113,7 +113,7 @@ asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
return err;
}

asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd)
{
if (unlikely(newfd == oldfd)) { /* corner case */
struct files_struct *files = current->files;
Expand All @@ -126,7 +126,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
return sys_dup3(oldfd, newfd, 0);
}

asmlinkage long sys_dup(unsigned int fildes)
SYSCALL_DEFINE1(dup, unsigned int, fildes)
{
int ret = -EBADF;
struct file *file = fget(fildes);
Expand Down Expand Up @@ -335,7 +335,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
return err;
}

asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
{
struct file *filp;
long err = -EBADF;
Expand All @@ -358,7 +358,8 @@ asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
}

#if BITS_PER_LONG == 32
asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
unsigned long, arg)
{
struct file * filp;
long err;
Expand Down
2 changes: 1 addition & 1 deletion fs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
return error;
}

asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
{
struct file *filp;
int error = -EBADF;
Expand Down
2 changes: 1 addition & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2718,7 +2718,7 @@ asmlinkage long sys_renameat(int olddfd, const char __user *oldname,
return error;
}

asmlinkage long sys_rename(const char __user *oldname, const char __user *newname)
SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname)
{
return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname);
}
Expand Down
4 changes: 2 additions & 2 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
return error;
}

asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode)
{
struct inode * inode;
struct dentry * dentry;
Expand Down Expand Up @@ -658,7 +658,7 @@ asmlinkage long sys_fchmodat(int dfd, const char __user *filename,
return error;
}

asmlinkage long sys_chmod(const char __user *filename, mode_t mode)
SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode)
{
return sys_fchmodat(AT_FDCWD, filename, mode);
}
Expand Down

0 comments on commit a26eab2

Please sign in to comment.