Re: [PATCH] kasan: Remove kasan_record_aux_stack_noalloc().

2024-11-19 Thread Andrey Konovalov
alloc_meta->aux_stack[0] = kasan_save_stack(0, 0); > } > > void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t > flags) > diff --git a/mm/slub.c b/mm/slub.c > index 5b832512044e3..b8c4bf3fe0d07 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2300,7 +2300,7 @@ bool slab_free_hook(struct kmem_cache *s, void *x, bool > init, > * We have to do this manually because the rcu_head is > * not located inside the object. > */ > - kasan_record_aux_stack_noalloc(x); > + kasan_record_aux_stack(x); > > delayed_free->object = x; > call_rcu(&delayed_free->head, > slab_free_after_rcu_debug); > -- > 2.45.2 > Otherwise, Reviewed-by: Andrey Konovalov Thank you!

Re: [PATCH v3 1/3] kasan: switch kunit tests to console tracepoints

2023-12-11 Thread Andrey Konovalov
On Tue, Dec 12, 2023 at 12:35 AM Paul Heidekrüger wrote: > > Using CONFIG_FTRACE=y instead of CONFIG_TRACEPOINTS=y produces the same error > for me. > > So > > CONFIG_KUNIT=y > CONFIG_KUNIT_ALL_TESTS=n > CONFIG_FTRACE=y > CONFIG_KASAN=y > CONFIG_KASAN_GENERI

Re: [PATCH v3 1/3] kasan: switch kunit tests to console tracepoints

2023-12-11 Thread Andrey Konovalov
On Mon, Dec 11, 2023 at 7:59 PM Paul Heidekrüger wrote: > > > Hi Paul, > > > > I've been successfully running KASAN tests with CONFIG_TRACEPOINTS > > enabled on arm64 since this patch landed. > > Interesting ... > > > What happens when you try running the tests with .kunitconfig? Does > > CONFIG_T

Re: [PATCH v3 1/3] kasan: switch kunit tests to console tracepoints

2023-12-11 Thread Andrey Konovalov
On Mon, Dec 11, 2023 at 5:37 PM Paul Heidekrüger wrote: > > Hi all! > > On 05.05.2023 09:58, Steven Rostedt wrote: > > On Mon, 1 May 2023 15:02:37 -0700 > > Peter Collingbourne wrote: > > > > > > > "ftrace" is really for just the function tracing, but CONFIG_FTRACE > > > > > really should just be

Re: [PATCH] slub: Introduce CONFIG_SLUB_RCU_DEBUG

2023-09-16 Thread Andrey Konovalov
On Mon, Aug 28, 2023 at 4:40 PM Jann Horn wrote: > > > Can't we unpoision this rcu_head right before call_rcu() and repoison > > after receiving the callback? > > Yeah, I think that should work. It looks like currently > kasan_unpoison() is exposed in include/linux/kasan.h but > kasan_poison() is

Re: [PATCHv3] Introduced new tracing mode KCOV_MODE_UNIQUE.

2021-04-17 Thread Andrey Konovalov
On Fri, Apr 16, 2021 at 10:42 AM Dmitry Vyukov wrote: > > On Sat, Mar 27, 2021 at 3:56 PM Andrey Konovalov wrote: > > > > On Fri, Mar 26, 2021 at 9:52 PM Alexander Lochmann > > wrote: > > > > > > > Hi Alexander, > > > > > It simply sto

Re: [syzbot] unexpected kernel reboot (4)

2021-04-14 Thread Andrey Konovalov
On Wed, Apr 14, 2021 at 7:45 AM Dmitry Vyukov wrote: > > On Tue, Apr 13, 2021 at 11:27 PM syzbot > wrote: > > > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit:89698bec Merge tag 'm68knommu-for-v5.12-rc7' of git://git... > > git tree: upstream > > console outpu

Re: [PATCH v2] kasan: fix kasan_byte_accessible() to be consistent with actual checks

2021-04-05 Thread Andrey Konovalov
TAG_INVALID) && > - (tag == KASAN_TAG_KERNEL || tag == shadow_byte); > + if (untagged_addr < kasan_shadow_to_mem((void *)KASAN_SHADOW_START)) > + return false; > + > + shadow_byte = READ_ONCE(*(u8 *)kasan_mem_to_shadow(untagged_addr

Re: [PATCH] kasan: fix kasan_byte_accessible() to be consistent with actual checks

2021-04-05 Thread Andrey Konovalov
On Mon, Apr 5, 2021 at 11:43 PM Peter Collingbourne wrote: > > We can sometimes end up with kasan_byte_accessible() being called > on non-slab memory. For example ksize() and krealloc() may end up > calling it on KFENCE allocated memory. In this case the memory will > be tagged with KASAN_SHADOW_I

Re: [PATCH] kfence: unpoison pool region before use

2021-04-04 Thread Andrey Konovalov
On Sun, Apr 4, 2021 at 1:52 AM Andrey Konovalov wrote: > > On Sun, Apr 4, 2021 at 12:31 AM Marco Elver wrote: > > > > However, given the above, I think we need to explain this in the > > commit message (which also makes the dependency between these 2 > > patches

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Andrey Konovalov
On Sun, Apr 4, 2021 at 12:31 AM Marco Elver wrote: > > However, given the above, I think we need to explain this in the > commit message (which also makes the dependency between these 2 > patches clear) and add a comment above the new kasan_unpoison_range(). > That is, if we still think this is th

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Andrey Konovalov
On Sat, Apr 3, 2021 at 7:13 AM Peter Collingbourne wrote: > > If the memory region allocated by KFENCE had previously been poisoned, > any validity checks done using kasan_byte_accessible() will fail. Fix > it by unpoisoning the memory before using it as the pool region. Which kasan_byte_accessib

Re: [PATCH] irq_work: record irq_work_queue() call stack

2021-04-02 Thread Andrey Konovalov
@@ -98,6 +101,8 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) > if (!irq_work_claim(work)) > return false; > > + kasan_record_aux_stack(work); > + > preempt_disable(); > if (cpu != smp_processor_id()) { > /* Arch remote IPI send/receive backend aren't NMI safe */ > -- > 2.17.1 Acked-by: Andrey Konovalov

[PATCH] kasan: detect false-positives in tests

2021-03-31 Thread Andrey Konovalov
KUNIT_EXPECT_KASAN_FAIL() annotations for consistency. Signed-off-by: Andrey Konovalov --- lib/test_kasan.c | 49 +++- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/lib/test_kasan.c b/lib/test_kasan.c index d77c45edc7cd..bf9225002a7e

Re: [PATCH] kasan: fix hwasan build for gcc

2021-03-30 Thread Andrey Konovalov
On Tue, Mar 23, 2021 at 1:41 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > gcc-11 adds support for -fsanitize=kernel-hwaddress, so it becomes > possible to enable CONFIG_KASAN_SW_TAGS. > > Unfortunately this fails to build at the moment, because the > corresponding command line arguments us

[PATCH mm v2] mm, kasan: fix for "integrate page_alloc init with HW_TAGS"

2021-03-30 Thread Andrey Konovalov
rder. Also add a warning comment. Reported-by: Vlastimil Babka Reported-by: Sergei Trofimovich Signed-off-by: Andrey Konovalov --- mm/page_alloc.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 033bd92e8398..d2c020563c0b 10064

Re: [PATCH mm] mm, kasan: fix for "integrate page_alloc init with HW_TAGS"

2021-03-30 Thread Andrey Konovalov
On Tue, Mar 30, 2021 at 5:54 PM Vlastimil Babka wrote: > > On 3/30/21 5:31 PM, Andrey Konovalov wrote: > > My commit "integrate page_alloc init with HW_TAGS" changed the order of > > kernel_unpoison_pages() and kernel_init_free_pages() calls. This leads > &g

Re: [PATCH v4 5/5] arm64: Kconfig: select KASAN_VMALLOC if KANSAN_GENERIC is enabled

2021-03-30 Thread Andrey Konovalov
On Tue, Mar 30, 2021 at 10:14 AM Lecopzer Chen wrote: > > > Do you know if anybody is working on this? It's really unfortunate that > > we can't move exclusively to VMAP_STACK just because of SW_TAGS KASAN. > > > > That said, what is there to do? As things stand, won't kernel stack > > addresses e

[PATCH] kasan: fix conflict with page poisoning

2021-03-30 Thread Andrey Konovalov
When page poisoning is enabled, it accesses memory that is marked as poisoned by KASAN, which leas to false-positive KASAN reports. Suppress the reports by adding KASAN annotations to unpoison_page() (poison_page() already has them). Signed-off-by: Andrey Konovalov --- mm/page_poison.c | 4

[PATCH mm] mm, kasan: fix for "integrate page_alloc init with HW_TAGS"

2021-03-30 Thread Andrey Konovalov
ng comment. Reported-by: Vlastimil Babka Reported-by: Sergei Trofimovich Signed-off-by: Andrey Konovalov --- mm/page_alloc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 033bd92e8398..1fc5061f8ca1 100644 --- a/mm/page_alloc.

Re: [PATCH] mm: page_alloc: ignore init_on_free=1 for page alloc

2021-03-30 Thread Andrey Konovalov
On Tue, Mar 30, 2021 at 12:07 AM Vlastimil Babka wrote: > > On 3/30/21 12:00 AM, Andrey Konovalov wrote: > > On Mon, Mar 29, 2021 at 2:10 PM Vlastimil Babka wrote: > >> > >> > commit 855a9c4018f3219db8be7e4b9a65ab22aebfde82 > >> > Author: Andrey Konov

Re: [PATCH] mm: page_alloc: ignore init_on_free=1 for page alloc

2021-03-29 Thread Andrey Konovalov
On Mon, Mar 29, 2021 at 2:10 PM Vlastimil Babka wrote: > > > commit 855a9c4018f3219db8be7e4b9a65ab22aebfde82 > > Author: Andrey Konovalov > > Date: Thu Mar 18 17:01:40 2021 +1100 > > > > kasan, mm: integrate page_alloc init with HW_TAGS > > But th

Re: [PATCH v4] kasan: remove redundant config option

2021-03-29 Thread Andrey Konovalov
by: Nathan Chancellor > Acked-by: Arnd Bergmann > Reviewed-by: Andrey Konovalov > Cc: Andrey Ryabinin > Cc: Dmitry Vyukov > Cc: Alexander Potapenko > Cc: Andrew Morton > --- > > v4: After this patch sent, someone had modification about KASAN_STACK, > so I need to r

Re: [PATCHv3] Introduced new tracing mode KCOV_MODE_UNIQUE.

2021-03-27 Thread Andrey Konovalov
On Fri, Mar 26, 2021 at 9:52 PM Alexander Lochmann wrote: > Hi Alexander, > It simply stores the executed PCs. > The execution order is discarded. > Each bit in the shared buffer represents every fourth > byte of the text segment. > Since a call instruction on every supported > architecture is a

Re: [PATCH] mm: page_alloc: ignore init_on_free=1 for page alloc

2021-03-26 Thread Andrey Konovalov
On Fri, Mar 26, 2021 at 2:49 PM David Hildenbrand wrote: > > > I observed use of poisoned pages as the crash on ia64 booted with > > init_on_free=1 init_on_alloc=1 (CONFIG_PAGE_POISONING=y config). > > There pmd page contained 0x poison pages and led to early crash. > > > > The change drop

Re: [PATCH v16 0/9] arm64: ARMv8.5-A: MTE: Add async mode support

2021-03-23 Thread Andrey Konovalov
On Thu, Mar 18, 2021 at 7:56 PM Catalin Marinas wrote: > > On Mon, Mar 15, 2021 at 01:20:10PM +, Vincenzo Frascino wrote: > > This patchset implements the asynchronous mode support for ARMv8.5-A > > Memory Tagging Extension (MTE), which is a debugging feature that allows > > to detect with the

[PATCH] mailmap: update Andrey Konovalov's email address

2021-03-18 Thread Andrey Konovalov
Use my personal email, the @google.com one will stop functioning soon. Signed-off-by: Andrey Konovalov --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 85b93cdefc87..11219fa3b62b 100644 --- a/.mailmap +++ b/.mailmap @@ -36,6 +36,7 @@ Andrew Morton

Re: [PATCH v16 0/9] arm64: ARMv8.5-A: MTE: Add async mode support

2021-03-18 Thread Andrey Konovalov
On Thu, Mar 18, 2021 at 7:56 PM Catalin Marinas wrote: > > On Mon, Mar 15, 2021 at 01:20:10PM +, Vincenzo Frascino wrote: > > This patchset implements the asynchronous mode support for ARMv8.5-A > > Memory Tagging Extension (MTE), which is a debugging feature that allows > > to detect with the

Re: [PATCH v2] task_work: kasan: record task_work_add() call stack

2021-03-17 Thread Andrey Konovalov
es. > > [1]: > https://groups.google.com/g/syzkaller-bugs/search?q=kasan%20use-after-free%20task_work_run > > Signed-off-by: Walter Wu > Suggested-by: Dmitry Vyukov > Cc: Andrey Konovalov > Cc: Andrey Ryabinin > Cc: Dmitry Vyukov > Cc: Alexander Potapenko

Re: [PATCH v15 0/8] arm64: ARMv8.5-A: MTE: Add async mode support

2021-03-12 Thread Andrey Konovalov
been updated by the PE the kernel clears it and > reports the error. > > The series is based on linux-next/akpm. > > To simplify the testing a tree with the new patches on top has been made > available at [1]. > > [1] https://git.gitlab.arm.com/linux-arm/linux-vf.git

Re: [PATCH v15 8/8] kasan, arm64: tests supports for HW_TAGS async mode

2021-03-12 Thread Andrey Konovalov
On Fri, Mar 12, 2021 at 3:22 PM Vincenzo Frascino wrote: > > From: Andrey Konovalov > > This change adds KASAN-KUnit tests support for the async HW_TAGS mode. > > In async mode, tag fault aren't being generated synchronously when a > bad access happens, but are instead

Re: [PATCH v4] kasan: remove redundant config option

2021-03-12 Thread Andrey Konovalov
On Thu, Mar 11, 2021 at 6:45 AM Andrew Morton wrote: > > On Thu, 11 Mar 2021 09:32:45 +0800 Walter Wu > wrote: > > > > > Hi Andrew, > > > > I see my v4 patch is different in the next tree now. please see below > > information. > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.g

[PATCH v2 11/11] kasan: docs: update tests section

2021-03-12 Thread Andrey Konovalov
Update the "Tests" section in KASAN documentation: - Add an introductory sentence. - Add proper indentation for the list of ways to run KUnit tests. - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Changes v1->v2: - Fix missing snip

[PATCH v2 09/11] kasan: docs: update shadow memory section

2021-03-12 Thread Andrey Konovalov
Update the "Shadow memory" section in KASAN documentation: - Rearrange the introduction paragraph do it doesn't give a "KASAN has an issue" impression. - Update the list of architectures with vmalloc support. - Punctuation, readability, and other minor clean-up

[PATCH v2 08/11] kasan: docs: update HW_TAGS implementation details section

2021-03-12 Thread Andrey Konovalov
Update the "Implementation details" section for HW_TAGS KASAN: - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) di

[PATCH v2 10/11] kasan: docs: update ignoring accesses section

2021-03-12 Thread Andrey Konovalov
Update the "Ignoring accesses" section in KASAN documentation: - Mention __no_sanitize_address/noinstr. - Mention kasan_disable/enable_current(). - Mention kasan_reset_tag()/page_kasan_tag_reset(). - Readability and punctuation clean-ups. Signed-off-by: Andrey Konovalov --- Changes

[PATCH v2 07/11] kasan: docs: update SW_TAGS implementation details section

2021-03-12 Thread Andrey Konovalov
Update the "Implementation details" section for SW_TAGS KASAN: - Clarify the introduction sentence. - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 39 +++ 1 file changed, 19

[PATCH v2 03/11] kasan: docs: update usage section

2021-03-12 Thread Andrey Konovalov
Update the "Usage" section in KASAN documentation: - Add inline code snippet markers. - Reword the part about stack traces for clarity. - Other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 23 +++ 1 file changed, 11

[PATCH v2 04/11] kasan: docs: update error reports section

2021-03-12 Thread Andrey Konovalov
Update the "Error reports" section in KASAN documentation: - Mention that bug titles are best-effort. - Move and reword the part about auxiliary stacks from "Implementation details". - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --

[PATCH v2 05/11] kasan: docs: update boot parameters section

2021-03-12 Thread Andrey Konovalov
Update the "Boot parameters" section in KASAN documentation: - Mention panic_on_warn. - Mention kasan_multi_shot and its interaction with panic_on_warn. - Clarify kasan.fault=panic interaction with panic_on_warn. - A readability clean-up. Signed-off-by: Andrey Konovalov --- Documen

[PATCH v2 06/11] kasan: docs: update GENERIC implementation details section

2021-03-12 Thread Andrey Konovalov
ty, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index 1189be9b4cb5..

[PATCH v2 01/11] kasan: docs: clean up sections

2021-03-12 Thread Andrey Konovalov
Update KASAN documentation: - Give some sections clearer names. - Remove unneeded subsections in the "Tests" section. - Move the "For developers" section and split into subsections. Signed-off-by: Andrey Konovalov --- Changes v1->v2: - Rename "By default&qu

[PATCH v2 02/11] kasan: docs: update overview section

2021-03-12 Thread Andrey Konovalov
Update the "Overview" section in KASAN documentation: - Outline main use cases for each mode. - Mention that HW_TAGS mode need compiler support too. - Move the part about SLUB/SLAB support from "Usage" to "Overview". - Punctuation, readability, and other minor cle

Re: [PATCH 10/11] kasan: docs: update ignoring accesses section

2021-03-12 Thread Andrey Konovalov
On Fri, Mar 12, 2021 at 12:02 PM Marco Elver wrote: > > On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote: > [...] > > +Other parts of the kernel might access metadata for allocated objects. > > Normally, > > +KASAN detects and reports such accesses, but

Re: [PATCH 11/11] kasan: docs: update tests section

2021-03-12 Thread Andrey Konovalov
On Fri, Mar 12, 2021 at 11:47 AM Marco Elver wrote: > > On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote: > [...] > > -With ``CONFIG_KUNIT`` enabled, ``CONFIG_KASAN_KUNIT_TEST`` can be built as > > -a loadable module and run on any architecture that supports

Re: [PATCH 09/11] kasan: docs: update shadow memory section

2021-03-12 Thread Andrey Konovalov
On Fri, Mar 12, 2021 at 11:52 AM Marco Elver wrote: > > On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote: > [...] > > -The kernel maps memory in a number of different parts of the address > > -space. This poses something of a problem for KASAN, which requires &g

Re: [PATCH 02/11] kasan: docs: update overview section

2021-03-12 Thread Andrey Konovalov
On Fri, Mar 12, 2021 at 11:18 AM Marco Elver wrote: > > > -Currently generic KASAN is supported for the x86_64, arm, arm64, xtensa, > > s390 > > +The hardware KASAN mode (#3) relies on hardware to perform the checks but > > +still requires a compiler version that supports memory tagging > > inst

[PATCH 11/11] kasan: docs: update tests section

2021-03-11 Thread Andrey Konovalov
Update the "Tests" section in KASAN documentation: - Add an introductory sentence. - Add proper indentation for the list of ways to run KUnit tests. - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasa

[PATCH 09/11] kasan: docs: update shadow memory section

2021-03-11 Thread Andrey Konovalov
Update the "Shadow memory" section in KASAN documentation: - Rearrange the introduction paragraph do it doesn't give a "KASAN has an issue" impression. - Update the list of architectures with vmalloc support. - Punctuation, readability, and other minor clean-up

[PATCH 10/11] kasan: docs: update ignoring accesses section

2021-03-11 Thread Andrey Konovalov
Update the "Ignoring accesses" section in KASAN documentation: - Mention kasan_disable/enable_current(). - Mention kasan_reset_tag()/page_kasan_tag_reset(). - A punctuation clean-up. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 15 ++- 1 file c

[PATCH 08/11] kasan: docs: update HW_TAGS implementation details section

2021-03-11 Thread Andrey Konovalov
Update the "Implementation details" section for HW_TAGS KASAN: - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) di

[PATCH 06/11] kasan: docs: update GENERIC implementation details section

2021-03-11 Thread Andrey Konovalov
ty, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index 2f939241349d..

[PATCH 07/11] kasan: docs: update SW_TAGS implementation details section

2021-03-11 Thread Andrey Konovalov
Update the "Implementation details" section for SW_TAGS KASAN: - Clarify the introduction sentence. - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 39 +++ 1 file changed, 19

[PATCH 04/11] kasan: docs: update error reports section

2021-03-11 Thread Andrey Konovalov
Update the "Error reports" section in KASAN documentation: - Mention that bug titles are best-effort. - Move and reword the part about auxiliary stacks from "Implementation details". - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --

[PATCH 05/11] kasan: docs: update boot parameters section

2021-03-11 Thread Andrey Konovalov
Update the "Boot parameters" section in KASAN documentation: - Mention panic_on_warn. - Mention kasan_multi_shot and its interaction with panic_on_warn. - Clarify kasan.fault=panic interaction with panic_on_warn. - A readability clean-up. Signed-off-by: Andrey Konovalov --- Documen

[PATCH 03/11] kasan: docs: update usage section

2021-03-11 Thread Andrey Konovalov
Update the "Usage" section in KASAN documentation: - Add inline code snippet markers. - Reword the part about stack traces for clarity. - Other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 23 +++ 1 file changed, 11

[PATCH 02/11] kasan: docs: update overview section

2021-03-11 Thread Andrey Konovalov
Update the "Overview" section in KASAN documentation: - Outline main use cases for each mode. - Mention that HW_TAGS mode need compiler support too. - Move the part about SLUB/SLAB support from "Usage" to "Overview". - Punctuation, readability, and other minor cle

[PATCH 01/11] kasan: docs: clean up sections

2021-03-11 Thread Andrey Konovalov
Update KASAN documentation: - Give some sections clearer names. - Remove unneeded subsections in the "Tests" section. - Move the "For developers" section and split into subsections. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 50 ++

[PATCH] kasan: fix per-page tags for non-page_alloc pages

2021-03-11 Thread Andrey Konovalov
n occur in the future. Fixes: 2813b9c02962 ("kasan, mm, arm64: tag non slab memory allocated via pagealloc") Cc: sta...@vger.kernel.org Signed-off-by: Andrey Konovalov --- include/linux/mm.h | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/include/

Re: [PATCH v6 12/22] media: camss: Remove per VFE power domain toggling

2021-03-11 Thread Andrey Konovalov
is no option for this generation of HW. Signed-off-by: Robert Foss --- Changes since v5: - Andrey: Bifurcated PD support into Gen1 & Gen2 paths Reviewed-by: Andrey Konovalov Thanks, Andrey .../media/platform/qcom/camss/camss-vfe-170.c | 21 + .../media/platform/qcom/camss/c

Re: [PATCH v5 3/7] init_on_alloc: Unpessimize default-on builds

2021-03-10 Thread Andrey Konovalov
On Tue, Mar 9, 2021 at 10:43 PM Kees Cook wrote: > > Right now, the state of CONFIG_INIT_ON_ALLOC_DEFAULT_ON (and > ...ON_FREE...) did not change the assembly ordering of the static branch > tests. Use the new jump_label macro to check CONFIG settings to default > to the "expected" state, unpessim

Re: [PATCH v6 06/22] media: camss: Refactor VFE HW version support

2021-03-09 Thread Andrey Konovalov
CAMSS ISP architecture. The ISP architecture developed after CAMSS, Titan, will be referred to as Gen2. Signed-off-by: Robert Foss Reviewed-by: Andrey Konovalov Thanks, Andrey --- Changes since v1 - kernel test robot: Re-add chunk missing from vfe_output_update_pong_addr - Andrey: Fix

Re: [PATCH v6 11/22] media: camss: Add support for CSIPHY hardware version Titan 170

2021-03-09 Thread Andrey Konovalov
Hi Robert, Thank you for your patch! On 04.03.2021 15:03, Robert Foss wrote: Add register definitions for version 170 of the Titan architecture and implement support for the CSIPHY subdevice. Signed-off-by: Robert Foss Reviewed-by: Andrey Konovalov Thanks, Andrey --- Changes since v3

Re: [PATCH v6 08/22] media: camss: Add missing format identifiers

2021-03-09 Thread Andrey Konovalov
the used Decode Format is the appropriate one to use. As the vendor specific identifiers differ between hardware generations, split them out into separate headers. Signed-off-by: Robert Foss Reviewed-by: Andrey Konovalov Thanks, Andrey --- Changes since v5 - Andrey: Gen 1 & Gen2 devi

Re: [PATCH v6 07/22] media: camss: Add support for VFE hardware version Titan 170

2021-03-09 Thread Andrey Konovalov
-off-by: Robert Foss --- Reviewed-by: Andrey Konovalov Thanks, Andrey Changes since v1: - Andrey: Remove commented out chunk - Remove left over WIP comments Changes since v4: - Andrey: Remove traces of PIX support - Andrey: Fix vfe_global_reset() overwriting reset command - Remove

Re: [PATCH v6 10/22] media: camss: Add support for CSID hardware version Titan 170

2021-03-09 Thread Andrey Konovalov
n 170 of the Titan architecture and implement support for the CSID subdevice. Signed-off-by: Robert Foss Reviewed-by: Andrey Konovalov --- Changes since v5: - Andrey: Fix test pattern selection logic - Andrey: Add r-b - Move Titan 170 specific test modes to this commit drivers/media/pl

[PATCH v3 5/5] kasan, mm: integrate slab init_on_free with HW_TAGS

2021-03-09 Thread Andrey Konovalov
-off-by: Andrey Konovalov --- include/linux/kasan.h | 10 ++ mm/kasan/common.c | 13 +++-- mm/slab.c | 15 +++ mm/slub.c | 43 --- 4 files changed, 48 insertions(+), 33 deletions(-) diff --git a/include

[PATCH v3 4/5] kasan, mm: integrate slab init_on_alloc with HW_TAGS

2021-03-09 Thread Andrey Konovalov
Signed-off-by: Andrey Konovalov --- include/linux/kasan.h | 8 mm/kasan/common.c | 4 ++-- mm/slab.c | 28 +--- mm/slab.h | 17 + mm/slub.c | 27 +++ 5 files changed, 43 insertions

[PATCH v3 3/5] kasan, mm: integrate page_alloc init with HW_TAGS

2021-03-09 Thread Andrey Konovalov
igned-off-by: Andrey Konovalov --- include/linux/kasan.h | 30 ++ mm/kasan/common.c | 8 mm/mempool.c | 4 ++-- mm/page_alloc.c | 37 ++--- 4 files changed, 54 insertions(+), 25 deletions(-) diff --git a/in

[PATCH v3 1/5] arm64: kasan: allow to init memory when setting tags

2021-03-09 Thread Andrey Konovalov
initialization will improve HW_TAGS KASAN performance when init_on_alloc/free is enabled. This change doesn't integrate memory initialization with KASAN, this is done is subsequent patches in this series. Acked-by: Marco Elver Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/memory.h

[PATCH v3 2/5] kasan: init memory in kasan_(un)poison for HW_TAGS

2021-03-09 Thread Andrey Konovalov
x27;t integrate memory initialization with KASAN, this is done is subsequent patches in this series. Reviewed-by: Marco Elver Signed-off-by: Andrey Konovalov --- lib/test_kasan.c | 4 ++-- mm/kasan/common.c | 28 ++-- mm/kasan/generic.c | 12 ++-- mm/kasan/ka

[PATCH v3 0/5] kasan: integrate with init_on_alloc/free

2021-03-09 Thread Andrey Konovalov
. - Fix non initting memory with kasan=off by checking kasan_enabled() instead of IS_ENABLED(CONFIG_KASAN_HW_TAGS). Andrey Konovalov (5): arm64: kasan: allow to init memory when setting tags kasan: init memory in kasan_(un)poison for HW_TAGS kasan, mm: integrate page_alloc init with HW_TAGS

Re: [PATCH v2 1/5] arm64: kasan: allow to init memory when setting tags

2021-03-09 Thread Andrey Konovalov
On Mon, Mar 8, 2021 at 5:58 PM Catalin Marinas wrote: > > On Mon, Mar 08, 2021 at 04:55:14PM +0100, Andrey Konovalov wrote: > > @@ -68,10 +69,16 @@ static inline void mte_set_mem_tag_range(void *addr, > > size_t size, u8 tag) > >* 'asm volatil

Re: [PATCH v14 0/8] arm64: ARMv8.5-A: MTE: Add async mode support

2021-03-08 Thread Andrey Konovalov
On Mon, Mar 8, 2021 at 5:14 PM Vincenzo Frascino wrote: > > This patchset implements the asynchronous mode support for ARMv8.5-A > Memory Tagging Extension (MTE), which is a debugging feature that allows > to detect with the help of the architecture the C and C++ programmatic > memory errors like

[PATCH] arm64: kasan: fix page_alloc tagging with DEBUG_VIRTUAL

2021-03-08 Thread Andrey Konovalov
when CONFIG_DEBUG_VIRTUAL is enabled that takes care of KASAN tags. Fixes: 2813b9c02962 ("kasan, mm, arm64: tag non slab memory allocated via pagealloc") Cc: Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/memory.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/include

[PATCH v2 5/5] kasan, mm: integrate slab init_on_free with HW_TAGS

2021-03-08 Thread Andrey Konovalov
initialized that can be caused by future changes, both KASAN hook and initialization memset() are put together and a warning comment is added. Combining setting allocation tags with memory initialization improves HW_TAGS KASAN performance when init_on_free is enabled. Signed-off-by: Andrey Konovalov

[PATCH v2 1/5] arm64: kasan: allow to init memory when setting tags

2021-03-08 Thread Andrey Konovalov
initialization will improve HW_TAGS KASAN performance when init_on_alloc/free is enabled. This change doesn't integrate memory initialization with KASAN, this is done is subsequent patches in this series. Acked-by: Marco Elver Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/memory.h

[PATCH v2 0/5] kasan: integrate with init_on_alloc/free

2021-03-08 Thread Andrey Konovalov
_HW_TAGS). Andrey Konovalov (5): arm64: kasan: allow to init memory when setting tags kasan: init memory in kasan_(un)poison for HW_TAGS kasan, mm: integrate page_alloc init with HW_TAGS kasan, mm: integrate slab init_on_alloc with HW_TAGS kasan, mm: integrate slab init_on_free with HW_TAG

[PATCH v2 3/5] kasan, mm: integrate page_alloc init with HW_TAGS

2021-03-08 Thread Andrey Konovalov
hooks are called. This doesn't lead to any side-effects, as whenever page poisoning is enabled, memory initialization gets disabled. Combining setting allocation tags with memory initialization improves HW_TAGS KASAN performance when init_on_alloc/free is enabled. Signed-off-by: Andrey Kono

[PATCH v2 4/5] kasan, mm: integrate slab init_on_alloc with HW_TAGS

2021-03-08 Thread Andrey Konovalov
initialized that can be caused by future changes, both KASAN hook and initialization memset() are put together and a warning comment is added. Combining setting allocation tags with memory initialization improves HW_TAGS KASAN performance when init_on_alloc is enabled. Signed-off-by: Andrey

[PATCH v2 2/5] kasan: init memory in kasan_(un)poison for HW_TAGS

2021-03-08 Thread Andrey Konovalov
x27;t integrate memory initialization with KASAN, this is done is subsequent patches in this series. Reviewed-by: Marco Elver Signed-off-by: Andrey Konovalov --- lib/test_kasan.c | 4 ++-- mm/kasan/common.c | 28 ++-- mm/kasan/generic.c | 12 ++-- mm/kasan/ka

[PATCH] kasan: fix KASAN_STACK dependency for HW_TAGS

2021-03-08 Thread Andrey Konovalov
s: 6a63a63ff1ac ("kasan: introduce CONFIG_KASAN_HW_TAGS") Cc: sta...@vger.kernel.org Reported-by: Catalin Marinas Signed-off-by: Andrey Konovalov --- lib/Kconfig.kasan | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 624ae1df7984..fba9

Re: [PATCH 5/5] kasan, mm: integrate slab init_on_free with HW_TAGS

2021-03-08 Thread Andrey Konovalov
On Mon, Mar 8, 2021 at 12:45 PM Marco Elver wrote: > > > > > - if (unlikely(slab_want_init_on_free(cachep))) > > + /* > > + * As memory initialization is integrated with hardware tag-based > > This may no longer be true if the HW-tags architecture doesn't support > init (although curr

Re: [PATCH 3/5] kasan, mm: integrate page_alloc init with HW_TAGS

2021-03-08 Thread Andrey Konovalov
On Mon, Mar 8, 2021 at 12:35 PM Marco Elver wrote: > > > - kasan_free_nondeferred_pages(page, order, fpi_flags); > > + init = want_init_on_free(); > > + if (init && !IS_ENABLED(CONFIG_KASAN_HW_TAGS)) > > Doing the !IS_ENABLED(CONFIG_KASAN_HW_TAGS) check is awkward, and > assumes intern

[PATCH 5/5] kasan, mm: integrate slab init_on_free with HW_TAGS

2021-03-05 Thread Andrey Konovalov
initialized that can be caused by future changes, both KASAN hook and initialization memset() are put together and a warning comment is added. Combining setting allocation tags with memory initialization improves HW_TAGS KASAN performance when init_on_free is enabled. Signed-off-by: Andrey Konovalov

[PATCH 4/5] kasan, mm: integrate slab init_on_alloc with HW_TAGS

2021-03-05 Thread Andrey Konovalov
initialized that can be caused by future changes, both KASAN hook and initialization memset() are put together and a warning comment is added. Combining setting allocation tags with memory initialization improves HW_TAGS KASAN performance when init_on_alloc is enabled. Signed-off-by: Andrey

[PATCH 2/5] kasan: init memory in kasan_(un)poison for HW_TAGS

2021-03-05 Thread Andrey Konovalov
x27;t integrate memory initialization with KASAN, this is done is subsequent patches in this series. Signed-off-by: Andrey Konovalov --- lib/test_kasan.c | 4 ++-- mm/kasan/common.c | 28 ++-- mm/kasan/generic.c | 12 ++-- mm/kasan/kasan.h | 14 -

[PATCH 1/5] arm64: kasan: allow to init memory when setting tags

2021-03-05 Thread Andrey Konovalov
initialization will improve HW_TAGS KASAN performance when init_on_alloc/free is enabled. This change doesn't integrate memory initialization with KASAN, this is done is subsequent patches in this series. Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/memory.h| 4 ++-- arch/arm64/in

[PATCH 3/5] kasan, mm: integrate page_alloc init with HW_TAGS

2021-03-05 Thread Andrey Konovalov
hooks are called. This doesn't lead to any side-effects, as whenever page poisoning is enabled, memory initialization gets disabled. Combining setting allocation tags with memory initialization improves HW_TAGS KASAN performance when init_on_alloc/free is enabled. Signed-off-by: Andrey Kono

[PATCH 0/5] kasan: integrate with init_on_alloc/free

2021-03-05 Thread Andrey Konovalov
is is expected to improve HW_TAGS KASAN performance when init_on_alloc/free is enabled. The exact perfomance numbers are unknown as MTE-enabled hardware doesn't exist yet. Andrey Konovalov (5): arm64: kasan: allow to init memory when setting tags kasan: init memory in kasan_(un)poison f

[PATCH v3 1/2] kasan: initialize shadow to TAG_INVALID for SW_TAGS

2021-03-05 Thread Andrey Konovalov
ich changes the tag-based KASAN modes to not poison the boot memory. Signed-off-by: Andrey Konovalov --- include/linux/kasan.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/kasan.h b/include/linux/kasan.h index b91732bd05d7..1d89b8175027 100644 --- a/in

[PATCH v3 2/2] mm, kasan: don't poison boot memory with tag-based modes

2021-03-05 Thread Andrey Konovalov
alled. All memory allocated normally when the boot is over keeps getting poisoned as usual. Reviewed-by: Catalin Marinas Signed-off-by: Andrey Konovalov --- Changes v2->v3: - Rebased onto v3 of "kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC". -

[PATCH v3] kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC

2021-03-05 Thread Andrey Konovalov
ap_pages() and arch_free_page(), which can also make the page unavailable. Fixes: 94ab5b61ee16 ("kasan, arm64: enable CONFIG_KASAN_HW_TAGS") Cc: Signed-off-by: Andrey Konovalov --- Changes v2->v3: - Rebase onto mainline. --- mm/page_alloc.c | 8 ++-- 1 file changed, 6 inser

Re: [PATCH v2] kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC

2021-03-05 Thread Andrey Konovalov
On Sat, Mar 6, 2021 at 12:54 AM Andrey Konovalov wrote: > > On Sat, Mar 6, 2021 at 12:50 AM Andrew Morton > wrote: > > > > On Sat, 6 Mar 2021 00:36:33 +0100 Andrey Konovalov > > wrote: > > > > > Currently, kasan_free_nondeferred_pages()

Re: [PATCH v2] kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC

2021-03-05 Thread Andrey Konovalov
On Sat, Mar 6, 2021 at 12:50 AM Andrew Morton wrote: > > On Sat, 6 Mar 2021 00:36:33 +0100 Andrey Konovalov > wrote: > > > Currently, kasan_free_nondeferred_pages()->kasan_free_pages() is called > > after debug_pagealloc_unmap_pages(). This causes a crash when >

[PATCH v2] kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC

2021-03-05 Thread Andrey Konovalov
ap_pages() and arch_free_page(), which can also make the page unavailable. Fixes: 94ab5b61ee16 ("kasan, arm64: enable CONFIG_KASAN_HW_TAGS") Cc: Signed-off-by: Andrey Konovalov --- Changes v1->v2: - Move kasan_free_nondeferred_pages() before arch_free_page(). --- mm/page_alloc.c

Re: [PATCH] kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC

2021-03-05 Thread Andrey Konovalov
On Fri, Feb 26, 2021 at 2:25 AM Andrey Konovalov wrote: > > Currently, kasan_free_nondeferred_pages()->kasan_free_pages() is called > after debug_pagealloc_unmap_pages(). This causes a crash when > debug_pagealloc is enabled, as HW_TAGS KASAN can't set tags on an > unmapp

Re: [PATCH v2 1/2] kasan: initialize shadow to TAG_INVALID for SW_TAGS

2021-03-05 Thread Andrey Konovalov
On Fri, Feb 19, 2021 at 1:22 AM Andrey Konovalov wrote: > > Currently, KASAN_SW_TAGS uses 0xFF as the default tag value for > unallocated memory. The underlying idea is that since that memory > hasn't been allocated yet, it's only supposed to be dereferenced > through

Re: [PATCH] kasan, mm: fix crash with HW_TAGS and DEBUG_PAGEALLOC

2021-03-05 Thread Andrey Konovalov
On Thu, Mar 4, 2021 at 12:23 AM Andrew Morton wrote: > > On Fri, 26 Feb 2021 02:25:37 +0100 Andrey Konovalov > wrote: > > > Currently, kasan_free_nondeferred_pages()->kasan_free_pages() is called > > after debug_pagealloc_unmap_pages(). This causes a crash when >

[PATCH v3 3/3] media: qcom: camss: Fix overflows in clock rate calculations

2021-03-03 Thread Andrey Konovalov
mistake less likely to be repeated in the future. Signed-off-by: Vladimir Lypak Acked-by: Robert Foss Signed-off-by: Andrey Konovalov --- drivers/media/platform/qcom/camss/camss-vfe.c | 4 ++-- drivers/media/platform/qcom/camss/camss.c | 2 +- drivers/media/platform/qcom/camss/camss.h | 2

  1   2   3   4   5   6   7   8   9   10   >