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 Fri, Nov 30, 2018 at 1:32 AM Randy Dunlap wrote:
>
> On 11/29/18 1:38 PM, a...@linux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2018-11-29-13-37 has been uploaded to
> >
> >http://www.ozlabs.org/~akpm/mmotm/
> >
> > mmotm-readme.txt says
> >
> > README for mm-of-the-moment:
> >
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
On Thu, Nov 29, 2018 at 7:23 PM Catalin Marinas wrote:
>
> On Thu, Nov 08, 2018 at 03:36:09PM +0100, Andrey Konovalov wrote:
> > diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
> > index efe79c1cdd47..c045b4eff95e 100644
> > --- a/include/linux/uaccess.h
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
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
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
: 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
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
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
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
On Thu, Nov 29, 2018 at 7:22 PM Catalin Marinas wrote:
>
> On Thu, Nov 08, 2018 at 03:36:08PM +0100, Andrey Konovalov wrote:
> > This patch makes the untagged_addr macro accept all kinds of address types
> > (void *, unsigned long, etc.) and allows not to specify type casts
On Thu, Nov 29, 2018 at 7:16 PM Catalin Marinas wrote:
>
> Hi Andrey,
>
> On Thu, Nov 08, 2018 at 03:48:10PM +0100, Andrey Konovalov wrote:
> > On Thu, Nov 8, 2018 at 3:36 PM, Andrey Konovalov
> > wrote:
> > > Changes in v8:
> > > - Rebased onto 651022
On Fri, Jun 29, 2018 at 3:01 PM, Mark Rutland wrote:
> On Fri, Jun 29, 2018 at 02:45:08PM +0200, Andrey Konovalov wrote:
>> So with clean kernel after boot we get 40 kb memory usage. With KASAN
>> it is ~120 kb, which is 200% overhead. With KHWASAN it's 50 kb, which
>
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
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 access_ok and __u
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 handle the case of tagged user addresses separately.
Untag user pointers passed to these functions.
Signed-off-by: Andrey Konovalov
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
in access_ok and in __uaccess_mask_ptr,
before performing access validity checks.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/uaccess.h | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm
lookup.
Signed-off-by: Andrey Konovalov
---
mm/gup.c | 4
1 file changed, 4 insertions(+)
diff --git a/mm/gup.c b/mm/gup.c
index 541904a7c60f..5d0e9715bab7 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -650,6 +650,8 @@ static long __get_user_pages(struct task_struct *tsk,
struct mm_struct *mm
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
On Tue, May 8, 2018 at 5:11 PM, Catalin Marinas wrote:
> On Wed, May 02, 2018 at 07:25:17PM +0200, Andrey Konovalov wrote:
>> On Wed, May 2, 2018 at 5:36 PM, Kirill A. Shutemov
>> wrote:
>> > On Wed, May 02, 2018 at 02:38:42PM +, Andrey Konovalov wrote:
>> >
m.doc.ihi0044f/IHI0044F_aaelf.pdf
> SPARC ABI: http://math-atlas.sourceforge.net/devel/assembly/abi_sysV_sparc.pdf
>
> Cc: Catalin Marinas
> Cc: Will Deacon
> Cc: Mark Rutland
> Cc: Robin Murphy
> Cc: Kees Cook
> Cc: Kate Stewart
> Cc: Greg Kroah-Hartman
> Cc:
On Tue, Dec 11, 2018 at 5:22 PM Vincenzo Frascino
wrote:
>
> Hi Andrey,
>
> On 06/12/2018 12:24, Andrey Konovalov wrote:
> > This commit adds tag-based KASAN specific hooks implementation and
> > adjusts common generic and tag-based KASAN ones.
> >
> > 1. W
On Fri, Dec 14, 2018 at 1:34 PM Vincenzo Frascino
wrote:
>
> On 12/12/18 3:04 PM, Andrey Konovalov wrote:
> > On Tue, Dec 11, 2018 at 5:22 PM Vincenzo Frascino
> > wrote:
> >>
> >> Hi Andrey,
> >>
> >> On 06/12/2018 12:24, Andrey Konovalov
Instead of changing cache->align to be aligned to KASAN_SHADOW_SCALE_SIZE
in kasan_cache_create() we can reuse the ARCH_SLAB_MINALIGN macro.
Suggested-by: Vincenzo Frascino
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/kasan.h | 4
mm/kasan/common.c | 2 --
On Mon, Dec 17, 2018 at 9:38 PM Andrew Morton wrote:
>
> On Mon, 17 Dec 2018 20:33:42 +0100 Andrey Konovalov
> wrote:
>
> > > Curiosity, did you try your patches with SLUB red zoning enabled?
> > > Since the area used for the Redzone is just after th
On Wed, Dec 12, 2018 at 4:02 PM Catalin Marinas wrote:
>
> Hi Andrey,
>
> On Wed, Dec 12, 2018 at 03:23:25PM +0100, Andrey Konovalov wrote:
> > On Mon, Dec 10, 2018 at 3:31 PM Vincenzo Frascino
> > wrote:
> > > On arm64 the TCR_EL1.TBI0 bit has been set since Li
On Wed, Dec 12, 2018 at 6:01 PM Dave Martin wrote:
>
> On Mon, Dec 10, 2018 at 01:50:57PM +0100, Andrey Konovalov wrote:
> > arm64 has a feature called Top Byte Ignore, which allows to embed pointer
> > tags into the top byte of each pointer. Userspace programs (such as
&g
On Mon, Dec 10, 2018 at 2:35 AM Paul Gortmaker
wrote:
>
> On Thu, Dec 6, 2018 at 7:25 AM 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
>&g
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__.
Acked-by: Catalin Marinas
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm
for vma lookup.
Signed-off-by: Andrey Konovalov
---
mm/gup.c | 4
1 file changed, 4 insertions(+)
diff --git a/mm/gup.c b/mm/gup.c
index 8cb68a50dbdf..409aedb1e2d5 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -683,6 +683,8 @@ static long __get_user_pages(struct task_struct *tsk,
struct mm_struct
This patch adds a simple test, that calls the uname syscall with a
tagged user pointer as an argument. Without the kernel accepting tagged
user pointers the test fails with EFAULT.
Signed-off-by: Andrey Konovalov
---
tools/testing/selftests/arm64/.gitignore | 1 +
tools/testing/selftests
Document the changes in Documentation/arm64/tagged-pointers.txt.
Signed-off-by: Andrey Konovalov
---
Documentation/arm64/tagged-pointers.txt | 25 +++--
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/Documentation/arm64/tagged-pointers.txt
b/Documentation
mm, arm64: untag user addresses in memory syscalls".
- Rebased onto 3eb2ce82 (4.16-rc7).
Reviewed-by: Luc Van Oostenryck
Signed-off-by: Andrey Konovalov
Andrey Konovalov (8):
arm64: add type casts to untagged_addr macro
uaccess: add untagged_addr definition for other arches
arm64:
arm64.
Acked-by: Catalin Marinas
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..42b7a4ac65e2 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
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 handle the case of tagged user addresses separately.
Untag user pointers passed to these functions.
Signed-off-by: Andrey Konovalov
the address before subtracting.
Signed-off-by: Andrey Konovalov
---
fs/namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index a7f91265ea67..694dcedb7e7d 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2686,7 +2686,7 @@ void
in access_ok and in __uaccess_mask_ptr,
before performing access validity checks.
Reviewed-by: Catalin Marinas
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/uaccess.h | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/include/asm/uaccess.h b
On Mon, Dec 10, 2018 at 9:59 PM Arnd Bergmann wrote:
>
> Building with CONFIG_KASAN=y when neither KASAN_GENERIC nor KASAN_SW_TAGS
> can be selected leads to a build error:
>
> arch/arm64/mm/kasan_init.c: In function 'kasan_pte_populate':
> arch/arm64/mm/kasan_init.c:106:28: error: 'KASAN_SHADOW_I
On Tue, Dec 11, 2018 at 4:18 PM Will Deacon wrote:
>
> Hi Andrey,
>
> On Thu, Dec 06, 2018 at 01:24:18PM +0100, 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,
>
On Tue, Dec 11, 2018 at 4:28 PM Luc Van Oostenryck
wrote:
>
> On Thu, Dec 06, 2018 at 01:24:23PM +0100, Andrey Konovalov wrote:
> > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
> > index 3e7dafb3ea80..39f668d5066b 100644
> > --- a/includ
On Tue, Dec 18, 2018 at 9:55 PM Andrew Morton wrote:
>
> On Tue, 18 Dec 2018 14:30:33 +0100 Andrey Konovalov
> wrote:
>
> > Instead of changing cache->align to be aligned to KASAN_SHADOW_SCALE_SIZE
> > in kasan_cache_create() we can reuse the ARCH_SLAB_MINALIGN macro
On Mon, Jun 4, 2018 at 6:29 AM Samuel Ortiz wrote:
>
> Hi Andrey,
>
> On Thu, Apr 12, 2018 at 06:56:56PM +0200, Andrey Konovalov wrote:
> > nfc_genl_deactivate_target() relies on the NFC_ATTR_TARGET_INDEX
> > attribute being present, but doesn't check whether it is
Hi Andrew,
This patchset includes an updated "kasan, arm64: use ARCH_SLAB_MINALIGN
instead of manual aligning" patch and fixes for two more issues that
were uncovered while testing with a variety of different config options
enabled.
Thanks!
Andrey Konovalov (3):
kasan,
eping the same tag if the memory don't actually gets
reallocated during krealloc.
Signed-off-by: Andrey Konovalov
---
include/linux/kasan.h | 14 +-
include/linux/slab.h | 4 ++--
mm/kasan/common.c | 20
mm/slab.c | 8
mm/sla
Instead of changing cache->align to be aligned to KASAN_SHADOW_SCALE_SIZE
in kasan_cache_create() we can reuse the ARCH_SLAB_MINALIGN macro.
Suggested-by: Vincenzo Frascino
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/kasan.h | 4
include/linux/slab.h | 1 +
operations.
Signed-off-by: Andrey Konovalov
---
mm/slub.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/slub.c b/mm/slub.c
index 36c0befeebd8..1e3d0ec4e200 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3846,6 +3846,8 @@ void __check_heap_object(const void *ptr, unsigned long
n, struct page
with CONFIG_HARDENED_USERCOPY"
patch.
- Added "kasan: fix krealloc handling for tag-based mode" patch.
Andrey Konovalov (3):
kasan, arm64: use ARCH_SLAB_MINALIGN instead of manual aligning
kasan: make tag based mode work with CONFIG_HARDENED_USERCOPY
kasan: fix krealloc handling for tag-bas
eping the same tag if the memory don't actually gets
reallocated during krealloc.
Signed-off-by: Andrey Konovalov
---
mm/kasan/common.c | 63 ---
1 file changed, 43 insertions(+), 20 deletions(-)
diff --git a/mm/kasan/common.c b/mm/kasan/comm
operations.
Signed-off-by: Andrey Konovalov
---
mm/slub.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/slub.c b/mm/slub.c
index 36c0befeebd8..1e3d0ec4e200 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3846,6 +3846,8 @@ void __check_heap_object(const void *ptr, unsigned long
n, struct page
Instead of changing cache->align to be aligned to KASAN_SHADOW_SCALE_SIZE
in kasan_cache_create() we can reuse the ARCH_SLAB_MINALIGN macro.
Suggested-by: Vincenzo Frascino
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/cache.h | 6 ++
mm/kasan/common.c | 2 --
On Wed, Jan 2, 2019 at 9:14 PM Andrew Morton wrote:
>
> On Wed, 2 Jan 2019 18:36:06 +0100 Andrey Konovalov
> wrote:
>
> > Instead of changing cache->align to be aligned to KASAN_SHADOW_SCALE_SIZE
> > in kasan_cache_create() we can reuse the ARCH_SLAB_MINALIGN macro
Qian Cai
Hi Qian,
Sorry, didn't see your first kmemleak fix. I can merge this fix into
my series if I end up resending it.
In any case:
Acked-by: Andrey Konovalov
Thanks!
> ---
> arch/arm64/mm/kasan_init.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> dif
On Tue, Nov 6, 2018 at 6:30 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).
[...]
> Reviewed-by: Andrey Ryabinin
&
On Wed, Nov 7, 2018 at 3:59 PM, Will Deacon wrote:
> On Wed, Nov 07, 2018 at 03:56:03PM +0100, Andrey Konovalov wrote:
>> On Tue, Nov 6, 2018 at 6:30 PM, Andrey Konovalov
>> wrote:
>> > This patchset adds a new software tag-based mode to KASAN [1].
>> > (Initi
On Thu, Nov 8, 2018 at 3:36 PM, Andrey Konovalov wrote:
[...]
> Changes in v8:
> - Rebased onto 65102238 (4.20-rc1).
> - Added a note to the cover letter on why syscall wrappers/shims that untag
> user pointers won't work.
> - Added a note to the cover letter that th
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, 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 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, 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
[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
---
.../media/platform/qcom/c
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
The first patch is the start of the work discussed in the "[RFC] Repurpose
V4L2_CID_PIXEL_RATE for the sampling rate in the pixel array" thread [1].
I plan to send a few other similar patches for other CSI receiver drivers,
and if the current patchset needs to wait for those before it can be merged
Actually, make that an Acked-by.
Acked-by: Robert Foss
OK, thanks!
On Sun, 14 Feb 2021 at 22:34, Andrey Konovalov
wrote:
There are places in the camss driver where camss_get_pixel_clock() is
called to get the pixel rate (using V4L2_CID_PIXEL_RATE control) and to
calculate the link frequency from
Hi Jacopo,
Thank you for the detailed review!
On 15.02.2021 15:00, Jacopo Mondi wrote:
Hi Andrey,
nice to see progress in this direction
On Mon, Feb 15, 2021 at 12:34:03AM +0300, Andrey Konovalov wrote:
There are places in the camss driver where camss_get_pixel_clock() is
called to get
On Mon, May 14, 2018 at 6:24 PM, Nick Desaulniers
wrote:
> On Fri, Apr 20, 2018 at 7:59 AM Andrey Konovalov
> wrote:
>> On Fri, Apr 20, 2018 at 10:13 AM, Marc Zyngier
> wrote:
>> >> The issue is that
>> >> clang doesn't know about the "S" a
: Initialization of device
kvm-arm-gicv3 failed: error creating in-kernel VGIC: No such device)
PASS gicv2-active (1 tests)
SKIP gicv3-active (qemu-system-aarch64: Initialization of device
kvm-arm-gicv3 failed: error creating in-kernel VGIC: No such device)
PASS psci (4 tests)
PASS timer (8 tests)
On Tue, May 22, 2018 at 8:28 PM, Nick Desaulniers
wrote:
> On Fri, May 18, 2018 at 11:13 AM Marc Zyngier wrote:
>> > - you have checked that with a released version of the compiler, you
>
> On Tue, May 22, 2018 at 10:58 AM Andrey Konovalov
> wrote:
>> Tested-by: Andr
On Wed, May 23, 2018 at 7:47 PM, Nick Desaulniers
wrote:
> On Wed, May 23, 2018 at 4:54 AM Andrey Konovalov
> wrote:
>> On Tue, May 22, 2018 at 8:28 PM, Nick Desaulniers
>> wrote:
>> > On Fri, May 18, 2018 at 11:13 AM Marc Zyngier
> wrote:
>> >>
Hi Marc!
I've tried to pull in new upstream commits and the kernel build
started failing for me with the following errors (see below).
It seems that the reason is your commit "arm64: Add
ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support". It seems that Clang
doesn't like 32 bits registers being us
On Thu, Mar 1, 2018 at 11:47 AM, Marc Zyngier wrote:
> Hi Andrey,
>
> On 28/02/18 19:32, Andrey Konovalov wrote:
>> Hi Marc!
>>
>> I've tried to pull in new upstream commits and the kernel build
>> started failing for me with the following errors (see bel
KASAN_SHADOW_SCALE_SHIFT in arch/arm64/Makefile, an appropriate variable
is declared and used.
Signed-off-by: Andrey Konovalov
---
arch/arm64/Makefile | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index b481b4a7c011..4bb18aee4846 100644
roper object address after the call that triggers invalid-free.
Signed-off-by: Andrey Konovalov
---
lib/test_kasan.c | 8
1 file changed, 8 insertions(+)
diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index 98854a64b014..ec657105edbf 100644
--- a/lib/test_kasan.c
+++ b/lib/test_ka
A compiler can optimize away memset calls by replacing them with mov
instructions. There are KASAN tests, that specifically test that KASAN
correctly handles memset calls, we don't want this optimization to
happen.
The solution is to add -fno-builtin flag to test_kasan.ko
Signed-off-by: A
The first one fixes the invalid-free test crashing the kernel, and the
second one fixes the memset tests working incorrectly due to compiler
optimizations.
Andrey Konovalov (2):
kasan: fix invalid-free test crashing the kernel
kasan: disallow compiler to optimize away memset in tests
lib
On Thu, Mar 1, 2018 at 6:15 PM, Andrey Konovalov wrote:
> When an invalid-free is triggered by one of the KASAN tests, the object
> doesn't actually get freed. This later leads to a BUG failure in
> kmem_cache_destroy that checks that there are no allocated objects in the
> ca
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
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
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
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
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
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 Thu, Apr 26, 2018 at 7:47 PM, Catalin Marinas
wrote:
My approach with this was to add untagging to every gup.c function
that is exposed for external use, but perhaps adding untagging only
where it is actually required is a better approach.
> On Wed, Apr 18, 2018 at 08:53:13PM +0200, And
On Thu, Apr 26, 2018 at 5:47 PM, Catalin Marinas
wrote:
> On Wed, Apr 18, 2018 at 08:53:12PM +0200, Andrey Konovalov wrote:
>> @@ -238,12 +239,15 @@ static inline void uaccess_enable_not_uao(void)
>> /*
>> * Sanitise a uaccess pointer such that it becomes NULL if abo
On Wed, May 2, 2018 at 5:36 PM, Kirill A. Shutemov
wrote:
> On Wed, May 02, 2018 at 02:38:42PM +0000, Andrey Konovalov wrote:
>> > Does having a tagged address here makes any difference? I couldn't hit a
>> > failure with my simple tests (LD_PRELOAD a library that
On Thu, Apr 19, 2018 at 11:33 AM, Kirill A. Shutemov
wrote:
> On Wed, Apr 18, 2018 at 08:53:09PM +0200, Andrey Konovalov wrote:
>> Hi!
>>
>> arm64 has a feature called Top Byte Ignore, which allows to embed pointer
>> tags into the top byte of each pointer. Userspace
On Wed, Mar 13, 2019 at 8:16 PM Sasha Levin wrote:
>
> From: Andrey Konovalov
>
> [ Upstream commit 51dedad06b5f6c3eea7ec1069631b1ef7796912a ]
Hi Sasha,
None of the 4.9, 4.14, 4.19 or 4.20 have tag-based KASAN, so
backporting these 3 KASAN related patches doesn't make mu
On Fri, Mar 29, 2019 at 11:30 AM Catalin Marinas
wrote:
>
> (I trimmed down the cc list a bit since it's always bouncing)
>
> On Thu, Mar 28, 2019 at 02:19:34PM -0400, Steven Rostedt wrote:
> > On Thu, 28 Mar 2019 19:10:07 +0100
> > Andrey Konovalov wrote:
> &
On Wed, Apr 3, 2019 at 4:29 AM Qian Cai wrote:
>
> The commit 51dedad06b5f ("kasan, slab: make freelist stored without
> tags") calls kasan_reset_tag() for off-slab slab management object
> leading to freelist being stored non-tagged. However, cache_grow_begin()
> -> alloc_slabmgmt() -> kmem_cache
On Wed, Apr 3, 2019 at 3:07 PM Qian Cai wrote:
>
> On Wed, 2019-04-03 at 13:23 +0200, Andrey Konovalov wrote:
> > On Wed, Apr 3, 2019 at 4:29 AM Qian Cai wrote:
> > >
> > > The commit 51dedad06b5f ("kasan, slab: make freelist stored without
> > > tags
On Sat, Feb 23, 2019 at 12:03 AM Dave Hansen wrote:
>
> On 2/22/19 4:53 AM, Andrey Konovalov wrote:
> > --- a/fs/namespace.c
> > +++ b/fs/namespace.c
> > @@ -2730,7 +2730,7 @@ void *copy_mount_options(const void __user * data)
> >
On Sat, Feb 23, 2019 at 12:06 AM Dave Hansen wrote:
>
> On 2/22/19 4:53 AM, Andrey Konovalov wrote:
> > userfaultfd_register() and userfaultfd_unregister() use provided user
> > pointers for vma lookups, which can only by done with untagged pointers.
>
> So, we have
On Sat, Feb 23, 2019 at 12:07 AM Dave Hansen wrote:
>
> On 2/22/19 4:53 AM, Andrey Konovalov wrote:
> > --- a/mm/mprotect.c
> > +++ b/mm/mprotect.c
> > @@ -578,6 +578,7 @@ static int do_mprotect_pkey(unsigned long start, size_t
> > len,
> > SYSCALL_DEFINE3(mp
On Fri, Feb 22, 2019 at 5:10 PM Szabolcs Nagy wrote:
>
> On 22/02/2019 15:40, Andrey Konovalov wrote:
> > On Fri, Feb 22, 2019 at 4:35 PM Szabolcs Nagy wrote:
> >>
> >> On 22/02/2019 12:53, Andrey Konovalov wrote:
> >>> This patchset is meant to be m
On Fri, Feb 22, 2019 at 11:55 PM Dave Hansen wrote:
>
> On 2/22/19 4:53 AM, Andrey Konovalov wrote:
> > The following testing approaches has been taken to find potential issues
> > with user pointer untagging:
> >
> > 1. Static testing (with sparse [3] and s
On Tue, Feb 9, 2021 at 7:45 PM Andrew Morton wrote:
>
> On Tue, 9 Feb 2021 17:02:56 + Catalin Marinas
> wrote:
>
> > On Tue, Feb 09, 2021 at 04:32:30PM +0100, Andrey Konovalov wrote:
> > > diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c
> > &
ot;
> |
>
> Fix the warning using "=r" for the address in the asm inline.
>
> Fixes: c8f8de4c0887 ("arm64: kasan: simplify and inline MTE functions")
> Cc: Catalin Marinas
> Cc: Will Deacon
> Cc: Andrey Konovalov
> Cc: Andrew Morton
> Signe
> Cc: Andrey Ryabinin
> Cc: Alexander Potapenko
> Cc: Andrey Konovalov
> Reviewed-by: Andrey Konovalov
> Signed-off-by: Vincenzo Frascino
> [ Add a new var instead of exposing kasan_arg_mode to be consistent with
> flags for other command line arguments. ]
> Si
101 - 200 of 2085 matches
Mail list logo