From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,dvyukov@google.com,andreyknvl@gmail.com,snovitoll@gmail.com,akpm@linux-foundation.org
Subject: [folded-merged] mm-instrument-copy_from-to_kernel_nofault-fix.patch removed from -mm tree
Date: Mon, 07 Oct 2024 18:59:45 -0700 [thread overview]
Message-ID: <20241008015946.37604C4CEC6@smtp.kernel.org> (raw)
The quilt patch titled
Subject: mm, kasan: proper instrument _kernel_nofault
has been removed from the -mm tree. Its filename was
mm-instrument-copy_from-to_kernel_nofault-fix.patch
This patch was dropped because it was folded into mm-instrument-copy_from-to_kernel_nofault.patch
------------------------------------------------------
From: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Subject: mm, kasan: proper instrument _kernel_nofault
Date: Mon, 30 Sep 2024 15:24:05 +0500
In commit 88ad9dc30bbf("mm, kasan: instrument
copy_from/to_kernel_nofault"), both src and dst were checked which might
lead to the false-positive reports.
Regular instrument_read() for copy_from and instrument_write() for copy_to
triggers KASAN reports in mm/kasan_test_c.c
copy_from_to_kernel_nofault_oob() kunit test.
Tested on x86_64, arm64 with CONFIG_KASAN_SW_TAGS using the latest
linux-next tree, where this commit has been merged today.
Link: https://lkml.kernel.org/r/20240930102405.2227124-1-snovitoll@gmail.com
Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=210505
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/maccess.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/mm/maccess.c~mm-instrument-copy_from-to_kernel_nofault-fix
+++ a/mm/maccess.c
@@ -32,7 +32,7 @@ long copy_from_kernel_nofault(void *dst,
return -ERANGE;
pagefault_disable();
- instrument_memcpy_before(dst, src, size);
+ instrument_read(src, size);
if (!(align & 7))
copy_from_kernel_nofault_loop(dst, src, size, u64, Efault);
if (!(align & 3))
@@ -40,7 +40,6 @@ long copy_from_kernel_nofault(void *dst,
if (!(align & 1))
copy_from_kernel_nofault_loop(dst, src, size, u16, Efault);
copy_from_kernel_nofault_loop(dst, src, size, u8, Efault);
- instrument_memcpy_after(dst, src, size, 0);
pagefault_enable();
return 0;
Efault:
@@ -65,7 +64,7 @@ long copy_to_kernel_nofault(void *dst, c
align = (unsigned long)dst | (unsigned long)src;
pagefault_disable();
- instrument_memcpy_before(dst, src, size);
+ instrument_write(dst, size);
if (!(align & 7))
copy_to_kernel_nofault_loop(dst, src, size, u64, Efault);
if (!(align & 3))
@@ -73,7 +72,6 @@ long copy_to_kernel_nofault(void *dst, c
if (!(align & 1))
copy_to_kernel_nofault_loop(dst, src, size, u16, Efault);
copy_to_kernel_nofault_loop(dst, src, size, u8, Efault);
- instrument_memcpy_after(dst, src, size, 0);
pagefault_enable();
return 0;
Efault:
_
Patches currently in -mm which might be from snovitoll@gmail.com are
mm-instrument-copy_from-to_kernel_nofault.patch
reply other threads:[~2024-10-08 1:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241008015946.37604C4CEC6@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=dvyukov@google.com \
--cc=mm-commits@vger.kernel.org \
--cc=snovitoll@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.