Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Günther Noack" <gnoack3000@gmail.com>,
	"Mickaël Salaün" <mic@digikod.net>,
	"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 6.18.y 4/5] landlock: Use mem_is_zero() in is_layer_masks_allowed()
Date: Wed, 16 Sep 2026 21:39:39 -0400	[thread overview]
Message-ID: <20260917013940.3651217-4-sashal@kernel.org> (raw)
In-Reply-To: <20260917013940.3651217-1-sashal@kernel.org>

From: Günther Noack <gnoack3000@gmail.com>

[ Upstream commit 1c4fe87364782d1b058cc9d15fc8acef44bce033 ]

This is equivalent, but expresses the intent a bit clearer.

Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20260327164838.38231-3-gnoack3000@gmail.com
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Stable-dep-of: 2c6dc7925382 ("landlock: Fix use-after-free of the source's parent directory")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 3fa30715531c6..a9a5fc5ba1bb8 100644
--- a/security/landlock/fs.c
+++ b/security/landlock/fs.c
@@ -559,7 +559,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));
 }
 
 /*
-- 
2.53.0


  parent reply	other threads:[~2026-09-17  1:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 15:46 FAILED: patch "[PATCH] landlock: Fix use-after-free of the source's parent directory" failed to apply to 6.18-stable tree gregkh
2026-09-17  1:39 ` [PATCH 6.18.y 1/5] landlock: Clarify documentation for the IOCTL access right Sasha Levin
2026-09-17  1:39   ` [PATCH 6.18.y 2/5] landlock: Add access_mask_subset() helper Sasha Levin
2026-09-17  1:39   ` [PATCH 6.18.y 3/5] landlock: Transpose the layer masks data structure Sasha Levin
2026-09-17  1:39   ` Sasha Levin [this message]
2026-09-17  1:39   ` [PATCH 6.18.y 5/5] landlock: Fix use-after-free of the source's parent directory Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260917013940.3651217-4-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=gnoack3000@gmail.com \
    --cc=mic@digikod.net \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox