]> git.baikalelectronics.ru Git - kernel.git/commit
clone3: add build-time CLONE_ARGS_SIZE_VER* validity checks
authorEugene Syromiatnikov <esyr@redhat.com>
Sun, 12 Apr 2020 20:26:58 +0000 (22:26 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 15 Apr 2020 07:56:32 +0000 (09:56 +0200)
commitf91918f867576f7e1ce2c56972c1c766bd299f48
tree13ef1715ea1d89059e4e6738d7fd19dea930d5e2
parent459fe9c7949dc6dc13e11191c16ba6b94d61a3fd
clone3: add build-time CLONE_ARGS_SIZE_VER* validity checks

CLONE_ARGS_SIZE_VER* macros are defined explicitly and not via
the offsets of the relevant struct clone_args fields, which makes
it rather error-prone, so it probably makes sense to add some
compile-time checks for them (including the one that breaks
on struct clone_args extension as a reminder to add a relevant
size macro and a similar check).  Function copy_clone_args_from_user
seems to be a good place for such checks.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20200412202658.GA31499@asgard.redhat.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
kernel/fork.c