Re: [PATCH v4 09/35] kmsan: Expose kmsan_get_metadata()

2024-06-18 Thread Alexander Potapenko
s stored in the lowcore_ptr[] array. > > When lowcore is accessed through virtual address 0, one needs to > resolve metadata for lowcore_ptr[raw_smp_processor_id()]. > > Expose kmsan_get_metadata() to make it possible to do this from the > arch code. > > Signed-off-by: I

Re: [PATCH v4 35/35] kmsan: Enable on s390

2024-06-18 Thread Alexander Potapenko
On Thu, Jun 13, 2024 at 5:40 PM Ilya Leoshkevich wrote: > > Now that everything else is in place, enable KMSAN in Kconfig. > > Acked-by: Heiko Carstens > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko

Re: [PATCH v5 12/37] kmsan: Introduce memset_no_sanitize_memory()

2024-06-20 Thread Alexander Potapenko
On Wed, Jun 19, 2024 at 5:45 PM Ilya Leoshkevich wrote: > > Add a wrapper for memset() that prevents unpoisoning. This is useful > for filling memory allocator redzones. > > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko > --- > include/linux/kmsan.h |

Re: [PATCH v5 34/37] s390/uaccess: Add the missing linux/instrumented.h #include

2024-06-20 Thread Alexander Potapenko
gt; it directly. > > Suggested-by: Alexander Potapenko > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko

Re: [PATCH v5 33/37] s390/uaccess: Add KMSAN support to put_user() and get_user()

2024-06-20 Thread Alexander Potapenko
size); > break; > case 4: > - rc = __get_user_asm((unsigned int *)x, > + rc = __get_user_int((unsigned int *)x, > (unsigned int __user *)ptr, > size)

Re: [PATCH v5 17/37] mm: slub: Disable KMSAN when checking the padding bytes

2024-06-20 Thread Alexander Potapenko
ess_enable() is to touch poisoned > metadata without triggering KMSAN, is to unpoison its return value. > However, this approach is too fragile. So simply disable the KMSAN > checks in the respective functions. > > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko

Re: [PATCH v5 33/37] s390/uaccess: Add KMSAN support to put_user() and get_user()

2024-06-20 Thread Alexander Potapenko
On Thu, Jun 20, 2024 at 1:19 PM Ilya Leoshkevich wrote: > > On Thu, 2024-06-20 at 10:36 +0200, Alexander Potapenko wrote: > > On Wed, Jun 19, 2024 at 5:45 PM Ilya Leoshkevich > > wrote: > > > > > > put_user() uses inline assembly with precise constraints,

Re: [PATCH v5 36/37] s390/kmsan: Implement the architecture-specific functions

2024-06-20 Thread Alexander Potapenko
On Thu, Jun 20, 2024 at 3:38 PM Ilya Leoshkevich wrote: > > On Thu, 2024-06-20 at 11:25 +0200, Alexander Gordeev wrote: > > On Wed, Jun 19, 2024 at 05:44:11PM +0200, Ilya Leoshkevich wrote: > > > > Hi Ilya, > > > > > +static inline bool is_lowcore_addr(void *addr) > > > +{ > > > + return addr >=

Re: [PATCH v5 36/37] s390/kmsan: Implement the architecture-specific functions

2024-06-20 Thread Alexander Potapenko
On Thu, Jun 20, 2024 at 4:18 PM Alexander Potapenko wrote: > > On Thu, Jun 20, 2024 at 3:38 PM Ilya Leoshkevich wrote: > > > > On Thu, 2024-06-20 at 11:25 +0200, Alexander Gordeev wrote: > > > On Wed, Jun 19, 2024 at 05:44:11PM +0200, Ilya Leoshkevich

Re: [PATCH v5 13/37] kmsan: Support SLAB_POISON

2024-06-20 Thread Alexander Potapenko
uninitialized memory and UAF. > > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko

Re: [PATCH v6 32/39] s390/ptdump: Add KMSAN page markers

2024-06-21 Thread Alexander Potapenko
On Fri, Jun 21, 2024 at 2:27 AM Ilya Leoshkevich wrote: > > Add KMSAN vmalloc metadata areas to kernel_page_tables. > > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko

Re: [PATCH v6 16/39] kmsan: Expose KMSAN_WARN_ON()

2024-06-21 Thread Alexander Potapenko
eoshkevich Reviewed-by: Alexander Potapenko

Re: [PATCH v2] nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE

2023-01-31 Thread Alexander Potapenko
case, since the allocation > is ephemeral for the lifespan of the namespace, there are no explicit > restriction. However, the implicit restriction, of having enough > available "System RAM" to store the page map for the typically large > pmem, still applies. > > Fixes: 6

Re: KMSAN: uninit-value in __sctp_v6_cmp_addr

2018-05-16 Thread Alexander Potapenko
--- > > This bug is generated by a bot. It may contain errors. > > See https://goo.gl/tpsmEJ for more information about syzbot. > > syzbot engineers can be reached at syzkal...@googlegroups.com. > > > > syzbot will keep track of this bug report. See: > > https://goo.gl/

Re: KMSAN: uninit-value in __sctp_v6_cmp_addr

2018-05-16 Thread Alexander Potapenko
#syz fix: sctp: handle two v4 addrs comparison in sctp_inet6_cmp_addr

[PATCH] lib/stackdepot.c: use a non-instrumented version of memcpy()

2018-05-16 Thread Alexander Potapenko
committed for memcmp()) Signed-off-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov --- lib/stackdepot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index e513459a5601..d48c744fa750 100644 --- a/lib/stackdepot.c +++ b/lib

Re: [PATCH] x86/asm: use memory clobber in bitops that touch arbitrary memory

2019-04-02 Thread Alexander Potapenko
On Tue, Apr 2, 2019 at 9:27 AM Peter Zijlstra wrote: > > > > On Mon, Apr 01, 2019 at 06:24:08PM +0200, Alexander Potapenko wrote: > > diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h > > index d153d570bb04..20e4950827d9 100644 > > --- a

[PATCH v2] x86/asm: fix assembly constraints in bitops

2019-04-02 Thread Alexander Potapenko
makes the compiler treat sizeof(long) bytes as being clobbered, which isn't the case. This may theoretically lead to worse code in the case of heavy optimization. Signed-off-by: Alexander Potapenko Cc: Dmitry Vyukov Cc: Paul E. McKenney Cc: H. Peter Anvin Cc: Peter Zijlstra Cc: James Y Kni

Re: [PATCH] x86/asm: use memory clobber in bitops that touch arbitrary memory

2019-04-02 Thread Alexander Potapenko
On Tue, Apr 2, 2019 at 10:59 AM Alexander Potapenko wrote: > > On Tue, Apr 2, 2019 at 9:27 AM Peter Zijlstra wrote: > > > > > > > > On Mon, Apr 01, 2019 at 06:24:08PM +0200, Alexander Potapenko wrote: > > > diff --git a/arch/x86/include/asm/bitops.h b/ar

Re: [PATCH v2] x86/asm: fix assembly constraints in bitops

2019-04-02 Thread Alexander Potapenko
On Tue, Apr 2, 2019 at 1:28 PM Alexander Potapenko wrote: > > 1. Use memory clobber in bitops that touch arbitrary memory > > Certain bit operations that read/write bits take a base pointer and an > arbitrarily large offset to address the bit relative to that base. > Inline as

Re: [PATCH v2] x86/asm: fix assembly constraints in bitops

2019-04-02 Thread Alexander Potapenko
On Tue, Apr 2, 2019 at 1:44 PM David Laight wrote: > > From: Alexander Potapenko > > Sent: 02 April 2019 12:28 > > > > 1. Use memory clobber in bitops that touch arbitrary memory > > > > Certain bit operations that read/write bits take a base pointer and an >

Re: [PATCH v2] x86/asm: fix assembly constraints in bitops

2019-04-02 Thread Alexander Potapenko
On Tue, Apr 2, 2019 at 2:35 PM Alexander Potapenko wrote: > > On Tue, Apr 2, 2019 at 1:44 PM David Laight wrote: > > > > From: Alexander Potapenko > > > Sent: 02 April 2019 12:28 > > > > > > 1. Use memory clobber in bitops that touch arbitrary memory

Re: [RFC patch 19/41] lib/stackdepot: Provide functions which operate on plain storage arrays

2019-04-10 Thread Alexander Potapenko
f-by: Thomas Gleixner Acked-by: Alexander Potapenko > --- > include/linux/stackdepot.h |4 ++ > lib/stackdepot.c | 66 > - > 2 files changed, 51 insertions(+), 19 deletions(-) > > --- a/include/linux/stackdepot.h >

Re: [RFC patch 41/41] lib/stackdepot: Remove obsolete functions

2019-04-10 Thread Alexander Potapenko
On Wed, Apr 10, 2019 at 1:06 PM Thomas Gleixner wrote: > > No more users of the struct stack_trace based interfaces. > > Signed-off-by: Thomas Gleixner Acked-by: Alexander Potapenko > --- > include/linux/stackdepot.h |4 > lib/stackdepot.c | 20

Re: [PATCH 01/11] kasan: prefix exported functions with kasan_

2021-01-11 Thread Alexander Potapenko
e(), as it seems to be > a more fitting name. > > Suggested-by: Marco Elver > Signed-off-by: Andrey Konovalov > Link: > https://linux-review.googlesource.com/id/I719cc93483d4ba288a634dba80ee6b7f2809cd26 Reviewed-by: Alexander Potapenko > --- > mm/kasan/common.c

Re: [PATCH 02/11] kasan: clarify HW_TAGS impact on TBI

2021-01-11 Thread Alexander Potapenko
lov > Link: > https://linux-review.googlesource.com/id/Iba2a6697e3c6304cb53f89ec61dedc77fa29e3ae Reviewed-by: Alexander Potapenko > --- > Documentation/dev-tools/kasan.rst | 16 +++- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/Documentation/

Re: [PATCH 03/11] kasan: clean up comments in tests

2021-01-11 Thread Alexander Potapenko
On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov wrote: > > Clarify and update comments and info messages in KASAN tests. > > Signed-off-by: Andrey Konovalov > Link: > https://linux-review.googlesource.com/id/I6c816c51fa1e0eb7aa3dead6bda1f339d2af46c8 > void *kasan_ptr_result; > int kasan_int_

Re: [PATCH 04/11] kasan: add match-all tag tests

2021-01-12 Thread Alexander Potapenko
On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov wrote: > > Add 3 new tests for tag-based KASAN modes: > > 1. Check that match-all pointer tag is not assigned randomly. > 2. Check that 0xff works as a match-all pointer tag. > 3. Check that there are no match-all memory tags. > > Note, that test #3

Re: [PATCH 06/11] kasan: rename CONFIG_TEST_KASAN_MODULE

2021-01-12 Thread Alexander Potapenko
view.googlesource.com/id/Id347dfa5fe8788b7a1a189863e039f409da0ae5f Reviewed-by: Alexander Potapenko > KASAN tests consist on two parts: While at it: "consist of".

Re: [PATCH 07/11] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

2021-01-12 Thread Alexander Potapenko
On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov wrote: > > It might not be obvious to the compiler that the expression must be > executed between writing and reading to fail_data. In this case, the > compiler might reorder or optimize away some of the accesses, and > the tests will fail. Have you

Re: [PATCH 08/11] kasan: adopt kmalloc_uaf2 test to HW_TAGS mode

2021-01-12 Thread Alexander Potapenko
Nit: s/adopt/adapt in the title. > +again: > ptr1 = kmalloc(size, GFP_KERNEL); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr1); > > @@ -384,6 +386,13 @@ static void kmalloc_uaf2(struct kunit *test) > ptr2 = kmalloc(size, GFP_KERNEL); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test,

Re: [PATCH 09/11] kasan: fix memory corruption in kasan_bitops_tags test

2021-01-12 Thread Alexander Potapenko
On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov wrote: > > Since the hardware tag-based KASAN mode might not have a redzone that > comes after an allocated object (when kasan.mode=prod is enabled), the > kasan_bitops_tags() test ends up corrupting the next object in memory. > > Change the test so

Re: [PATCH 11/11] kasan: add proper page allocator tests

2021-01-12 Thread Alexander Potapenko
ink: > https://linux-review.googlesource.com/id/Ia173d5a1b215fe6b2548d814ef0f4433cf983570 Reviewed-by: Alexander Potapenko

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-11 Thread Alexander Potapenko
On Thu, Dec 10, 2020 at 6:01 AM wrote: > > From: Yogesh Lal > > Add a kernel parameter stack_hash_order to configure STACK_HASH_SIZE. > > Aim is to have configurable value for STACK_HASH_SIZE, so that one > can configure it depending on usecase there by reducing the static > memory overhead. > >

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-11 Thread Alexander Potapenko
On Fri, Dec 11, 2020 at 1:45 PM Vijayanand Jitta wrote: > > > > On 12/11/2020 2:06 PM, Alexander Potapenko wrote: > > On Thu, Dec 10, 2020 at 6:01 AM wrote: > >> > >> From: Yogesh Lal > >> > >> Add a kernel parameter stack_hash_order

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-21 Thread Alexander Potapenko
On Mon, Dec 21, 2020 at 12:15 PM Vijayanand Jitta wrote: > > > > On 12/18/2020 2:10 PM, Vijayanand Jitta wrote: > > > > > > On 12/17/2020 4:24 PM, Alexander Potapenko wrote: > >>>> Can you provide an example of a use case in which the user wants to

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-23 Thread Alexander Potapenko
> > Michan, We would still need config option so that we can reduce the > memory consumption on low ram devices using config. > > Alex, On this, > "I also suppose device vendors may prefer setting a fixed (maybe > non-default) hash size for low-memory devices rather than letting the > admins increa

[PATCH 0/4] Add sysfs interface to collect reports from debugging tools

2021-01-13 Thread Alexander Potapenko
use this new feature. Alexander Potapenko (4): tracing: add error_report trace points lib: add error_report_notify to collect debugging tools' reports kfence: use error_report_start and error_report_end tracepoints kasan: use error_report_start and error_report_end tracepoints in

[PATCH 1/4] tracing: add error_report trace points

2021-01-13 Thread Alexander Potapenko
: Alexander Potapenko --- include/trace/events/error_report.h | 51 + kernel/trace/Makefile | 1 + kernel/trace/error_report-traces.c | 11 +++ 3 files changed, 63 insertions(+) create mode 100644 include/trace/events/error_report.h create mode

[PATCH 4/4] kasan: use error_report_start and error_report_end tracepoints

2021-01-13 Thread Alexander Potapenko
Cc: linux...@kvack.org Signed-off-by: Alexander Potapenko --- mm/kasan/report.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index c0fb21797550..fd015dd5dd39 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c

[PATCH 2/4] lib: add error_report_notify to collect debugging tools' reports

2021-01-13 Thread Alexander Potapenko
: Petr Mladek Cc: Steven Rostedt Cc: Sergey Senozhatsky Cc: linux...@kvack.org Signed-off-by: Alexander Potapenko --- lib/Kconfig.debug | 14 ++ lib/Makefile | 2 + lib/error_report_notify.c | 278 ++ 3 files changed, 294 insertions

[PATCH 3/4] kfence: use error_report_start and error_report_end tracepoints

2021-01-13 Thread Alexander Potapenko
Cc: linux...@kvack.org Signed-off-by: Alexander Potapenko --- mm/kfence/report.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/kfence/report.c b/mm/kfence/report.c index 4dedc2ff8f28..5c063b5b2227 100644 --- a/mm/kfence/report.c +++ b/mm/kfence/report.c @@ -9,6 +9,7 @@ #include

Re: [PATCH 09/11] kasan: fix memory corruption in kasan_bitops_tags test

2021-01-13 Thread Alexander Potapenko
On Tue, Jan 12, 2021 at 9:07 PM 'Andrey Konovalov' via kasan-dev wrote: > > On Tue, Jan 12, 2021 at 9:30 AM Alexander Potapenko wrote: > > > > On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov > > wrote: > > > > > > Since the hardwar

Re: [PATCH v2 09/14] kasan: adapt kmalloc_uaf2 test to HW_TAGS mode

2021-01-13 Thread Alexander Potapenko
ce.com/id/Ibfa458ef2804ff465d8eb07434a300bf36388d55 > Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko > --- > lib/test_kasan.c | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/lib/test_kasan.c b/lib/test_kasan.c > index 283feda9882a..a1a35d75e

Re: [PATCH v2 04/14] kasan: add macros to simplify checking test constraints

2021-01-13 Thread Alexander Potapenko
ros and use them. > > > > Link: > > https://linux-review.googlesource.com/id/I237484a7fddfedf4a4aae9cc61ecbcdbe85a0a63 > > Suggested-by: Alexander Potapenko > > Signed-off-by: Andrey Konovalov > > Nice! > > Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH v2 2/5] lib: add error_report_notify to collect debugging tools' reports

2021-01-18 Thread Alexander Potapenko
On Mon, Jan 18, 2021 at 12:38 PM Petr Mladek wrote: Thanks for your input! Some responses below. > > On Fri 2021-01-15 14:03:33, Alexander Potapenko wrote: > > With the introduction of various production error-detection tools, such as > > MTE-based KASAN and KFENCE,

Re: [PATCH v2 2/5] lib: add error_report_notify to collect debugging tools' reports

2021-01-18 Thread Alexander Potapenko
> > > + > > > + /* Pairs with acquire in last_report_show(). */ > > > + atomic_inc_return_release(&num_reports); > > > + schedule_delayed_work(&reporting_done, 0); > > > > Why delayed work when it gets queued immediately? > > Because error reports may be sent from a place where waiting

Re: [PATCH 1/4] tracing: add error_report trace points

2021-01-13 Thread Alexander Potapenko
On Wed, Jan 13, 2021 at 10:10 PM Steven Rostedt wrote: > > On Wed, 13 Jan 2021 10:16:54 +0100 > Alexander Potapenko wrote: > > > +DECLARE_EVENT_CLASS(error_report_template, > > + TP_PROTO(const char *error_detector, unsigned long id), > > Instead

Re: [PATCH 2/4] lib: add error_report_notify to collect debugging tools' reports

2021-01-14 Thread Alexander Potapenko
On Thu, Jan 14, 2021 at 1:06 AM Andrew Morton wrote: > > On Wed, 13 Jan 2021 10:16:55 +0100 Alexander Potapenko > wrote: > > > With the introduction of various production error-detection tools, such as > > MTE-based KASAN and KFENCE, the need arises to efficiently not

Re: [PATCH 2/4] lib: add error_report_notify to collect debugging tools' reports

2021-01-15 Thread Alexander Potapenko
On Thu, Jan 14, 2021 at 10:51 AM Alexander Potapenko wrote: > > On Thu, Jan 14, 2021 at 1:06 AM Andrew Morton > wrote: > > > > On Wed, 13 Jan 2021 10:16:55 +0100 Alexander Potapenko > > wrote: > > > > > With the introduction of various production erro

Re: [PATCH 1/4] tracing: add error_report trace points

2021-01-15 Thread Alexander Potapenko
On Thu, Jan 14, 2021 at 3:52 PM Steven Rostedt wrote: > > On Thu, 14 Jan 2021 08:49:57 +0100 > Alexander Potapenko wrote: > > > We'll need to explicitly list the enum values once again in > > __print_symbolic(), right? E.g.: > > > > enum

Re: [PATCH mm] kfence, slab: fix cache_alloc_debugcheck_after() for bulk allocations

2021-03-04 Thread Alexander Potapenko
On Thu, Mar 4, 2021 at 9:53 PM Marco Elver wrote: > > cache_alloc_debugcheck_after() performs checks on an object, including > adjusting the returned pointer. None of this should apply to KFENCE > objects. While for non-bulk allocations, the checks are skipped when we > allocate via KFENCE, for bu

Re: [PATCH mm] kfence, slab: fix cache_alloc_debugcheck_after() for bulk allocations

2021-03-05 Thread Alexander Potapenko
On Fri, Mar 5, 2021 at 2:31 AM Andrew Morton wrote: > > On Thu, 4 Mar 2021 22:05:48 +0100 Alexander Potapenko > wrote: > > > On Thu, Mar 4, 2021 at 9:53 PM Marco Elver wrote: > > > > > > cache_alloc_debugcheck_after() performs checks on an object, including

Re: [PATCH mm] kfence: fix printk format for ptrdiff_t

2021-03-03 Thread Alexander Potapenko
On Wed, Mar 3, 2021 at 1:12 PM Marco Elver wrote: > > Use %td for ptrdiff_t. > > Link: > https://lkml.kernel.org/r/3abbe4c9-16ad-c168-a90f-087978ccd...@csgroup.eu > Reported-by: Christophe Leroy > Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH mm] kfence, x86: fix preemptible warning on KPTI-enabled systems

2021-04-01 Thread Alexander Potapenko
disabling preemption around flush_tlb_one_kernel(). > > Link: https://lore.kernel.org/lkml/ygidbaboelggm...@elver.google.com/ > Reported-by: Tomi Sarvela > Signed-off-by: Marco Elver Acked-by: Alexander Potapenko

Re: [PATCH] mm/kasan: switch from strlcpy to strscpy

2021-02-21 Thread Alexander Potapenko
gt; also avoids scanning the whole source string. Looks like a good thing to do. > Signed-off-by: Zhiyuan Dai Acked-by: Alexander Potapenko > --- > mm/kasan/report_generic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/kasan/report_generic.c b/

Re: [PATCH mm v10 05/42] kasan: rename (un)poison_shadow to (un)poison_range

2020-11-18 Thread Alexander Potapenko
to kasan_unpoison_range(), and introduce internal > functions (un)poison_range() (without kasan_ prefix). > > Co-developed-by: Marco Elver > Signed-off-by: Marco Elver > Signed-off-by: Andrey Konovalov > Signed-off-by: Vincenzo Frascino Reviewed-by

Re: [PATCH mm v10 09/42] kasan: define KASAN_MEMORY_PER_SHADOW_PAGE

2020-11-18 Thread Alexander Potapenko
it. > > Signed-off-by: Andrey Konovalov > Signed-off-by: Vincenzo Frascino > Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko > --- > Change-Id: I0b627b24187d06c8b9bb2f1d04d94b3d06945e73 > --- > mm/kasan/init.c | 10 -- > mm/kas

Re: [PATCH mm v10 41/42] kasan: add documentation for hardware tag-based mode

2020-11-18 Thread Alexander Potapenko
co Elver Reviewed-by: Alexander Potapenko > --- > Change-Id: Ib46cb444cfdee44054628940a82f5139e10d0258 > --- > Documentation/dev-tools/kasan.rst | 80 +++ > 1 file changed, 59 insertions(+), 21 deletions(-) > > diff --git a/Documentation/dev-tools/kasan.

Re: [PATCH mm v10 24/42] arm64: Enable armv8.5-a asm-arch option

2020-11-18 Thread Alexander Potapenko
to > allow the usage of ALTERNATIVE()s with MTE instructions. > > Signed-off-by: Vincenzo Frascino > Signed-off-by: Andrey Konovalov > Reviewed-by: Catalin Marinas Reviewed-by: Alexander Potapenko > --- > Change-Id: I172e15e4c189f073e4c14a10276b276092e76536 > ---

Re: [PATCH mm v10 23/42] kasan: introduce CONFIG_KASAN_HW_TAGS

2020-11-18 Thread Alexander Potapenko
feature for tag management and access checking. > > Signed-off-by: Andrey Konovalov > Co-developed-by: Vincenzo Frascino > Signed-off-by: Vincenzo Frascino > Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko > --- > Change-Id: I246c2def9fffa6563278db1bddfbe742ca7b

Re: [PATCH mm v10 31/42] kasan, mm: untag page address in free_reserved_area

2020-11-18 Thread Alexander Potapenko
result the memset might result in a tag > mismatch. > > Untag the address to avoid spurious faults. > > Cc: Andrew Morton > Signed-off-by: Vincenzo Frascino > Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko > --- > Change-Id: If12b4944383575b8bbd

Re: [PATCH] kfence: fix implicit function declaration

2020-12-04 Thread Alexander Potapenko
> actually enabled") > and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the > same day via different trees. > > Signed-off-by: Anders Roxell Reviewed-by: Alexander Potapenko Thanks! > --- > > I got this build error in todays next-20201204.

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-17 Thread Alexander Potapenko
> > Can you provide an example of a use case in which the user wants to > > use the stack depot of a smaller size without disabling it completely, > > and that size cannot be configured statically? > > As far as I understand, for the page owner example you gave it's > > sufficient to provide a swit

Re: [PATCH] kfence: fix typo in test

2020-12-17 Thread Alexander Potapenko
> > Signed-off-by: Marco Elver Acked-by: Alexander Potapenko > > --- > > mm/kfence/kfence_test.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c > > index 1433a

Re: [PATCH mm] kfence: zero guard page after out-of-bounds access

2021-03-12 Thread Alexander Potapenko
prevent certain information leaks. > > Signed-off-by: Marco Elver Acked-by: Alexander Potapenko > --- > mm/kfence/core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/kfence/core.c b/mm/kfence/core.c > index 3b8ec938470a..f7106f28443d 100644 > --- a

Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32

2021-03-02 Thread Alexander Potapenko
> [ 14.998426] BUG: KFENCE: invalid read in > finish_task_switch.isra.0+0x54/0x23c > [ 14.998426] > [ 15.007061] Invalid read at 0x(ptrval): > [ 15.010906] finish_task_switch.isra.0+0x54/0x23c > [ 15.015633] kunit_try_run_case+0x5c/0xd0 > [ 15.019682] kunit_generic_run_threadfn_adap

Re: [PATCH v2 0/5] Add sysfs interface to collect reports from debugging tools

2021-01-21 Thread Alexander Potapenko
On Fri, Jan 15, 2021 at 2:09 PM Alexander Potapenko wrote: > > On Fri, Jan 15, 2021 at 2:06 PM Vlastimil Babka wrote: > > > > Should have CCd linux-api@, please do next time > Thanks, will do! > Shall I also CC the v2 ABI patch explicitly? I'll be dropping the sys

Re: [PATCH v2 2/5] lib: add error_report_notify to collect debugging tools' reports

2021-01-21 Thread Alexander Potapenko
Thank you all for the comments! Since concerns have been raised that another error reporting system may quickly go out of control, we've decided to not pursue this solution any further. Instead, we will try to rely on existing ftrace mechanisms to deliver notifications to the userspace, and perfor

Re: [PATCH v5 1/2] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2021-01-22 Thread Alexander Potapenko
gt; Signed-off-by: Vijayanand Jitta Reviewed-by: Alexander Potapenko > --- > lib/Kconfig | 9 + > lib/stackdepot.c | 3 +-- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/lib/Kconfig b/lib/Kconfig > index b46a9fd..96ee125 100644 > --- a/

Re: [PATCH v5 1/2] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2021-01-22 Thread Alexander Potapenko
On Mon, Jan 18, 2021 at 11:54 PM Randy Dunlap wrote: > > On 1/18/21 1:56 AM, vji...@codeaurora.org wrote: > > From: Yogesh Lal > > > > Use CONFIG_STACK_HASH_ORDER to configure STACK_HASH_SIZE. > > > > Aim is to have configurable value for STACK_HASH_SIZE, > > so depend on use case one can config

[PATCH v2 0/5] Add sysfs interface to collect reports from debugging tools

2021-01-15 Thread Alexander Potapenko
use this new feature. v2: - added ABI documentation for /sys/kernel/error_report/ - changed error_report_start and error_report end tracepoints to take a fixed set of values for the error detector Alexander Potapenko (5): tracing: add error_report trace points lib: add

[PATCH v2 2/5] lib: add error_report_notify to collect debugging tools' reports

2021-01-15 Thread Alexander Potapenko
: Petr Mladek Cc: Steven Rostedt Cc: Sergey Senozhatsky Cc: linux...@kvack.org Signed-off-by: Alexander Potapenko --- v2: - s/memory error reports/error reports from debugging tools/ (per Andrew Morton's comment) - change error_report_start and error_report_end prototypes to accept

[PATCH v2 3/5] docs: ABI: add /sys/kernel/error_report/ documentation

2021-01-15 Thread Alexander Potapenko
-error_report new file mode 100644 index ..666d039f93a9 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-error_report @@ -0,0 +1,41 @@ +What: /sys/kernel/error_report/ +Date: January 2021 +Contact: Alexander Potapenko , + Marco Elver

[PATCH v2 4/5] kfence: use error_report_start and error_report_end tracepoints

2021-01-15 Thread Alexander Potapenko
Cc: linux...@kvack.org Signed-off-by: Alexander Potapenko --- v2: - change error_report_start and error_report_end prototypes to accept enum error_detector instead of char* (as suggested by Steven Rostedt) --- mm/kfence/report.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm

[PATCH v2 5/5] kasan: use error_report_start and error_report_end tracepoints

2021-01-15 Thread Alexander Potapenko
Cc: linux...@kvack.org Signed-off-by: Alexander Potapenko --- v2: - change error_report_start and error_report_end prototypes to accept enum error_detector instead of char* (as suggested by Steven Rostedt) --- mm/kasan/report.c | 15 +-- 1 file changed, 9 insertions(+), 6

[PATCH v2 1/5] tracing: add error_report trace points

2021-01-15 Thread Alexander Potapenko
: Alexander Potapenko --- v2: - change error_report_start and error_report_end prototypes to accept enum error_detector instead of char* (as suggested by Steven Rostedt) --- include/trace/events/error_report.h | 84 + kernel/trace/Makefile

Re: [PATCH v2 0/5] Add sysfs interface to collect reports from debugging tools

2021-01-15 Thread Alexander Potapenko
On Fri, Jan 15, 2021 at 2:06 PM Vlastimil Babka wrote: > > Should have CCd linux-api@, please do next time Thanks, will do! Shall I also CC the v2 ABI patch explicitly?

Re: [PATCH v3 03/15] kasan: clean up comments in tests

2021-01-15 Thread Alexander Potapenko
On Thu, Jan 14, 2021 at 8:36 PM Andrey Konovalov wrote: > > Clarify and update comments in KASAN tests. > > Link: > https://linux-review.googlesource.com/id/I6c816c51fa1e0eb7aa3dead6bda1f339d2af46c8 > Reviewed-by: Marco Elver > Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko

Re: [PATCH v3 05/15] kasan: add match-all tag tests

2021-01-15 Thread Alexander Potapenko
gt; > Note, that test #3 causes a significant number (255) of KASAN reports > to be printed during execution for the SW_TAGS mode. > > Link: > https://linux-review.googlesource.com/id/I78f1375efafa162b37f3abcb2c5bc2f3955dfd8e > Reviewed-by: Marco Elver > Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko

Re: [PATCH v3 15/15] kasan: don't run tests when KASAN is not enabled

2021-01-15 Thread Alexander Potapenko
> https://linux-review.googlesource.com/id/I6447af436a69a94bfc35477f6bf4e2122948355e > > Signed-off-by: Andrey Konovalov > > Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH v3 14/15] kasan: add a test for kmem_cache_alloc/free_bulk

2021-01-15 Thread Alexander Potapenko
ttps://linux-review.googlesource.com/id/I2a8bf797aecf81baeac61380c567308f319e263d > > Signed-off-by: Andrey Konovalov > > Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko (see a nit below) > > + cache = kmem_cache_create("test_cache", size, 0, 0, NULL)

Re: [PATCH v3 12/15] kasan: fix bug detection via ksize for HW_TAGS mode

2021-01-15 Thread Alexander Potapenko
t; pass _RET_IP_ to __kasan_check_byte(). > > > > Also add a new ksize_uaf() test that checks that a use-after-free is > > detected via ksize() itself, and via plain accesses that happen later. > > > > Link: > > https://linux-review.googlesource.com/id/Iaabf771881d0f9ce1b969f2a62938e99d3308ec5 > > Signed-off-by: Andrey Konovalov > > Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH v3 11/15] kasan: move _RET_IP_ to inline wrappers

2021-01-15 Thread Alexander Potapenko
iew.googlesource.com/id/I8fb3c06d49671305ee184175a39591bc26647a67 > > Signed-off-by: Andrey Konovalov > > Much nicer! > > Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH v3 08/15] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

2021-01-15 Thread Alexander Potapenko
d-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko

Re: [PATCH v2 3/5] docs: ABI: add /sys/kernel/error_report/ documentation

2021-01-15 Thread Alexander Potapenko
rt count to ensure it didn't change under their feet. > Also, any reason you didn't cc: the sysfs maintainers? Only my lack of common sense :) I'll add them should the following patches rely on sysfs, thank you! Alex -- Alexander Potapenko Software Engineer Google Germany G

Re: [PATCH v2 2/5] lib: add error_report_notify to collect debugging tools' reports

2021-01-15 Thread Alexander Potapenko
On Fri, Jan 15, 2021 at 2:50 PM Greg KH wrote: > > Minor comments, if in the future, you really do want to mess around in sysfs: > Thanks! Guess most of these comments apply even if I choose another FS to mess around with. > No copyright notice for the file? While acceptable, odds are your > cor

Re: [PATCH v2 3/5] docs: ABI: add /sys/kernel/error_report/ documentation

2021-01-18 Thread Alexander Potapenko
hat we are planning to do. Also, shall I rename the library/config/etc. accordingly (to e.g. CONFIG_KERNEL_WARN_NOTIFY)? > Use the function in kernel/trace/trace.c: tracer_init_tracefs() to add that > directory. That's for files in the tracefs directory that will not be > duplicate

Re: [PATCH mm 1/4] kfence: add missing copyright and description headers

2021-01-18 Thread Alexander Potapenko
On Mon, Jan 18, 2021 at 10:22 AM Marco Elver wrote: > > Add missing copyright and description headers to KFENCE source files. > > Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko > --- > If appropriate, to be squashed into: > > mm: add Kernel Elect

Re: [PATCH mm 2/4] kfence, x86: add missing copyright and description header

2021-01-18 Thread Alexander Potapenko
On Mon, Jan 18, 2021 at 10:22 AM Marco Elver wrote: > > Add missing copyright and description header to KFENCE source file. > > Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH mm 3/4] kfence, arm64: add missing copyright and description header

2021-01-18 Thread Alexander Potapenko
On Mon, Jan 18, 2021 at 10:22 AM Marco Elver wrote: > > Add missing copyright and description header to KFENCE source file. > > Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH mm 4/4] kfence: add missing copyright header to documentation

2021-01-18 Thread Alexander Potapenko
On Mon, Jan 18, 2021 at 10:22 AM Marco Elver wrote: > > Add missing copyright header to KFENCE documentation. > > Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko

Re: [PATCH v4 1/2] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2021-01-07 Thread Alexander Potapenko
On Wed, Dec 30, 2020 at 1:46 PM wrote: > > From: Yogesh Lal > > Use STACK_HASH_ORDER_SHIFT to configure STACK_HASH_SIZE. I think "ORDER_SHIFT" is somewhat redundant, as "SMTH_ORDER" already means this is a power of two we'll be using for shifting. Leaving this up to you. Alex

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-16 Thread Alexander Potapenko
On Wed, Dec 16, 2020 at 4:43 AM Vijayanand Jitta wrote: > > > > On 12/14/2020 4:02 PM, Vijayanand Jitta wrote: > > > > > > On 12/14/2020 3:04 PM, Alexander Potapenko wrote: > >> On Mon, Dec 14, 2020 at 5:02 AM Vijayanand Jitta > >> wrote: > >

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-16 Thread Alexander Potapenko
On Wed, Dec 16, 2020 at 2:06 PM Vijayanand Jitta wrote: > > > > On 12/16/2020 1:56 PM, Alexander Potapenko wrote: > > On Wed, Dec 16, 2020 at 4:43 AM Vijayanand Jitta > > wrote: > >> > >> > >> > >> On 12/14/2020 4:02 PM, Vijayanand Jit

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-16 Thread Alexander Potapenko
t;>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> > >>>>>>> -- > >>>>>>> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a > >>>>

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-14 Thread Alexander Potapenko
On Mon, Dec 14, 2020 at 5:02 AM Vijayanand Jitta wrote: > > > > On 12/11/2020 6:55 PM, Alexander Potapenko wrote: > > On Fri, Dec 11, 2020 at 1:45 PM Vijayanand Jitta > > wrote: > >> > >> > >> > >> On 12/11/2020 2:06 PM, Alexander P

Re: [PATCH v1] arm64: allow building with kcov coverage on ARM64

2016-04-13 Thread Alexander Potapenko
Hi James, On Wed, Apr 13, 2016 at 6:12 PM, James Morse wrote: > Hi Alex, > > On 12/04/16 12:17, Alexander Potapenko wrote: >> I also wonder if we can, say, land the change to arch/arm64/Kconfig >> separately from makefile changes that improve the precision or fix >> c

Re: [PATCH] include/linux/kasan.h: Notice about 0 for kasan_[dis/en]able_current()

2016-05-02 Thread Alexander Potapenko
gfp_t flags) {} > -/* kasan_slab_free() returns true if the object has been put into quarantine. > - */ > static inline bool kasan_slab_free(struct kmem_cache *s, void *object) > { > return false; > -- > 1.9.3 > Acked-by: Alexander

Re: [PATCH] include/linux/kasan.h: Notice about 0 for kasan_[dis/en]able_current()

2016-05-02 Thread Alexander Potapenko
On Mon, May 2, 2016 at 1:20 PM, Chen Gang wrote: > On 5/2/16 18:49, Alexander Potapenko wrote: >> On Mon, May 2, 2016 at 7:35 AM, wrote: >>> >>> According to their comments and the kasan_depth's initialization, if >>> kasan_depth is zero, it means disabl

<    1   2   3   4   5   6   7   >