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
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)