gbmc/linux/23584035ade3c4b9d5c7ddb2e82a1d159221c5c9
Merge patch series "pidfs: do not report fields that do not fit into the caller's struct"
Nickolai Zeldovich <nickolai@csail.mit.edu> says:
PIDFD_GET_INFO sets the mask bits of fields that lie beyond the struct
size the caller passed, although the uapi header promises that the mask
names no such field and tells userspace to rely on the mask. Patch 1
clears those bits before the copy. Patch 2 adds a selftest for it.
Tested in a QEMU x86_64 guest: the new test fails without patch 1 and
passes with it, and the other pidfd selftests give the same results with
and without patch 1. Built with W=1 for x86_64.
The bug was found and fixed with the assistance of an AI agent.
* patches from https://patch.msgid.link/20261024041334.831273-1-nickolai@csail.mit.edu:
selftests/pidfd: test that fields beyond the struct size are not reported
pidfs: do not report fields that do not fit into the caller's struct
Link: https://patch.msgid.link/20261024041334.831273-1-nickolai@csail.mit.edu
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>