History

pidfs: add missing BUILD_BUG_ON() assert on struct pidfd_info

Validate that the size of struct pidfd_info is correctly updated.

Christian Brauner committed 1 year ago

Commit d8fc51d1 parent 4061c431 file · +2 −0Browse files

Unified · Split

fs/pidfs.c+2−0
@@ -306,6 +306,8 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg) · 305 unmodified lines
306 const struct cred *c;306 const struct cred *c;
307 __u64 mask;307 __u64 mask;
308 308
309 BUILD_BUG_ON(sizeof(struct pidfd_info) != PIDFD_INFO_SIZE_VER1);
310
309 if (!uinfo)311 if (!uinfo)
310 return -EINVAL;312 return -EINVAL;
311 if (usize < PIDFD_INFO_SIZE_VER0)313 if (usize < PIDFD_INFO_SIZE_VER0)