]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Mitigate MTE issues with str{n}cmp()
authorRobin Murphy <robin.murphy@arm.com>
Fri, 17 Sep 2021 14:59:30 +0000 (15:59 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 21 Sep 2021 13:50:19 +0000 (14:50 +0100)
commitcc895489d115f67c183d538ac5b45337acbfbc62
tree833d1831affb5f492aceb9beaffe977d07d72b25
parent1d7fc272cf27612e2c569ba104908546aa830c0e
arm64: Mitigate MTE issues with str{n}cmp()

As with strlen(), the patches importing the updated str{n}cmp()
implementations were originally developed and tested before the
advent of CONFIG_KASAN_HW_TAGS, and have subsequently revealed
not to be MTE-safe. Since in-kernel MTE is still a rather niche
case, let it temporarily fall back to the generic C versions for
correctness until we can figure out the best fix.

Fixes: 59743625f0e3 ("arm64: Import latest version of Cortex Strings' strcmp")
Fixes: 90c04769905b ("arm64: Import latest version of Cortex Strings' strncmp")
Cc: <stable@vger.kernel.org> # 5.14.x
Reported-by: Branislav Rankov <branislav.rankov@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/34dc4d12eec0adae49b0ac927df642ed10089d40.1631890770.git.robin.murphy@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/string.h
arch/arm64/lib/strcmp.S
arch/arm64/lib/strncmp.S