On Thu, Aug 15, 2019 at 5:44 PM Catalin Marinas wrote:
>
> Require that arg{3,4,5} of the PR_{SET,GET}_TAGGED_ADDR_CTRL prctl and
> arg2 of the PR_GET_TAGGED_ADDR_CTRL prctl() are zero rather than ignored
> for future extensions.
>
> Signed-off-by: Catalin Marinas
Acked-by
g the user addresses on entry to these functions.
>
> Signed-off-by: Catalin Marinas
Acked-by: Andrey Konovalov
> ---
> mm/mmap.c | 5 +
> mm/mremap.c | 6 +-
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> ind
GED_ADDR_ENABLE).
> Getting the status of the ABI or disabling it is still allowed.
>
> Signed-off-by: Catalin Marinas
Acked-by: Andrey Konovalov
> ---
> arch/arm64/kernel/process.c | 17 ++---
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/a
ged Address ABI.
>
> Cc: Will Deacon
> Cc: Andrey Konovalov
> Cc: Szabolcs Nagy
> Cc: Kevin Brodsky
> Signed-off-by: Vincenzo Frascino
> Co-developed-by: Catalin Marinas
> Signed-off-by: Catalin Marinas
Acked-by: Andrey Konovalov
> ---
> Documentation/arm64/tagg
the relaxation of the
> syscall ABI that allows userspace to pass certain tagged pointers to
> kernel syscalls.
>
> Cc: Will Deacon
> Cc: Andrey Konovalov
> Cc: Szabolcs Nagy
> Cc: Kevin Brodsky
> Signed-off-by: Vincenzo Frascino
> Co-developed-by: Catalin Marinas
the relaxation of the
> syscall ABI that allows userspace to pass certain tagged pointers to
> kernel syscalls.
>
> Cc: Will Deacon
> Cc: Andrey Konovalov
> Cc: Szabolcs Nagy
> Cc: Kevin Brodsky
> Signed-off-by: Vincenzo Frascino
> Co-developed-by: Catalin Marinas
On Wed, Oct 16, 2019 at 10:41 AM Marco Elver wrote:
>
> Kernel Concurrency Sanitizer (KCSAN) is a dynamic data-race detector for
> kernel space. KCSAN is a sampling watchpoint-based data-race detector.
> See the included Documentation/dev-tools/kcsan.rst for more details.
>
> This patch adds basic
On Fri, Mar 1, 2019 at 7:37 PM Dave Hansen wrote:
>
> On 3/1/19 8:59 AM, Catalin Marinas wrote:
> >>> So, we have to patch all these sites before the tagged values get to the
> >>> point of hitting the vma lookup functions. Dumb question: Why don't we
> >>> just patch the vma lookup functions the
strncpy_from_user and strnlen_user accept user addresses as arguments, and
do not go through the same path as copy_from_user and others, so here we
need to separately handle the case of tagged user addresses as well.
Untag user pointers passed to these functions.
Signed-off-by: Andrey Konovalov
architectures besides arm64.
Signed-off-by: Andrey Konovalov
---
include/linux/uaccess.h | 4
1 file changed, 4 insertions(+)
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index efe79c1cdd47..c045b4eff95e 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
Add a note that work on passing tagged user pointers to the kernel via
syscalls has started, but might not be complete yet.
Signed-off-by: Andrey Konovalov
---
Documentation/arm64/tagged-pointers.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/arm64
This patch makes the untagged_addr macro accept all kinds of address types
(void *, unsigned long, etc.) and allows not to specify type casts in each
place where it is used. This is done by using __typeof__.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/uaccess.h | 3 ++-
1 file
in access_ok and in __uaccess_mask_ptr.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/uaccess.h | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 2d6451cbaa86..24a221678fe3 100644
--- a
mm/gup.c provides a kernel interface that accepts user addresses and
manipulates user pages directly (for example get_user_pages, that is used
by the futex syscall). Here we also need to handle the case of tagged user
pointers.
Untag addresses passed to this interface.
Signed-off-by: Andrey
on/arm64/tagged-pointers.txt.
- Dropped “mm, arm64: untag user addresses in memory syscalls”.
- Rebased onto 3eb2ce82 (4.16-rc7).
Andrey Konovalov (6):
arm64: add type casts to untagged_addr macro
uaccess: add untagged_addr definition for other arches
arm64: untag user addresses in copy_from_
On Wed, Nov 7, 2018 at 5:54 PM, Mark Rutland wrote:
[...]
>> --- a/arch/arm64/Makefile
>> +++ b/arch/arm64/Makefile
>> @@ -94,7 +94,7 @@ endif
>> # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS -
>> KASAN_SHADOW_SCALE_SHIFT))
>> # - (1 << (64 - KASAN_SHADOW_SCALE
On Wed, Nov 7, 2018 at 6:04 PM, Mark Rutland wrote:
> On Tue, Nov 06, 2018 at 06:30:20PM +0100, Andrey Konovalov wrote:
>> This commit splits the current CONFIG_KASAN config option into two:
>> 1. CONFIG_KASAN_GENERIC, that enables the generic KASAN mode (the one
>>t
On Wed, Nov 7, 2018 at 6:08 PM, Mark Rutland wrote:
> On Tue, Nov 06, 2018 at 06:30:22PM +0100, Andrey Konovalov wrote:
>> A tag-based KASAN shadow memory cell contains a memory tag, that
>> corresponds to the tag in the top byte of the pointer, that points to that
>> memory
On Thu, Nov 8, 2018 at 1:22 PM, Mark Rutland wrote:
> On Tue, Nov 06, 2018 at 06:30:27PM +0100, Andrey Konovalov wrote:
>> show_pte in arm64 fault handling relies on the fact that the top byte of
>> a kernel pointer is 0xff, which isn't always the case with tag-based
>>
On Wed, Nov 7, 2018 at 6:23 PM, Mark Rutland wrote:
> On Tue, Nov 06, 2018 at 06:30:24PM +0100, Andrey Konovalov wrote:
>> This commit adds a few helper functions, that are meant to be used to
>> work with tags embedded in the top byte of kernel pointers: to set, to
>> ge
On Wed, Nov 7, 2018 at 5:52 PM, Mark Rutland wrote:
> Hi Andrey,
>
> On Tue, Nov 06, 2018 at 06:30:23PM +0100, Andrey Konovalov wrote:
>> __kimg_to_phys (which is used by virt_to_phys) and _virt_addr_is_linear
>> (which is used by virt_addr_valid) assume that the top byte
On Wed, Nov 7, 2018 at 7:10 PM, Catalin Marinas wrote:
> On Tue, Nov 06, 2018 at 06:30:23PM +0100, Andrey Konovalov wrote:
>> --- a/arch/arm64/include/asm/memory.h
>> +++ b/arch/arm64/include/asm/memory.h
>> @@ -92,6 +92,15 @@
>> #define KASAN_THREAD_SHIFT
On Tue, Nov 13, 2018 at 11:07 PM, Mark Rutland wrote:
> On Tue, Nov 13, 2018 at 04:01:27PM +0100, Andrey Konovalov wrote:
>> On Thu, Nov 8, 2018 at 1:22 PM, Mark Rutland wrote:
>> > On Tue, Nov 06, 2018 at 06:30:27PM +0100, Andrey Konovalov wrote:
>> >> show_pte in
On Wed, Nov 14, 2018 at 9:17 PM, Mark Rutland wrote:
> On Wed, Nov 14, 2018 at 09:06:23PM +0100, Andrey Konovalov wrote:
>> On Tue, Nov 13, 2018 at 11:07 PM, Mark Rutland wrote:
>> > On Tue, Nov 13, 2018 at 04:01:27PM +0100, Andrey Konovalov wrote:
>> >> On Thu
On Wed, Nov 14, 2018 at 8:23 PM, Andrey Konovalov wrote:
> On Wed, Nov 7, 2018 at 5:52 PM, Mark Rutland wrote:
>>> /*
>>> @@ -232,7 +241,7 @@ static inline unsigned long kaslr_offset(void)
>>> #define __is_lm_address(addr)(!!((addr) & BIT(VA_BITS -
With tag based KASAN mode the early shadow value is 0xff and not 0x00,
so this patch renames kasan_zero_(page|pte|pmd|pud|p4d) to
kasan_early_shadow_(page|pte|pmd|pud|p4d) to avoid confusion.
Suggested-by: Mark Rutland
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/kasan_init.c | 43
Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/kasan_init.c | 15 +--
include/linux/kasan.h | 8
mm/kasan/common.c | 3 ++-
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/mm/kasan_init.c b/arch
Signed-off-by: Andrey Konovalov
---
arch/arm64/Makefile | 11 ++-
arch/arm64/include/asm/memory.h | 7 +++
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 6cb9fc7e9382..99e7d08c6083 100644
--- a/arch/arm64
This commit adds a few helper functions, that are meant to be used to
work with tags embedded in the top byte of kernel pointers: to set, to
get or to reset the top byte.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/kasan.h | 8 +--
arch/arm64/include/asm/memory.h | 12
which
index this object corresponds to.
This patch moves obj_to_index from slab.c to include/linux/slab_def.h to
be reused by KASAN.
Acked-by: Christoph Lameter
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
include/linux/slab_def.h
-off-by: Andrey Konovalov
---
arch/arm64/include/asm/pgtable-hwdef.h | 1 +
arch/arm64/mm/proc.S | 8 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h
b/arch/arm64/include/asm/pgtable-hwdef.h
index 1d7d8da2ef9b
the logic of the hook implementation is very much similar to
the one provided by generic KASAN. Tag-based KASAN saves allocation and
free stack metadata to the slab object the same way generic KASAN does.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/memory.h | 8 +++-
include/linux/mm.h| 29 +
include/linux/page-flags-layout.h | 10 ++
mm/cma.c | 11 +++
mm/kasan/common.c
This patch updates KASAN documentation to reflect the addition of the new
tag-based mode.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
Documentation/dev-tools/kasan.rst | 232 ++
1 file changed, 138 insertions(+), 94
This patch adds a "SPDX-License-Identifier: GPL-2.0" mark to all source
files under mm/kasan.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/common.c | 1 +
mm/kasan/generic.c| 1 +
mm/kasan/generic_report.c | 1 +
on on
untagged (with tags reset) pointers to check whether it's the same memory
region or not.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/slab_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slab_com
This patch moves generic KASAN specific error reporting routines to
generic_report.c without any functional changes, leaving common error
reporting code in report.c to be later reused by tag-based KASAN.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
This patch adds __must_check annotations to kasan hooks that return a
pointer to make sure that a tagged pointer always gets propagated.
Suggested-by: Andrey Ryabinin
Signed-off-by: Andrey Konovalov
---
include/linux/kasan.h | 16 ++--
mm/kasan/common.c | 14 --
2
tag.
2. Tag-based KASAN reports all bugs with the "KASAN: invalid-access"
header.
Also simplify generic KASAN find_first_bad_addr.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/generic_report.c | 16 ---
mm/kas
to the brk instructions (to extract information
about the memory access that triggered the mismatch), reads the register
values (x0 contains the guilty address) and reports the bug.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/include
ed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/slab.c | 2 +-
mm/slub.c | 24 ++--
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index 26f60a22e5e0..27859fb39889 100644
--- a/mm/slab.c
+++
On Mon, Nov 19, 2018 at 6:26 PM, Andrey Konovalov wrote:
> This patchset adds a new software tag-based mode to KASAN [1].
> (Initially this mode was called KHWASAN, but it got renamed,
> see the naming rationale at the end of this section).
>
> The plan is to implement HWASan [2]
fact that TTBR1 pointers might be
tagged when tag-based KASAN is in use, and uses these helper functions to
perform pointer checks in arch/arm64/mm/fault.c.
Suggested-by: Mark Rutland
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/fault.c | 31 ++-
1 file change
macro is used. This is done by using __typeof__.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/memory.h | 8
arch/arm64/include/asm/uaccess.h | 7 ---
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm
virt_addr_is_linear (which is used by virt_addr_valid) assumes that the
top byte of the address is 0xff, which isn't always the case with
tag-based KASAN.
This patch resets the tag in this macro.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
correctly with each of the
config options.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/Kconfig | 1 +
include/linux/compiler-clang.h | 5 +-
include/linux/compiler-gcc.h| 6 ++
include/linux
We now have two KASAN modes: generic KASAN and tag-based KASAN. Rename
kasan.c to generic.c to reflect that. Also rename kasan_init.c to init.c
as it contains initialization code for both KASAN modes.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
Tag-based KASAN reuses a significant part of the generic KASAN code, so
move the common parts to common.c without any functional changes.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/Makefile | 5 +-
mm/kasan/common.c | 603
dress + kmap usage).
- Used the reserved tag 0xFE to mark redzones and freed objects.
- Added mnemonics for esr manipulation in KHWASAN brk handler.
- Added a comment about the -recover flag.
- Some minor cleanups and fixes.
- Rebased onto 3215b9d5 (4.16-rc6+).
- Tested on real hardware (Odroid C2 board)
: Andrey Konovalov
---
include/linux/kasan.h | 43 +--
include/linux/slab.h | 4 ++--
mm/kasan/kasan.c | 30 ++
mm/slab.c | 12 ++--
mm/slab.h | 2 +-
mm/slab_common.c | 4 ++--
mm
is assigned by kasan_kmalloc.
Signed-off-by: Andrey Konovalov
---
mm/slub.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index fdd4a86aa882..8561a32910dd 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3364,16 +3364,16 @@ static void
On Fri, Nov 23, 2018 at 6:37 PM, Mark Rutland wrote:
> On Mon, Nov 19, 2018 at 06:26:25PM +0100, Andrey Konovalov wrote:
>> Move the untagged_addr() macro from arch/arm64/include/asm/uaccess.h
>> to arch/arm64/include/asm/memory.h to be later reused by KASAN.
>>
>>
On Fri, Nov 23, 2018 at 6:43 PM, Mark Rutland wrote:
> On Mon, Nov 19, 2018 at 06:26:21PM +0100, Andrey Konovalov wrote:
>> This commit splits the current CONFIG_KASAN config option into two:
>> 1. CONFIG_KASAN_GENERIC, that enables the generic KASAN mode (the one
>>t
Tag-based KASAN reuses a significant part of the generic KASAN code, so
move the common parts to common.c without any functional changes.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/Makefile | 5 +-
mm/kasan/common.c | 603
: Andrey Konovalov
---
include/linux/kasan.h | 43 +--
include/linux/slab.h | 4 ++--
mm/kasan/kasan.c | 30 ++
mm/slab.c | 12 ++--
mm/slab.h | 2 +-
mm/slab_common.c | 4 ++--
mm
on in KHWASAN brk handler.
- Added a comment about the -recover flag.
- Some minor cleanups and fixes.
- Rebased onto 3215b9d5 (4.16-rc6+).
- Tested on real hardware (Odroid C2 board).
- Added better benchmarks.
[1] https://lkml.org/lkml/2018/7/18/765
[2] https://lkml.org/lkml/2018/4/19/775
This patch updates KASAN documentation to reflect the addition of the new
tag-based mode.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
Documentation/dev-tools/kasan.rst | 232 ++
1 file changed, 138 insertions(+), 94
Now, that all the necessary infrastructure code has been introduced,
select HAVE_ARCH_KASAN_SW_TAGS for arm64 to enable software tag-based
KASAN mode.
Signed-off-by: Andrey Konovalov
---
arch/arm64/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64
-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/memory.h | 8 +++-
include/linux/mm.h| 29 +
include/linux/page-flags-layout.h | 10 ++
mm/cma.c | 11 +++
mm/kasan/common.c
which
index this object corresponds to.
This patch moves obj_to_index from slab.c to include/linux/slab_def.h to
be reused by KASAN.
Acked-by: Christoph Lameter
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
include/linux/slab_def.h
ed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/slab.c | 2 +-
mm/slub.c | 24 ++--
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index 26f60a22e5e0..27859fb39889 100644
--- a/mm/slab.c
+++
virt_addr_is_linear (which is used by virt_addr_valid) assumes that the
top byte of the address is 0xff, which isn't always the case with
tag-based KASAN.
This patch resets the tag in this macro.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
on on
untagged (with tags reset) pointers to check whether it's the same memory
region or not.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/slab_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slab_com
-off-by: Andrey Konovalov
---
arch/arm64/include/asm/pgtable-hwdef.h | 1 +
arch/arm64/mm/proc.S | 8 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h
b/arch/arm64/include/asm/pgtable-hwdef.h
index 1d7d8da2ef9b
With tag based KASAN mode the early shadow value is 0xff and not 0x00,
so this patch renames kasan_zero_(page|pte|pmd|pud|p4d) to
kasan_early_shadow_(page|pte|pmd|pud|p4d) to avoid confusion.
Suggested-by: Mark Rutland
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/kasan_init.c | 43
tag.
2. Tag-based KASAN reports all bugs with the "KASAN: invalid-access"
header.
Also simplify generic KASAN find_first_bad_addr.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/generic_report.c | 16 ---
mm/kas
This patch adds a "SPDX-License-Identifier: GPL-2.0" mark to all source
files under mm/kasan.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/common.c | 1 +
mm/kasan/generic.c| 1 +
mm/kasan/generic_report.c | 1 +
This patch moves generic KASAN specific error reporting routines to
generic_report.c without any functional changes, leaving common error
reporting code in report.c to be later reused by tag-based KASAN.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
This patch adds __must_check annotations to kasan hooks that return a
pointer to make sure that a tagged pointer always gets propagated.
Suggested-by: Andrey Ryabinin
Signed-off-by: Andrey Konovalov
---
include/linux/kasan.h | 16 ++--
mm/kasan/common.c | 15 +--
2
the logic of the hook implementation is very much similar to
the one provided by generic KASAN. Tag-based KASAN saves allocation and
free stack metadata to the slab object the same way generic KASAN does.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
to the brk instructions (to extract information
about the memory access that triggered the mismatch), reads the register
values (x0 contains the guilty address) and reports the bug.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/include
fact that TTBR1 pointers might be
tagged when tag-based KASAN is in use, and uses these helper functions to
perform pointer checks in arch/arm64/mm/fault.c.
Suggested-by: Mark Rutland
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/fault.c | 31 ++-
1 file change
Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/kasan_init.c | 15 +--
include/linux/kasan.h | 8
mm/kasan/common.c | 3 ++-
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/mm/kasan_init.c b/arch
is assigned by kasan_kmalloc.
Signed-off-by: Andrey Konovalov
---
mm/slub.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index fdd4a86aa882..8561a32910dd 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3364,16 +3364,16 @@ static void
We now have two KASAN modes: generic KASAN and tag-based KASAN. Rename
kasan.c to generic.c to reflect that. Also rename kasan_init.c to init.c
as it contains initialization code for both KASAN modes.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
Signed-off-by: Andrey Konovalov
---
arch/arm64/Makefile | 11 ++-
arch/arm64/include/asm/memory.h | 7 +++
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 6cb9fc7e9382..99e7d08c6083 100644
--- a/arch/arm64
commit adds the CONFIG_KASAN_SW_TAGS config option, this option
is not selectable, as it depends on HAVE_ARCH_KASAN_SW_TAGS, which we will
enable once all the infrastracture code has been added.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
include/linux
macro is used. This is done by using __typeof__.
Acked-by: Mark Rutland
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/memory.h | 8
arch/arm64/include/asm/uaccess.h | 7 ---
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/include/asm/memory.h b
This commit adds a few helper functions, that are meant to be used to
work with tags embedded in the top byte of kernel pointers: to set, to
get or to reset the top byte.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/kasan.h | 8 +--
arch/arm64/include/asm/memory.h | 12
On Tue, Dec 4, 2018 at 11:24 PM Max Filippov wrote:
>
> Hello,
>
> On Tue, Nov 27, 2018 at 9:00 AM Andrey Konovalov
> wrote:
> >
> > This commit splits the current CONFIG_KASAN config option into two:
> > 1. CONFIG_KASAN_GENERIC, that enables the generic KASAN
On Thu, Nov 29, 2018 at 7:01 PM Will Deacon wrote:
>
> On Tue, Nov 27, 2018 at 05:55:41PM +0100, Andrey Konovalov wrote:
> > Now, that all the necessary infrastructure code has been introduced,
> > select HAVE_ARCH_KASAN_SW_TAGS for arm64 to enable software tag-ba
On Thu, Nov 29, 2018 at 7:01 PM Will Deacon wrote:
>
> On Tue, Nov 27, 2018 at 05:55:38PM +0100, Andrey Konovalov wrote:
> > Tag-based KASAN inline instrumentation mode (which embeds checks of shadow
> > memory into the generated code, instead of inserting a callback) g
: Andrey Konovalov
---
include/linux/kasan.h | 43 +--
include/linux/slab.h | 4 ++--
mm/kasan/kasan.c | 30 ++
mm/slab.c | 12 ++--
mm/slab.h | 2 +-
mm/slab_common.c | 4 ++--
mm
is assigned by kasan_kmalloc.
Signed-off-by: Andrey Konovalov
---
mm/slub.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index fdd4a86aa882..8561a32910dd 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3364,16 +3364,16 @@ static void
We now have two KASAN modes: generic KASAN and tag-based KASAN. Rename
kasan.c to generic.c to reflect that. Also rename kasan_init.c to init.c
as it contains initialization code for both KASAN modes.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
This patch adds __must_check annotations to kasan hooks that return a
pointer to make sure that a tagged pointer always gets propagated.
Suggested-by: Andrey Ryabinin
Signed-off-by: Andrey Konovalov
---
include/linux/kasan.h | 16 ++--
mm/kasan/common.c | 15 +--
2
-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/memory.h | 8 +++-
include/linux/mm.h| 29 +
include/linux/page-flags-layout.h | 10 ++
mm/cma.c | 11 +++
mm/kasan/common.c
With tag based KASAN mode the early shadow value is 0xff and not 0x00,
so this patch renames kasan_zero_(page|pte|pmd|pud|p4d) to
kasan_early_shadow_(page|pte|pmd|pud|p4d) to avoid confusion.
Suggested-by: Mark Rutland
Signed-off-by: Andrey Konovalov
---
arch/arm64/mm/kasan_init.c | 43
This patch moves generic KASAN specific error reporting routines to
generic_report.c without any functional changes, leaving common error
reporting code in report.c to be later reused by tag-based KASAN.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
-off-by: Andrey Konovalov
---
arch/arm64/include/asm/pgtable-hwdef.h | 1 +
arch/arm64/mm/proc.S | 8 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h
b/arch/arm64/include/asm/pgtable-hwdef.h
index 1d7d8da2ef9b
This patch adds a "SPDX-License-Identifier: GPL-2.0" mark to all source
files under mm/kasan.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/common.c | 1 +
mm/kasan/generic.c| 1 +
mm/kasan/generic_report.c | 1 +
On Thu, Dec 6, 2018 at 12:10 PM Will Deacon wrote:
>
> On Thu, Dec 06, 2018 at 11:31:43AM +0100, Andrey Konovalov wrote:
> > On Thu, Nov 29, 2018 at 7:01 PM Will Deacon wrote:
> > >
> > > On Tue, Nov 27, 2018 at 05:55:38PM +0100, Andrey Konovalov wrote:
This patch updates KASAN documentation to reflect the addition of the new
tag-based mode.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
Documentation/dev-tools/kasan.rst | 232 ++
1 file changed, 138 insertions(+), 94
to the brk instructions (to extract information
about the memory access that triggered the mismatch), reads the register
values (x0 contains the guilty address) and reports the bug.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
arch/arm64/include
Now, that all the necessary infrastructure code has been introduced,
select HAVE_ARCH_KASAN_SW_TAGS for arm64 to enable software tag-based
KASAN mode.
Signed-off-by: Andrey Konovalov
---
arch/arm64/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64
the logic of the hook implementation is very much similar to
the one provided by generic KASAN. Tag-based KASAN saves allocation and
free stack metadata to the slab object the same way generic KASAN does.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
ed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/slab.c | 2 +-
mm/slub.c | 24 ++--
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index 26f60a22e5e0..27859fb39889 100644
--- a/mm/slab.c
+++
tag.
2. Tag-based KASAN reports all bugs with the "KASAN: invalid-access"
header.
Also simplify generic KASAN find_first_bad_addr.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/kasan/generic_report.c | 16 ---
mm/kas
on on
untagged (with tags reset) pointers to check whether it's the same memory
region or not.
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
mm/slab_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slab_com
which
index this object corresponds to.
This patch moves obj_to_index from slab.c to include/linux/slab_def.h to
be reused by KASAN.
Acked-by: Christoph Lameter
Reviewed-by: Andrey Ryabinin
Reviewed-by: Dmitry Vyukov
Signed-off-by: Andrey Konovalov
---
include/linux/slab_def.h
1 - 100 of 269 matches
Mail list logo