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:30:47 +0000 (10:30 +0200)
commit1dd38ce264e6b0d1d770545fb7c5aaed13e4f864
tree56b3df8700f7f3c48f3ee1467441998e175538d6
parent71a75ca9b21f218a29108fe8c688dca78eefe5c0
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