[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251025164023.308884-21-yury.norov@gmail.com>
Date: Sat, 25 Oct 2025 12:40:19 -0400
From: "Yury Norov (NVIDIA)" <yury.norov@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Linus Walleij <linus.walleij@...aro.org>,
Nicolas Frattaroli <nicolas.frattaroli@...labora.com>,
Kees Cook <kees@...nel.org>,
linux-hardening@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: "Yury Norov (NVIDIA)" <yury.norov@...il.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH 20/21] fortify-string: don't use GENMASK()
GENMASK(high, low) notation is confusing. BITS(low, high) is more
appropriate.
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@...il.com>
---
include/linux/fortify-string.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h
index b3b53f8c1b28..0c95cdcca736 100644
--- a/include/linux/fortify-string.h
+++ b/include/linux/fortify-string.h
@@ -11,9 +11,9 @@
#define __RENAME(x) __asm__(#x)
#define FORTIFY_REASON_DIR(r) FIELD_GET(BIT(0), r)
-#define FORTIFY_REASON_FUNC(r) FIELD_GET(GENMASK(7, 1), r)
+#define FORTIFY_REASON_FUNC(r) FIELD_GET(BITS(1, 7), r)
#define FORTIFY_REASON(func, write) (FIELD_PREP(BIT(0), write) | \
- FIELD_PREP(GENMASK(7, 1), func))
+ FIELD_PREP(BITS(1, 7), func))
/* Overridden by KUnit tests. */
#ifndef fortify_panic
--
2.43.0
Powered by blists - more mailing lists