summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2020-05-26 10:37:47 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2020-05-26 19:58:38 +1000
commit06404f13bea6c6c46c7f1750acf94c7c3e782765 (patch)
tree56200026ef19334e37153fd90339558043d7b9c9 /include
parent680b5a882e89a994cad62fb7190e57318289ada2 (diff)
mm: return EBADF if pidfd is invalid
This patch makes returning of EBADF when the fd passed as argument is invalid. The implementaion relies on pidfd_get_pid's error return. This patch also fixes syscall declare part since we removed pid support. Link: http://lkml.kernel.org/r/20200519181447.GA220547@google.com Signed-off-by: Minchan Kim <minchan@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'include')
-rw-r--r--include/linux/compat.h6
-rw-r--r--include/linux/syscalls.h5
2 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 2e2f0a2700ab..86b61e873947 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -827,10 +827,10 @@ asmlinkage long compat_sys_pwritev64v2(unsigned long fd,
unsigned long vlen, loff_t pos, rwf_t flags);
#endif
-asmlinkage ssize_t compat_sys_process_madvise(compat_int_t which,
- compat_pid_t upid, const struct compat_iovec __user *vec,
+asmlinkage ssize_t compat_sys_process_madvise(compat_int_t pidfd,
+ const struct compat_iovec __user *vec,
compat_ulong_t vlen, compat_int_t behavior,
- compat_ulong_t flags);
+ compat_int_t flags);
/*
* Deprecated system calls which are still defined in
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2cbd3660e8e6..63ffa6dc9da3 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -879,9 +879,8 @@ asmlinkage long sys_munlockall(void);
asmlinkage long sys_mincore(unsigned long start, size_t len,
unsigned char __user * vec);
asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior);
-asmlinkage long sys_process_madvise(int which, pid_t upid,
- const struct iovec __user *vec, unsigned long vlen,
- int behavior, unsigned long flags);
+asmlinkage long sys_process_madvise(int pidfd, const struct iovec __user *vec,
+ unsigned long vlen, int behavior, unsigned int flags);
asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
unsigned long prot, unsigned long pgoff,
unsigned long flags);