[PATCH v6 2/9] landlock: use mem_is_zero() in is_layer_masks_allowed()

Mickaël Salaün mic at digikod.net
Wed Mar 18 16:52:10 UTC 2026


Subject should be "landlock: Use..."

On Sun, Mar 15, 2026 at 11:21:43PM +0100, Günther Noack wrote:
> This is equivalent, but expresses the intent a bit clearer.
> 
> Signed-off-by: Günther Noack <gnoack3000 at gmail.com>
> ---
>  security/landlock/fs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/landlock/fs.c b/security/landlock/fs.c
> index a03ec664c78e..97065d51685a 100644
> --- a/security/landlock/fs.c
> +++ b/security/landlock/fs.c
> @@ -564,7 +564,7 @@ static void test_no_more_access(struct kunit *const test)
>  
>  static bool is_layer_masks_allowed(const struct layer_access_masks *masks)
>  {
> -	return !memchr_inv(&masks->access, 0, sizeof(masks->access));
> +	return mem_is_zero(&masks->access, sizeof(masks->access));

Thanks

>  }
>  
>  /*
> -- 
> 2.53.0
> 
> 



More information about the Linux-security-module-archive mailing list