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()
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
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".
-
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
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
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
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
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 -
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
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.
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
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
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
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 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
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
The first patch adds printing a warning in v4l2_get_link_freq() if
V4L2_CID_LINK_FREQ isn't implemented (this is a mandatory control for
CSI-2 transmitter drivers [1], but many sensor drivers don't have it
currently).
The second patch is the start of the work discussed in the "[RFC] Repurpose
V4L2
[check,set]_clock_rates()
are left intact as it looks like this VFE clock does depend on the
rate the pixel samples comes out of the camera sensor, not on the
frequency at which the link between the sensor and the CSI receiver
operates.
Signed-off-by: Andrey Konovalov
Acked-by: Robert Foss
Reviewed-
Print a warning if V4L2_CID_LINK_FREQ control is not implemented.
Signed-off-by: Andrey Konovalov
Reviewed-by: Jacopo Mondi
Reviewed-by: Laurent Pinchart
---
drivers/media/v4l2-core/v4l2-common.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-common.c
b
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
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 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
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 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 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
@@ -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
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
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
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
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 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 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
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
Hi Robert,
Thank you for your patch!
Just two minor comments below.
On 17.02.2021 14:21, Robert Foss wrote:
In order to support Qualcomm ISP hardware architectures that diverge
from older architectures, the VFE subdevice driver needs to be refactored
to better abstract the different ISP archit
Hi Robert,
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021 14:21, Robert Foss wrote:
Add enum representing the SDM845 SOC, which incorporates version
170 of the Titan architecture ISP.
Signed-off-by: Robert Foss
---
drivers/media/platform/qcom/camss/camss.h | 1 +
1 file
Hi Robert,
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021 14:21, Robert Foss wrote:
Function name is comment is wrong, and was changed to be
the same as the actual function name.
The comment was changed to kerneldoc format.
Signed-off-by: Robert Foss
---
Changes since v1
Hi Robert,
Thank you for your patch!
On 17.02.2021 14:21, Robert Foss wrote:
Add register definitions for version 170 of the Titan architecture
and implement support for the RDI output mode.
The RDI mode as opposed to the PIX output mode for the VFE unit does
not support any ISP functionality.
Hi Robert,
Thank you for your patch!
On 17.02.2021 14:21, Robert Foss wrote:
Add register definitions for version 170 of the Titan architecture
and implement support for the RDI output mode.
The RDI mode as opposed to the PIX output mode for the VFE unit does
not support any ISP functionality.
Hi Robert,
Thank you for your patch!
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021 14:21, Robert Foss wrote:
In order to support Qualcomm ISP hardware architectures that diverge
from older architectures, the CSID subdevice drivers needs to be refactored
to better abstract the
(val == 0) means "testgen disabled", and (val >= 1) selects the test
pattern: (val == 1) corresponds to CSID_PAYLOAD_MODE_INCREMENTING etc.
+{
+ s32 regval = val - 1;
- now regval contains the zero-based test pattern mode number
+ if (regval > 0 || regval <= CSID
Hi Robert,
After reviewing the [PATCH v5 10/22], I noticed that this patch also
has a problematic test_pattern control implementation.
See below.
On 21.02.2021 18:15, Andrey Konovalov wrote:
Hi Robert,
Thank you for your patch!
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021
Hi Robert,
Thank you for your patch!
On 17.02.2021 14:21, 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
---
Changes since v3
- Sakari: Make variable const
Changes since v4
Hi Robert,
Thank you for your patch!
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021 14:21, Robert Foss wrote:
Enable support for SDM845 based Titan 170 ISPs.
Signed-off-by: Robert Foss
---
drivers/media/platform/qcom/camss/camss.c | 17 +
drivers/media
Hi Robert,
Thank you for your patch!
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021 14:21, Robert Foss wrote:
Add the camss dt node for sdm845.
Signed-off-by: Robert Foss
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 135 +++
1 file changed, 135
Hi Robert,
Thank you for your patch!
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021 14:21, Robert Foss wrote:
Enable camss & ov8856 DT nodes.
Signed-off-by: Robert Foss
---
Changes since v1
- Laurent: Fix subject
- Laurent: Remove redundant regulator labels
- Lau
Hi Robert,
Thank you for your patch!
Reviewed-by: Andrey Konovalov
Thanks,
Andrey
On 17.02.2021 14:21, Robert Foss wrote:
Add regulator to camss device tree node.
Signed-off-by: Robert Foss
---
arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 4
1 file changed, 4 insertions(+)
diff
Hi Robert,
Thank you for your patch!
On 17.02.2021 14:21, Robert Foss wrote:
For Titan ISPs clocks fail to re-enable during vfe_get()
after any vfe has been halted and its corresponding power
domain power has been detached.
OK.
Since all of the clocks depend on all of the PDs, per
VFE PD de
On Mon, Feb 22, 2021 at 12:13 PM Vincenzo Frascino
wrote:
>
> On 2/12/21 9:44 PM, Andrey Konovalov wrote:
> >> I think we have time to fix this properly ;), so I'd rather not add this
> >> patch at all.
> > Yeah, this patch can be dropped.
> >
> >
Hi Robert,
Thank you for your patch!
On 17.02.2021 14:21, Robert Foss wrote:
The CSI-2 spec defines the following types:
- Data Type - Often abbreviated DT
- Decode Format - Often abbreviated as DF
- Encode Format
These definitions are as far as I can tell complete for CSI-2.
Additional
Hi Robert,
On 22.02.2021 19:37, Robert Foss wrote:
On Sat, 20 Feb 2021 at 22:40, Andrey Konovalov
wrote:
Hi Robert,
Thank you for your patch!
On 17.02.2021 14:21, Robert Foss wrote:
Add register definitions for version 170 of the Titan architecture
and implement support for the RDI output
Hi Robert,
On 22.02.2021 20:21, Robert Foss wrote:
On Mon, 22 Feb 2021 at 18:06, Andrey Konovalov
wrote:
Hi Robert,
On 22.02.2021 19:37, Robert Foss wrote:
On Sat, 20 Feb 2021 at 22:40, Andrey Konovalov
wrote:
Hi Robert,
Thank you for your patch!
On 17.02.2021 14:21, Robert Foss wrote
a printk, etc.
> KASAN_SANITIZE_kcov.o := n
> KCSAN_SANITIZE_kcov.o := n
> +UBSAN_SANITIZE_kcov.o := n
> CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack) -fno-stack-protector
>
> obj-y += sched/
> --
> 2.29.2.576.ga3fc446d84-goog
>
Reviewed-by: Andrey Konovalov
Hi Andrew,
Could you please squash the first one into
"kasan: add and integrate kasan boot parameters".
And instead of applying the second one, it's better to just drop
"kasan, arm64: don't allow SW_TAGS with ARM64_MTE".
Thanks!
Andrey Konovalov (2):
kasan: d
case: in-kernel MTE is never enabled unless the
CONFIG_KASAN_HW_TAGS is enabled, so there are no more conflicts with
CONFIG_KASAN_SW_TAGS.
Allow CONFIG_KASAN_SW_TAGS to be enabled even when CONFIG_ARM64_MTE is
enabled.
Signed-off-by: Andrey Konovalov
---
arch/arm64/Kconfig | 2 +-
1 file chang
__ro_after_init static keys are incompatible with usage in loadable kernel
modules and cause crashes. Don't use those, use normal static keys.
Signed-off-by: Andrey Konovalov
---
This fix can be squashed into
"kasan: add and integrate kasan boot parameters".
---
mm/kasa
On Mon, Nov 30, 2020 at 10:46 AM Marco Elver wrote:
>
> On Thu, 26 Nov 2020 at 16:00, Valdis Klētnieks
> wrote:
> > commit 2df573d2ca4c1ce6ea33cb7849222f771e759211
> > Author: Andrey Konovalov
> > Date: Tue Nov 24 16:45:08 2020 +1100
> >
> > kasan
On Tue, Nov 17, 2020 at 2:25 PM Dmitry Vyukov wrote:
>
> On Fri, Nov 13, 2020 at 11:20 PM Andrey Konovalov
> wrote:
> >
> > The reason cache merging is disabled with KASAN is because KASAN puts its
> > metadata right after the allocated object. When the merged caches
On Thu, Nov 19, 2020 at 11:16 PM kernel test robot wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
> head: 3494d58865ad4a47611dbb427b214cc5227fa5eb
> commit: cae9dc35ed9ff82a99754e51d57ff6c332e1f7e4 kasan: allow enabling stack
> tagging for tag-ba
On Fri, Nov 20, 2020 at 6:00 PM Alan Stern wrote:
>
> On Fri, Nov 20, 2020 at 08:56:11AM -0800, syzbot wrote:
> > > On Fri, Nov 20, 2020 at 07:15:20AM -0800, syzbot wrote:
> > >> Hello,
> > >>
> > >> syzbot found the following issue on:
> > >>
> > >> HEAD commit:4d02da97 Merge tag 'net-5.10-rc
On Tue, Nov 17, 2020 at 2:12 PM Dmitry Vyukov wrote:
>
> > void __kasan_poison_slab(struct page *page)
> > {
> > @@ -272,11 +305,9 @@ void * __must_check __kasan_init_slab_obj(struct
> > kmem_cache *cache,
> > struct kasan_alloc_meta *alloc_meta;
> >
> > if (kasan_stack_collecti
On Mon, Nov 23, 2020 at 7:54 PM Andrey Konovalov wrote:
>
> > > @@ -168,6 +173,9 @@ void quarantine_put(struct kmem_cache *cache, void
> > > *object)
> > > struct qlist_head temp = QLIST_INIT;
> > > struct kasan_free_meta *m
Don't mention "GNU General Public License version 2" text explicitly,
as it's already covered by the SPDX-License-Identifier.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Pota
mte_set_mem_tag_range().
- Drop __must_check from mte_set_mem_tag_range() as KASAN has no use for
the return value.
- Drop zero size check from mte_assign_mem_tag_range().
- Drop unnecessary include from low-level arm64 code.
- Move enabling TBI1 into __cpu_setup().
- Drop stale comment about c
Currently only generic KASAN mode supports vmalloc, reflect that
in the config.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id: I1889e5b3bed28cc5d607802fb6ae43ba461c0dc1
---
lib/Kconfig.kasan | 2 +-
1
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.
Group all vmalloc-related function declarations in include/linux/kasan.h,
and their implementations in mm/kasan/common.c.
No functional changes.
Signed-off-by: Andrey Konovalov
Signed-off
asan_ prefix).
Co-developed-by: Marco Elver
Signed-off-by: Marco Elver
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Alexander Potapenko
---
Change-Id: Ia359f32815242c4704e49a5f1639ca2d2f8cba69
---
include/linux/kasan.h | 6 +++---
kernel/fork.c | 4 ++-
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.
Group shadow-related KASAN function declarations and only define them
for the two existing software modes.
No functional changes for software modes.
Signed-off-by: Andrey Konovalov
Signed
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.
The new mode won't be using shadow memory, so only build init.c that
contains shadow initialization code for software modes.
No functional changes for software modes.
Signed-off-by: A
ional changes.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id: Iac733e2248aa9d29f6fc425d8946ba07cca73ecf
---
Documentation/dev-tools/kasan.rst | 2 +-
lib/test_kasan.c | 2 +-
Define KASAN_MEMORY_PER_SHADOW_PAGE as (KASAN_GRANULE_SIZE << PAGE_SHIFT),
which is the same as (KASAN_GRANULE_SIZE * PAGE_SIZE) for software modes
that use shadow memory, and use it across KASAN code to simplify it.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Revie
s for software modes.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id: Ic1c32ce72d4649848e9e6a1f2c8dd269c77673f2
---
mm/kasan/Makefile | 6 +-
mm/kasan/common.c | 498 +--
Rename generic_report.c to report_generic.c and tags_report.c to
report_sw_tags.c, as their content is more relevant to report.c file.
Also rename tags.c to sw_tags.c to better reflect that this file contains
code for software tag-based mode.
No functional changes.
Signed-off-by: Andrey
Decoding routines aren't needed when CONFIG_KASAN_STACK_ENABLE is not
enabled. Currently only generic KASAN mode implements stack error
reporting.
No functional changes for software modes.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Review
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.
Hardware tag-based KASAN won't use kasan_depth. Only define and use it
when one of the software KASAN modes are enabled.
No functional changes for software modes.
Signed-off-by: A
y printing functions; tag-based mode should use "kasan:"
instead of KBUILD_MODNAME (which stands for file name).
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
Reviewed-by: Alexander Potapenko
---
Change-Id: Iddca9764b30ff0fab1922f26ca9d4f39b6f22673
---
arch/arm64/incl
_free().
Also simplify the code for software tag-based mode.
No functional changes for software modes.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id: I5fae9531c9fc948eb4d4e0c589744032fc5a0789
---
mm/
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.
Hardware tag-based KASAN won't be using shadow memory. Only initialize
it when one of the software KASAN modes are enabled.
No functional changes for software modes.
Signed-off-by: A
Rename kasan_init_tags() to kasan_init_sw_tags() as the upcoming hardware
tag-based KASAN mode will have its own initialization routine.
Also similarly to kasan_init() mark kasan_init_tags() as __init.
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
Reviewed-by: Alexander Potapenko
Both KASAN_GENERIC and KASAN_SW_TAGS have common dependencies, move
those to KASAN.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id: I77e475802e8f1750b9154fe4a6e6da4456054fcd
---
lib/Kconfig.kasan | 8
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.
Hardware tag-based KASAN won't be using shadow memory, but will reuse
this function. Rename "shadow" to implementation-neutral "metadata".
No functional change
Software tag-based KASAN provides its own tag checking machinery that
can conflict with MTE. Don't allow enabling software tag-based KASAN
when MTE is enabled.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Catalin Marinas
Reviewed-by: Alexander Pota
This patch adds a configuration option for a new KASAN mode called
hardware tag-based KASAN. This mode uses the memory tagging approach
like the software tag-based mode, but relies on arm64 Memory Tagging
Extension feature for tag management and access checking.
Signed-off-by: Andrey Konovalov
-based KASAN will provide
its own implementation that doesn't use shadow memory.
No functional changes for software modes.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Chan
Frascino
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
Reviewed-by: Alexander Potapenko
---
Change-Id: I172e15e4c189f073e4c14a10276b276092e76536
---
arch/arm64/Kconfig | 4
arch/arm64/Makefile | 5 +
2 files changed, 9 insertions(+)
diff --git a/arch/arm64/Kconfig b/arch
the same with PROT_MTE and becomes tagged the subsequent kernel
access would fail.
Signed-off-by: Vincenzo Frascino
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
---
Change-Id: I8451d438bb63364de2a3e68041e3a27866921d4e
---
arch/arm64/kernel/hibernate.c | 5 +
arch/arm64/ker
ed-by: Andrey Konovalov
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
---
Change-Id: I1b5230254f90dc21a913447cb17f07fea7944ece
---
arch/arm64/include/asm/esr.h | 1 +
arch/arm64/include/asm/mte-def.h | 15
arch/arm64/include/asm/mte-kasan.h
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.
Hardware tag-based KASAN won't be using shadow memory, but will reuse
these macros. Rename "SHADOW" to implementation-neutral "META".
No functional changes.
Signed
KASAN runtime and shouldn't have any KASAN
annotations.
Also #undef CONFIG_KASAN_GENERIC with CONFIG_KASAN.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Acked-by: Vasily Gorbik
Reviewed-by: Alexander Potapenko
---
Some #ifdef CONFIG_KASAN checks are only relevant for software KASAN
modes (either related to shadow memory or compiler instrumentation).
Expand those into CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Catalin Marinas
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
---
Change-Id: Id15c0b47582fb51594bb26fb8353d78c7d0953c1
---
arch/arm64/include/asm/processor.h | 2 +-
arch/arm64/kernel/mte.c| 29 +++--
2 files changed, 16 insertions(+), 15 deletions(-)
diff --
TE
is disabled after the first one.
Instead, reset tags when accessing metadata (currently only for SLUB).
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Acked-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id: I39f3c4d4f29299d4fbbda039bedf230db1c746fb
---
mm/page_al
Hardware tag-based KASAN uses the memory tagging approach, which requires
all allocations to be aligned to the memory granule size. Align the
allocations to MTE_GRANULE_SIZE via ARCH_SLAB_MINALIGN when
CONFIG_KASAN_HW_TAGS is enabled.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo
it is the same. If the values are not the
same it reports a failure.
Note: The test has been extended to verify that even SYNC and ASYNC mode
setting is preserved correctly over context switching.
Signed-off-by: Vincenzo Frascino
Signed-off-by: Andrey Konovalov
Acked-by: Catalin Marinas
rious faults.
Cc: Andrew Morton
Signed-off-by: Vincenzo Frascino
Signed-off-by: Andrey Konovalov
Reviewed-by: Alexander Potapenko
---
Change-Id: If12b4944383575b8bbd7d971decbd7f04be6748b
---
mm/page_alloc.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
: Vincenzo Frascino
Co-developed-by: Andrey Konovalov
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
---
Change-Id: I4d67497268bb7f0c2fc5dcacefa1e273df4af71d
---
arch/arm64/include/asm/mte-kasan.h | 6 ++
arch/arm64/kernel/mte.c| 7 +++
arch/arm64/mm/proc.S
Hardware tag-based KASAN is now ready, enable the configuration option.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Acked-by: Catalin Marinas
Reviewed-by: Alexander Potapenko
---
Change-Id: I6eb1eea770e6b61ad71c701231b8d815a7ccc853
---
arch/arm64/Kconfig | 1 +
1 file
Add documentation for hardware tag-based KASAN mode and also add some
clarifications for software tag-based mode.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id: Ib46cb444cfdee44054628940a82f5139e10d0258
fault handler for kernel addresses is currently empty and will be
filled in by a future commit.
Signed-off-by: Vincenzo Frascino
Co-developed-by: Andrey Konovalov
Signed-off-by: Andrey Konovalov
Reviewed-by: Catalin Marinas
---
Change-Id: I9b8aa79567f7c45f4d6a1290efcf34567e620717
---
arch/arm64
401 - 500 of 2085 matches
Mail list logo