lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250426180837.82025-1-trintaeoitogc@gmail.com>
Date: Sat, 26 Apr 2025 15:08:37 -0300
From: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
To: akpm@...ux-foundation.org,
	pasha.tatashin@...een.com,
	surenb@...gle.com
Cc: linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Guilherme Giacomo Simoes <trintaeoitogc@...il.com>,
	Andrey Konovalov <andreyknvl@...il.com>
Subject: [PATCH] mm: alloc_tag: change the KASAN_TAG_WIDTH for HW_TAGS

the KASAN_TAG_WIDTH is 8 bits for both (HW_TAGS and SW_TAGS), but for
HW_TAGS the KASAN_TAG_WIDTH can be 4 bits bits because due to the design
of the MTE the memory words for storing metadata only need 4 bits.
Change the preprocessor define KASAN_TAG_WIDTH for check if SW_TAGS is
define, so KASAN_TAG_WIDTH should be 8 bits, but if HW_TAGS is define,
so KASAN_TAG_WIDTH should be 4 bits.

Suggested-by: Andrey Konovalov <andreyknvl@...il.com>
Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
---
 include/linux/page-flags-layout.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h
index 4f5c9e979bb9..760006b1c480 100644
--- a/include/linux/page-flags-layout.h
+++ b/include/linux/page-flags-layout.h
@@ -72,8 +72,10 @@
 #define NODE_NOT_IN_PAGE_FLAGS	1
 #endif
 
-#if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS)
+#if defined(CONFIG_KASAN_SW_TAGS)
 #define KASAN_TAG_WIDTH 8
+#elif defined(CONFIG_KASAN_HW_TAGS)
+#define KASAN_TAG_WIDTH 4
 #else
 #define KASAN_TAG_WIDTH 0
 #endif
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ