[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260113063610.3137213-1-samasth.norway.ananda@oracle.com>
Date: Mon, 12 Jan 2026 22:36:10 -0800
From: Samasth Norway Ananda <samasth.norway.ananda@...cle.com>
To: mic@...ikod.net, gnoack@...gle.com
Cc: linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] landlock: Fix unsigned comparison in get_id_range()
Fix unsigned comparison where size_t variable is compared with '<= 0'.
Change to '== 0' to match the actual intent.
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@...cle.com>
---
security/landlock/id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/landlock/id.c b/security/landlock/id.c
index 838c3ed7bb82..5424cb3d7ee3 100644
--- a/security/landlock/id.c
+++ b/security/landlock/id.c
@@ -96,7 +96,7 @@ static u64 get_id_range(size_t number_of_ids, atomic64_t *const counter,
* We should return at least 1 ID, and we may need a set of consecutive
* ones (e.g. to generate a set of inodes).
*/
- if (WARN_ON_ONCE(number_of_ids <= 0))
+ if (WARN_ON_ONCE(number_of_ids == 0))
number_of_ids = 1;
/*
--
2.50.1
Powered by blists - more mailing lists