Skip to content

Commit ae7a542

Browse files
braunergregkh
authored andcommitted
pidfs: add missing BUILD_BUG_ON() assert on struct pidfd_info
[ Upstream commit d8fc51d ] 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: 1d8db6f ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent eab1b59 commit ae7a542

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/pidfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)
306306
const struct cred *c;
307307
__u64 mask;
308308

309+
BUILD_BUG_ON(sizeof(struct pidfd_info) != PIDFD_INFO_SIZE_VER1);
310+
309311
if (!uinfo)
310312
return -EINVAL;
311313
if (usize < PIDFD_INFO_SIZE_VER0)

0 commit comments

Comments
 (0)