landlock: Define access_mask_t to enforce a consistent access mask size
authorMickaël Salaün <mic@digikod.net>
Fri, 6 May 2022 16:10:51 +0000 (18:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:26:23 +0000 (10:26 +0200)
commit0485e40305080d6269404aa783996baeb2b28b5e
tree0b64bfa68d2b5035bae9568848530e20a05d7330
parente17367395f87f03700e56c6bc7a46be48046f6dd
landlock: Define access_mask_t to enforce a consistent access mask size

commit 5f2ff33e10843ef51275c8611bdb7b49537aba5d upstream.

Create and use the access_mask_t typedef to enforce a consistent access
mask size and uniformly use a 16-bits type.  This will helps transition
to a 32-bits value one day.

Add a build check to make sure all (filesystem) access rights fit in.
This will be extended with a following commit.

Reviewed-by: Paul Moore <paul@paul-moore.com>
Link: https://lore.kernel.org/r/20220506161102.525323-2-mic@digikod.net
Cc: stable@vger.kernel.org
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/landlock/fs.c
security/landlock/fs.h
security/landlock/limits.h
security/landlock/ruleset.c
security/landlock/ruleset.h