Hardware tag-based KASAN has granules of MTE_GRANULE_SIZE. Define
KASAN_GRANULE_SIZE to MTE_GRANULE_SIZE for CONFIG_KASAN_HW_TAGS.
Signed-off-by: Andrey Konovalov
Signed-off-by: Vincenzo Frascino
Reviewed-by: Marco Elver
Reviewed-by: Alexander Potapenko
---
Change-Id
-based KASAN support for other architectures in the future by defining
the appropriate arch_*() macros.
Signed-off-by: Andrey Konovalov
Co-developed-by: Vincenzo Frascino
Signed-off-by: Vincenzo Frascino
Reviewed-by: Catalin Marinas
---
Change-Id: I42b0795a28067872f8308e00c6f0195bca435c2a
reporting code to handle this case.
Signed-off-by: Andrey Konovalov
Co-developed-by: Vincenzo Frascino
Signed-off-by: Vincenzo Frascino
Reviewed-by: Catalin Marinas
Reviewed-by: Alexander Potapenko
---
Change-Id: I3780fe7db6e075dff2937d3d8508f55c9322b095
---
arch/arm64/mm/fa
Provide implementation of KASAN functions required for the hardware
tag-based mode. Those include core functions for memory and pointer
tagging (tags_hw.c) and bug reporting (report_tags_hw.c). Also adapt
common KASAN code to support the new mode.
Signed-off-by: Andrey Konovalov
Signed-off-by
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
implementation
has to make sure that the GCR_EL1 setting for the kernel does not affect
the userspace processes and viceversa.
Save and restore the kernel/user mask in GCR_EL1 in kernel entry and exit.
Signed-off-by: Vincenzo Frascino
Co-developed-by: Andrey Konovalov
Signed-off-by: Andrey
tion changes, those will be included in a separate
patchset.
- Update KASAN documentation to mention boot parameters.
Changes RFC v1 -> RFC v2:
- Rework boot parameters.
- Drop __init from empty kasan_init_tags() definition.
- Add cpu_supports_mte() helper that can be used during early boot and u
Move get_free_info() call into quarantine_put() to simplify the call site.
No functional changes.
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link:
https://linux-review.googlesource.com/id/Iab0f04e7ebf8d83247024b7190c67c3c34c7940f
---
mm/kasan
Add set_alloc_info() helper and move kasan_set_track() into it. This will
simplify the code for one of the upcoming changes.
No functional changes.
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link:
https://linux-review.googlesource.com/id
Even though hardware tag-based mode currently doesn't support checking
vmalloc allocations, it doesn't use shadow memory and works with
VMAP_STACK as is. Change VMAP_STACK definition accordingly.
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Acked-by: Catalin Marinas
R
ASAN_STACK is
enabled.
Note, that CONFIG_KASAN_STACK is an option that is currently always
defined when CONFIG_KASAN is enabled, and therefore has to be tested
with #if instead of #ifdef.
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Acked-by: Catalin Marinas
Reviewed-by: Dmitry Vy
d use kasan_reset_tag() instead.
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Reviewed-by: Dmitry Vyukov
Link:
https://linux-review.googlesource.com/id/I4d2061acfe91d480a75df00b07c22d8494ef14b5
---
include/linux/kasan.h | 5 -
mm/kasan/common.c | 6 +++---
mm/
There's no need for __kasan_unpoison_stack() helper, as it's only
currently used in a single place. Removing it also removes unneeded
arithmetic.
No functional changes.
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link:
htt
Using random_tag() currently results in a function call. Move its
definition to mm/kasan/kasan.h and turn it into a static inline function
for hardware tag-based mode to avoid uneeded function calls.
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Reviewed-by: Dmitry Vyukov
Link
Using (un)poison_range() or check_invalid_free() currently results in
function calls. Move their definitions to mm/kasan/kasan.h and turn them
into static inline functions for hardware tag-based mode to avoid
unneeded function calls.
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Link
(Generic Kernel Image) initiative [1].
[1] https://source.android.com/devices/architecture/kernel/generic-kernel-image
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Reviewed-by: Dmitry Vyukov
Link:
https://linux-review.googlesource.com/id/If7d37003875b2ed3e0935702c8015c223d6416a
Rename kasan_poison_kfree() to kasan_slab_free_mempool() as it better
reflects what this annotation does. Also add a comment that explains the
PageSlab() check.
No functional changes.
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Link:
https://linux-review.googlesource.com/id
-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Reviewed-by: Dmitry Vyukov
Link:
https://linux-review.googlesource.com/id/I2589451d3c96c97abbcbf714baabe6161c6f153e
---
include/linux/kasan.h | 213 --
include/linux/mm.h| 22 +++--
mm/kasan/common.c
set_tag() already ignores the tag for the generic mode, so just call it
as is. Add a check for the generic mode to assign_tag(), and simplify its
call in kasan_kmalloc().
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link:
https://linux
For hardware tag-based mode kasan_poison_memory() already rounds up the
size. Do the same for software modes and remove round_up() from the common
code.
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link:
https://linux-review.googlesource.com/id
Currently it says that the memory gets poisoned by page_alloc code.
Clarify this by mentioning the specific callback that poisons the
memory.
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link:
https://linux-review.googlesource.com/id
scino
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link:
https://linux-review.googlesource.com/id/Ia114847dfb2244f297d2cb82d592bf6a07455dba
---
include/linux/kasan.h | 21 +++--
mm/kasan/common.c | 11 +++
mm/slab_common.c
rest is
freed right away.
Along the way rework __kasan_cache_create() and add claryfying comments.
Co-developed-by: Vincenzo Frascino
Signed-off-by: Vincenzo Frascino
Signed-off-by: Andrey Konovalov
Reviewed-by: Marco Elver
Link:
https://linux-review.googlesourc
This change updates KASAN documentation to reflect the addition of boot
parameters and also reworks and clarifies some of the existing sections,
in particular: defines what a memory granule is, mentions quarantine,
makes Kunit section more readable.
Signed-off-by: Andrey Konovalov
Reviewed-by
There's the external annotation kasan_unpoison_slab() that is currently
defined as static inline and uses kasan_unpoison_range(). Open-code this
function in mempool.c. Otherwise with an upcoming change this function
will result in an unnecessary function call.
Signed-off-by: Andrey Kono
Rename get_alloc_info() and get_free_info() to kasan_get_alloc_meta()
and kasan_get_free_meta() to better reflect what those do and avoid
confusion with kasan_set_free_info().
No functional changes.
Signed-off-by: Andrey Konovalov
Reviewed-by: Dmitry Vyukov
Reviewed-by: Marco Elver
Link
On Mon, Oct 19, 2020 at 8:52 PM Shuah Khan wrote:
>
> On 10/19/20 12:49 PM, Shuah Khan wrote:
> > On 10/19/20 11:20 AM, Andrey Konovalov wrote:
> >> From: Nazime Hande Harputluoglu
> >>
> >> Add kcov_remote_start()/kcov_remote_stop() annotations to the
On Fri, Nov 13, 2020 at 4:47 PM Marco Elver wrote:
>
> On Fri, 13 Nov 2020 at 14:42, Andrey Konovalov wrote:
> > On Fri, Nov 13, 2020 at 2:28 PM Sebastian Andrzej Siewior
> > wrote:
> > >
> > > On 2020-11-13 13:51:19 [+0100], Andrey Konovalov wrote:
> &g
ov
wrappers.
As the result of this change, the coverage from USB/IP related
usb_hcd_giveback_urb() calls won't be collected, but the WARNING is fixed.
A potential future improvement would be to support nested remote coverage
collection sections, but this patch doesn't address that.
Signed-o
for kcov_remote_start()/stop() annotations
(see Documentation/dev-tools/kcov.rst for details). As the result kcov
can now be used to collect coverage from vhci_rx_loop() threads.
Signed-off-by: Nazime Hande Harputluoglu
Co-developed-by: Andrey Konovalov
Signed-off-by: Andrey Konovalov
On Tue, Nov 24, 2020 at 9:02 AM Rong Chen wrote:
>
> On 11/23/20 10:15 PM, Andrey Konovalov wrote:
> > 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
On Tue, Dec 1, 2020 at 5:16 PM Daniel Axtens wrote:
>
> Building on the work of Christophe, Aneesh and Balbir, I've ported
> KASAN to 64-bit Book3S kernels running on the Radix MMU.
>
> This is a significant reworking of the previous versions. Instead of
> the previous approach which supported inl
On Wed, Dec 2, 2020 at 8:58 AM Kuan-Ying Lee wrote:
>
> We hit this issue in our internal test.
> When enabling generic kasan, a kfree()'d object is put into per-cpu
> quarantine first. If the cpu goes offline, object still remains in
> the per-cpu quarantine. If we call kmem_cache_destroy() now,
On Thu, Dec 3, 2020 at 9:52 AM Stephen Rothwell wrote:
>
> Hi all,
>
> After merging the akpm tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> mm/kasan/quarantine.c: In function 'quarantine_put':
> mm/kasan/quarantine.c:197:15: error: 'info' undeclared (first use in thi
On Thu, Dec 3, 2020 at 5:04 PM Qian Cai wrote:
>
> On Thu, 2020-11-26 at 10:13 +0530, vji...@codeaurora.org wrote:
> > From: Yogesh Lal
> >
> > Add a kernel parameter stack_hash_order to configure STACK_HASH_SIZE.
> >
> > Aim is to have configurable value for STACK_HASH_SIZE, so that one
> > can
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 ++
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 "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
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 "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
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
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: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 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
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
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 "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
--
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 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 "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 "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 "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
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
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
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
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
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/
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
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
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
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
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
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
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
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
On Thu, Jan 21, 2021 at 12:31 PM Vincenzo Frascino
wrote:
>
> Hi Andrey,
>
> On 1/19/21 6:09 PM, Andrey Konovalov wrote:
> > Hi Vincenzo,
> >
> > This change has multiple conflicts with the KASAN testing patches that
> > are currently in the mm tree. I
On Thu, Jan 21, 2021 at 12:30 PM Vincenzo Frascino
wrote:
>
> Hi Andrey,
>
> On 1/19/21 8:56 PM, Andrey Konovalov wrote:
> >> return (is_vmalloc_addr(addr) || virt_addr_valid(addr));
> > Do we need is_vmalloc_addr()? As we don't yet have vmalloc support
An invalid address (e.g. NULL) passed to the function when,
> KASAN_HW_TAGS is enabled, leads to a kernel panic.
>
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Dmitry Vyukov
> Cc: Leon Romanovsky
> Cc: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
> -
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
> ---
> Documentation/dev-tools/kasan.rst | 7 +++
> lib/test_kasan.c | 2 +-
> mm/kasan/hw_tags.c| 27 +
On Thu, Jan 21, 2021 at 5:39 PM Vincenzo Frascino
wrote:
>
> KASAN provides an asynchronous mode of execution.
>
> Add reporting functionality for this mode.
>
> Cc: Dmitry Vyukov
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Andrey Konovalov
> Si
mode is
> enabled.
>
> Cc: Dmitry Vyukov
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
> ---
> lib/test_kasan.c | 5 +
> mm/kasan/kasan.h | 2 ++
> 2 files changed, 7 insertions(+)
>
>
On Thu, Jan 21, 2021 at 5:40 PM Vincenzo Frascino
wrote:
>
> MTE enabled arm64 HW can be configured in synchronous or asynchronous
> tagging mode of execution.
> In synchronous mode, an exception is triggered if a tag check fault
> occurs.
> In asynchronous mode, if a tag check fault occurs, the T
On Thu, Jan 21, 2021 at 5:40 PM Vincenzo Frascino
wrote:
>
> MTE provides a mode that asynchronously updates the TFSR_EL1 register
> when a tag check exception is detected.
>
> To take advantage of this mode the kernel has to verify the status of
> the register at:
> 1. Context switching
> 2.
asan_module.ko
>
> It also works in Kaslr with CONFIG_RANDOMIZE_MODULE_REGION_FULL
> and randomize module region inside vmalloc area.
>
>
> [1]: commit 0609ae011deb41c ("x86/kasan: support KASAN_VMALLOC")
>
> Signed-off-by: Lecopzer Chen
> Acked-by: Andrey Konov
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
> ---
> Documentation/dev-tools/kasan.rst | 9 +
> lib/test_kasan.c | 2 +-
> mm/kasan/hw_tags.c| 32 +
> if (current->thread.sctlr_tcf0 != next->thread.sctlr_tcf0)
> update_sctlr_el1_tcf0(next->thread.sctlr_tcf0);
> + else
> + isb();
> +
> + /*
> +* Check if an async tag exception occurred at EL1.
> +*
> +* Note: On the context switch path we rely on the dsb() present
> +* in __switch_to() to guarantee that the indirect writes to TFSR_EL1
> +* are synchronized before this point.
> +* isb() above is required for the same reason.
> +*
> +*/
> + mte_check_tfsr_el1();
> }
>
> void mte_suspend_exit(void)
> --
> 2.30.0
>
Acked-by: Andrey Konovalov
On Fri, Jan 22, 2021 at 3:11 PM Vincenzo Frascino
wrote:
>
> KASAN provides an asynchronous mode of execution.
>
> Add reporting functionality for this mode.
>
> Cc: Dmitry Vyukov
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Andrey Konovalov
> Reviewed-
.
>
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Dmitry Vyukov
> Cc: Leon Romanovsky
> Cc: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
> ---
> include/linux/kasan.h | 7 +++
> mm/kasan/kasan.h | 2 +-
> 2 files changed, 8 inse
urn true for valid addresses only.
>
> Note: KASAN_HW_TAGS support for vmalloc will be added with a future
> patch.
>
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Dmitry Vyukov
> Cc: Leon Romanovsky
> Cc: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
>
ed.
>
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Dmitry Vyukov
> Cc: Leon Romanovsky
> Cc: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
> ---
> include/linux/kasan.h | 7 +++
> 1 file changed, 7 insertions(+)
>
> diff --git a/include/linu
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
.
- 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
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
-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
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
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
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
501 - 600 of 2085 matches
Mail list logo