mirror of https://github.com/torvalds/linux.git
pidfs: add missing BUILD_BUG_ON() assert on struct pidfd_info
Validate that the size of struct pidfd_info is correctly updated.
Link: https://patch.msgid.link/20251028-work-coredump-signal-v1-4-ca449b7b7aa0@kernel.org
Fixes: 1d8db6fd69 ("pidfs, coredump: add PIDFD_INFO_COREDUMP")
Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
4061c43a99
commit
d8fc51d8fa
|
|
@ -306,6 +306,8 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
const struct cred *c;
|
const struct cred *c;
|
||||||
__u64 mask;
|
__u64 mask;
|
||||||
|
|
||||||
|
BUILD_BUG_ON(sizeof(struct pidfd_info) != PIDFD_INFO_SIZE_VER1);
|
||||||
|
|
||||||
if (!uinfo)
|
if (!uinfo)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (usize < PIDFD_INFO_SIZE_VER0)
|
if (usize < PIDFD_INFO_SIZE_VER0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue