diff options
| author | Peter Collingbourne <[email protected]> | 2025-04-03 00:06:59 +0000 |
|---|---|---|
| committer | Kees Cook <[email protected]> | 2025-04-15 20:50:17 +0000 |
| commit | d94c12bd97d567de342fd32599e7cd9e50bfa140 (patch) | |
| tree | 292541f999cee604caaff21ef7e1a8045eb5e225 /rust/helpers/bug.c | |
| parent | Linux 6.15-rc2 (diff) | |
| download | kernel-d94c12bd97d567de342fd32599e7cd9e50bfa140.tar.gz kernel-d94c12bd97d567de342fd32599e7cd9e50bfa140.zip | |
string: Add load_unaligned_zeropad() code path to sized_strscpy()
The call to read_word_at_a_time() in sized_strscpy() is problematic
with MTE because it may trigger a tag check fault when reading
across a tag granule (16 bytes) boundary. To make this code
MTE compatible, let's start using load_unaligned_zeropad()
on architectures where it is available (i.e. architectures that
define CONFIG_DCACHE_WORD_ACCESS). Because load_unaligned_zeropad()
takes care of page boundaries as well as tag granule boundaries,
also disable the code preventing crossing page boundaries when using
load_unaligned_zeropad().
Signed-off-by: Peter Collingbourne <[email protected]>
Link: https://linux-review.googlesource.com/id/If4b22e43b5a4ca49726b4bf98ada827fdf755548
Fixes: 94ab5b61ee16 ("kasan, arm64: enable CONFIG_KASAN_HW_TAGS")
Cc: [email protected]
Reviewed-by: Catalin Marinas <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'rust/helpers/bug.c')
0 files changed, 0 insertions, 0 deletions
