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!
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
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
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
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
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
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
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
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
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
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
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
@@ -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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
--
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
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..
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
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
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
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
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
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
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
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
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
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
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..
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
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
--
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
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
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
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 ++
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/
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
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
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
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
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
-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
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
-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
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
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
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
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
.
- 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
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
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
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
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
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
_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
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
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
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
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
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
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
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
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
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 -
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
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
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
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
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".
-
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
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()
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
>
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
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
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
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
>
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 - 100 of 1002 matches
Mail list logo