linux/Documentation
Yeoreum Yun 31d8edb535 kasan/hw-tags: introduce kasan.write_only option
Patch series "introduce kasan.write_only option in hw-tags", v8.

Hardware tag based KASAN is implemented using the Memory Tagging Extension
(MTE) feature.

MTE is built on top of the ARMv8.0 virtual address tagging TBI (Top Byte
Ignore) feature and allows software to access a 4-bit allocation tag for
each 16-byte granule in the physical address space.  A logical tag is
derived from bits 59-56 of the virtual address used for the memory access.
A CPU with MTE enabled will compare the logical tag against the
allocation tag and potentially raise an tag check fault on mismatch,
subject to system registers configuration.

Since ARMv8.9, FEAT_MTE_STORE_ONLY can be used to restrict raise of tag
check fault on store operation only.

Using this feature (FEAT_MTE_STORE_ONLY), introduce KASAN write-only mode
which restricts KASAN check write (store) operation only.  This mode omits
KASAN check for read (fetch/load) operation.  Therefore, it might be used
not only debugging purpose but also in normal environment.


This patch (of 2):

Since Armv8.9, FEATURE_MTE_STORE_ONLY feature is introduced to restrict
raise of tag check fault on store operation only.  Introduce KASAN write
only mode based on this feature.

KASAN write only mode restricts KASAN checks operation for write only and
omits the checks for fetch/read operations when accessing memory.  So it
might be used not only debugging enviroment but also normal enviroment to
check memory safty.

This features can be controlled with "kasan.write_only" arguments.  When
"kasan.write_only=on", KASAN checks write operation only otherwise KASAN
checks all operations.

This changes the MTE_STORE_ONLY feature as BOOT_CPU_FEATURE like
ARM64_MTE_ASYMM so that makes it initialise in kasan_init_hw_tags() with
other function together.

Link: https://lkml.kernel.org/r/20250916222755.466009-1-yeoreum.yun@arm.com
Link: https://lkml.kernel.org/r/20250916222755.466009-2-yeoreum.yun@arm.com
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Breno Leitao <leitao@debian.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: D Scott Phillips <scott@os.amperecomputing.com>
Cc: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
Cc: James Morse <james.morse@arm.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: levi.yun <yeoreum.yun@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Pankaj Gupta <pankaj.gupta@amd.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yang Shi <yang@os.amperecomputing.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-21 14:22:10 -07:00
..
ABI Docs/ABI/damon: document addr_unit file 2025-09-13 16:55:24 -07:00
accel
accounting delaytop: enhance error logging and add PSI feature description 2025-08-02 12:01:41 -07:00
admin-guide mm: remove unused zpool layer 2025-09-21 14:21:59 -07:00
arch It has been a relatively busy cycle for docs, especially the build system: 2025-07-31 08:36:51 -07:00
block Documentation: ublk: Separate UBLK_F_AUTO_BUF_REG fallback behavior sublists 2025-06-13 09:25:42 -06:00
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after rc3 2025-06-26 09:49:39 -07:00
cdrom cdrom: Call cdrom_mrw_exit from cdrom_release function 2025-07-22 19:10:17 -06:00
core-api mm: remove unused zpool layer 2025-09-21 14:21:59 -07:00
cpu-freq
crypto crypto: engine - remove {prepare,unprepare}_crypt_hardware callbacks 2025-07-18 20:52:00 +10:00
dev-tools kasan/hw-tags: introduce kasan.write_only option 2025-09-21 14:22:10 -07:00
devicetree drm fixes for 6.16-rc4 2025-08-28 19:56:32 -07:00
doc-guide docs: sphinx: add a file with the requirements for lowest version 2025-06-25 12:22:48 -06:00
driver-api mm: remove unused zpool layer 2025-09-21 14:21:59 -07:00
edac
fault-injection docs: fault-injection: drop reference to md-faulty 2025-07-24 08:31:46 -06:00
fb
features
filesystems prctl: extend PR_SET_THP_DISABLE to optionally exclude VM_HUGEPAGE 2025-09-13 16:55:05 -07:00
firmware-guide Merge branch 'acpi-misc' 2025-07-22 17:12:57 +02:00
firmware_class
fpga
gpu drm for 6.17-rc1 2025-07-30 19:26:49 -07:00
hid HID: intel-thc-hid: Separate max input size control conditional list 2025-06-20 08:55:52 +02:00
hwmon hwmon updates for v6.17 2025-07-31 13:34:06 -07:00
i2c
iio docs: iio: add ADXL313 accelerometer 2025-07-14 19:20:50 +01:00
images
infiniband
input Input: Add and document BTN_GRIP* 2025-07-27 01:41:20 -07:00
isdn
kbuild docs: kconfig: add alldefconfig to the all*configs 2025-07-26 15:31:29 +09:00
kernel-hacking
leds LEDs for v6.16 2025-06-03 12:10:31 -07:00
litmus-tests
livepatch
locking
maintainer
mhi
misc-devices
mm Docs/admin-guide/mm/damon/usage: document addr_unit file 2025-09-13 16:55:23 -07:00
netlabel
netlink netlink: specs: ethtool: fix module EEPROM input/output arguments 2025-07-31 10:57:02 -07:00
networking mptcp: disable add_addr retransmission when timeout is 0 2025-08-18 17:39:58 -07:00
nvdimm
nvme docs: nvme: fix grammar in nvme-pci-endpoint-target.rst 2025-07-17 13:38:07 +02:00
PCI selftests: pci_endpoint: Add doorbell test case 2025-07-24 16:51:47 -05:00
pcmcia
peci
power Merge branches 'pm-runtime' and 'pm-powercap' 2025-07-22 18:01:15 +02:00
process Documentation: smooth the text flow in the security bug reporting process 2025-08-17 12:23:30 +02:00
RCU rcu: Document concurrent quiescent state reporting for offline CPUs 2025-07-22 17:10:50 +05:30
rust
scheduler sched_ext: Changes for v6.17 2025-07-31 16:29:46 -07:00
scsi scsi: fc_transport: docs: Add documentation for FC Remote Ports 2025-06-09 21:49:26 -04:00
security hardening updates for v6.17-rc1 2025-07-28 17:16:12 -07:00
sound ALSA: docs: Add documents for recently changes in snd-usb-audio 2025-08-29 11:17:35 +02:00
sphinx sphinx: kernel_abi: fix performance regression with O=<dir> 2025-07-24 08:36:17 -06:00
sphinx-static docs: CSS: make cross-reference links more evident 2025-06-09 14:43:39 -06:00
spi
staging
sunrpc/xdr
target
tee
timers
tools tracing tools changes for 6.17: 2025-08-01 10:23:13 -07:00
trace tracing changes for 6.17 2025-08-01 10:29:36 -07:00
translations Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
usb It has been a relatively busy cycle for docs, especially the build system: 2025-07-31 08:36:51 -07:00
userspace-api iommufd: Fix spelling errors in iommufd.rst 2025-08-18 11:15:06 -03:00
virt Documentation: KVM: Use unordered list for pre-init VGIC registers 2025-07-29 13:43:50 -04:00
w1
watchdog
wmi platform/x86: Add lenovo-wmi-* driver Documentation 2025-07-03 10:54:24 +03:00
.gitignore
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py docs: conf.py: several coding style fixes 2025-06-25 12:22:48 -06:00
docutils.conf
index.rst
Kconfig
Makefile docs: Makefile: disable check rules on make cleandocs 2025-06-25 12:22:47 -06:00
memory-barriers.txt docs/memory-barriers.txt: Add wait_event_cmd() and wait_event_exclusive_cmd() 2025-07-09 10:08:14 -07:00
SubmittingPatches
subsystem-apis.rst