projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1e809e
)
pidfs: switch to copy_struct_to_user()
author
Christian Brauner
<brauner@kernel.org>
Wed, 5 Mar 2025 10:08:11 +0000
(11:08 +0100)
committer
Christian Brauner
<brauner@kernel.org>
Wed, 5 Mar 2025 12:24:52 +0000
(13:24 +0100)
We have a helper that deals with all the required logic.
Link:
https://lore.kernel.org/r/20250305-work-pidfs-kill_on_last_close-v3-1-c8c3d8361705@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/pidfs.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/pidfs.c
b/fs/pidfs.c
index 049352f973de38967ad35c6440b9480e7e2e2775..aa8c8bda8c8f0a076e0464bf254d6f780272934e 100644
(file)
--- a/
fs/pidfs.c
+++ b/
fs/pidfs.c
@@
-276,10
+276,7
@@
static long pidfd_info(struct task_struct *task, unsigned int cmd, unsigned long
* userspace knows about will be copied. If userspace provides a new
* struct, only the bits that the kernel knows about will be copied.
*/
- if (copy_to_user(uinfo, &kinfo, min(usize, sizeof(kinfo))))
- return -EFAULT;
-
- return 0;
+ return copy_struct_to_user(uinfo, usize, &kinfo, sizeof(kinfo), NULL);
}
static bool pidfs_ioctl_valid(unsigned int cmd)