git: 346134f19aa9 - main - kmsan: Correct the origin address in kmsan_shadow_check()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 04 Nov 2023 14:29:05 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=346134f19aa9ba38a0384244609e2bcd4f7838f4 commit 346134f19aa9ba38a0384244609e2bcd4f7838f4 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-11-03 19:37:09 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2023-11-04 14:28:13 +0000 kmsan: Correct the origin address in kmsan_shadow_check() Otherwise a KMSAN report (which panics the system by default) could trigger a recursive panic. MFC after: 1 week Fixes: ca6cd604c8fc ("kmsan: Use the correct origin bytes in kmsan_check_arg()") --- sys/kern/subr_msan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index f8fdcf478b79..abac71da6d64 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -375,7 +375,7 @@ kmsan_shadow_check(uintptr_t addr, size_t size, const char *hook) for (i = 0; i < size; i++) { if (__predict_true(shad[i] == 0)) continue; - orig = (msan_orig_t *)kmsan_md_addr_to_orig((vm_offset_t)&shad[i]); + orig = (msan_orig_t *)kmsan_md_addr_to_orig(addr + i); orig = (msan_orig_t *)((uintptr_t)orig & MSAN_ORIG_MASK); kmsan_report_hook((const char *)addr + i, orig, size, i, hook); break;