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:23:24 +0000 (10:23 +0200)
commitf4cd27b8466ac806a7b6c0d0986ca5f0d0a88980
tree461ccf7d090dc0abed732c15eec8fdd42d81311f
parent90136f20a3d4e4dea5b865fc9d5cc4bfdbd5b65f
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