For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko
---
v8: - incorporated fixes
When free_meta_offset is not zero, it is usually aligned on 4 bytes,
because the size of preceding kasan_alloc_meta is aligned on 4 bytes.
As a result, accesses to kasan_free_meta fields may be misaligned.
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
mm/kasan/kasan.c | 3
led to random stacks having been reported.
Fixes: 7ed2f9e663854db ("mm, kasan: SLAB support")
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
v8: - Updated the patch description
---
include/linux/slub_def.h | 10 ++
mm/slub.c| 2 +-
2 files chang
When free_meta_offset is not zero, it is usually aligned on 4 bytes,
because the size of preceding kasan_alloc_meta is aligned on 4 bytes.
As a result, accesses to kasan_free_meta fields may be misaligned.
Signed-off-by: Alexander Potapenko
---
mm/kasan/kasan.c | 3 ++-
1 file changed, 2
led to random stacks having been reported.
Fixes: 7ed2f9e663854db ("mm, kasan: SLAB support")
Signed-off-by: Alexander Potapenko
---
v8: - Updated the patch description
---
include/linux/slub_def.h | 10 ++
mm/slub.c| 2 +-
2 files changed, 7 insertions(+), 5
-59 -m 320 -smp 1 -device
> e1000,netdev=net0 -netdev user,id=net0 -boot order=nc -no-reboot -watchdog
> i6300esb -rtc base=localtime -drive
> file=/fs/sdg1/disk0-vm-kbuild-yocto-x86_64-59,media=disk,if=virtio -pidfile
> /dev/shm/kboot/pid-vm-kbuild-yocto-x86_64-59 -serial
> file:/de
t; e1000,netdev=net0 -netdev user,id=net0 -boot order=nc -no-reboot -watchdog
> i6300esb -rtc base=localtime -drive
> file=/fs/sdg1/disk0-vm-kbuild-yocto-x86_64-59,media=disk,if=virtio -pidfile
> /dev/shm/kboot/pid-vm-kbuild-yocto-x86_64-59 -serial
> file:/dev/shm/kboot/serial-vm
I've posted the link to
http://article.gmane.org/gmane.linux.kernel/2266971 in the discussion,
and my patch seems to have fixed the problem.
Adding __GFP_NOWARN will mask further problems of the similar nature,
so I think we'd better avoid it.
>> use __GFP_NOWARN for stack
>>
>>
ux.kernel/2266971 in the discussion,
and my patch seems to have fixed the problem.
Adding __GFP_NOWARN will mask further problems of the similar nature,
so I think we'd better avoid it.
>> use __GFP_NOWARN for stack
>>
>> Link: http://lkml.kernel.org/r/20160720151905.gb19...@node
ts.
>
> Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
Acked-by: Alexander Potapenko <gli...@google.com>
> ---
> mm/kasan/kasan.c | 17 +
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan
ey Ryabinin
Acked-by: Alexander Potapenko
> ---
> mm/kasan/kasan.c | 17 +
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c
> index d92a7a2..b6f99e8 100644
> --- a/mm/kasan/kasan.c
> +++ b/m
.
Dmitry Vyukov has reported unexpected KASAN stackdepot growth
(https://github.com/google/kasan/issues/36), which had been caused by
the APIC handlers not being present in .irqentry.text.
Signed-off-by: Alexander Potapenko <gli...@google.com>
Reported-by: Dmitry Vyukov <dvyu...@google.co
.
Dmitry Vyukov has reported unexpected KASAN stackdepot growth
(https://github.com/google/kasan/issues/36), which had been caused by
the APIC handlers not being present in .irqentry.text.
Signed-off-by: Alexander Potapenko
Reported-by: Dmitry Vyukov
---
v2: - fixed kbuild warning (incorrect
.
Dmitry Vyukov has reported unexpected KASAN stackdepot growth
(https://github.com/google/kasan/issues/36), which had been caused by
the APIC handlers not being present in .irqentry.text.
Signed-off-by: Alexander Potapenko <gli...@google.com>
Reported-by: Dmitry Vyukov <dvyu...@google.com&g
.
Dmitry Vyukov has reported unexpected KASAN stackdepot growth
(https://github.com/google/kasan/issues/36), which had been caused by
the APIC handlers not being present in .irqentry.text.
Signed-off-by: Alexander Potapenko
Reported-by: Dmitry Vyukov
---
arch/x86/entry/entry_64.S | 11 +++
1
, when KASAN had detected an error on an object from a cache
with SLAB_RED_ZONE set, the actual start address of the object was
miscalculated, which led to random stacks having been reported.
Fixes: 7ed2f9e663854db ("mm, kasan: SLAB support")
Signed-off-by: Alexander Pota
, when KASAN had detected an error on an object from a cache
with SLAB_RED_ZONE set, the actual start address of the object was
miscalculated, which led to random stacks having been reported.
Fixes: 7ed2f9e663854db ("mm, kasan: SLAB support")
Signed-off-by: Alexander
wing commit:
>
> https://github.com/0day-ci/linux
> Alexander-Potapenko/mm-kasan-switch-SLUB-to-stackdepot-enable-memory-quarantine-for-SLUB/20160708-183858
> commit 7392becb255cd6c0e7bedaabd58f638b732772f2 ("mm, kasan: switch SLUB to
> stackdepot, enable memory quarantine fo
Andrey, Joonsoo: FYI
On Wed, Jul 13, 2016 at 10:57 AM, Alexander Potapenko <gli...@google.com> wrote:
> Hello there,
>
> I've built my kernel with the supplied config, but haven't managed to
> reproduce the failure.
> The test prints the following log:
>
> [2
s://github.com/0day-ci/linux
> Alexander-Potapenko/mm-kasan-switch-SLUB-to-stackdepot-enable-memory-quarantine-for-SLUB/20160708-183858
> commit 7392becb255cd6c0e7bedaabd58f638b732772f2 ("mm, kasan: switch SLUB to
> stackdepot, enable memory quarantine for SLUB")
>
> in tes
Andrey, Joonsoo: FYI
On Wed, Jul 13, 2016 at 10:57 AM, Alexander Potapenko wrote:
> Hello there,
>
> I've built my kernel with the supplied config, but haven't managed to
> reproduce the failure.
> The test prints the following log:
>
> [2.554919] Testing concurrent rhas
This patch set enables stackdepot and quarantine for SLUB allocator and
fixes a problem with incorrect calculating the offset of the nearest
object in the presence of SLUB red zones.
Alexander Potapenko (2):
mm, kasan: account for object redzone in SLUB's nearest_obj()
mm, kasan: switch SLUB
This patch set enables stackdepot and quarantine for SLUB allocator and
fixes a problem with incorrect calculating the offset of the nearest
object in the presence of SLUB red zones.
Alexander Potapenko (2):
mm, kasan: account for object redzone in SLUB's nearest_obj()
mm, kasan: switch SLUB
When looking up the nearest SLUB object for a given address, correctly
calculate its offset if SLAB_RED_ZONE is enabled for that cache.
Fixes: 7ed2f9e663854db ("mm, kasan: SLAB support")
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
include/linux/slub_def.h | 1
When looking up the nearest SLUB object for a given address, correctly
calculate its offset if SLAB_RED_ZONE is enabled for that cache.
Fixes: 7ed2f9e663854db ("mm, kasan: SLAB support")
Signed-off-by: Alexander Potapenko
---
include/linux/slub_def.h | 10 ++
For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko
---
v7: - addressed comments
On Mon, Jul 11, 2016 at 8:02 AM, Joonsoo Kim <iamjoonsoo@lge.com> wrote:
> On Fri, Jul 08, 2016 at 12:36:50PM +0200, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/dealloc
On Mon, Jul 11, 2016 at 8:02 AM, Joonsoo Kim wrote:
> On Fri, Jul 08, 2016 at 12:36:50PM +0200, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation stacks in the objects;
>
On Fri, Jul 8, 2016 at 5:31 PM, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote:
>
>
> On 07/08/2016 01:36 PM, Alexander Potapenko wrote:
>> On Tue, Jun 28, 2016 at 6:51 PM, Andrey Ryabinin
>> <aryabi...@virtuozzo.com> wrote:
>
>>>> *flags |=
On Fri, Jul 8, 2016 at 5:31 PM, Andrey Ryabinin wrote:
>
>
> On 07/08/2016 01:36 PM, Alexander Potapenko wrote:
>> On Tue, Jun 28, 2016 at 6:51 PM, Andrey Ryabinin
>> wrote:
>
>>>> *flags |= SLAB_KASAN;
>>>> +
>>>> /* Add a
On Fri, Jul 8, 2016 at 7:00 PM, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote:
>
>
> On 07/08/2016 01:36 PM, Alexander Potapenko wrote:
>>
>> diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
>> index d1faa01..07e4549 100644
>> --- a/include/
On Fri, Jul 8, 2016 at 7:00 PM, Andrey Ryabinin wrote:
>
>
> On 07/08/2016 01:36 PM, Alexander Potapenko wrote:
>>
>> diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
>> index d1faa01..07e4549 100644
>> --- a/include/linux/slub_def.h
>> +++
For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko
---
v6: - addressed comments
On Tue, Jun 28, 2016 at 6:51 PM, Andrey Ryabinin
<aryabi...@virtuozzo.com> wrote:
>
>
> On 06/22/2016 08:43 PM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation st
On Tue, Jun 28, 2016 at 6:51 PM, Andrey Ryabinin
wrote:
>
>
> On 06/22/2016 08:43 PM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation stacks in the objects;
>&g
:629)
> [0.00] ? _find_next_bit (lib/find_bit.c:54)
> [0.00] ? alloc_desc (kernel/irq/irqdesc.c:190)
> [0.00] early_irq_init (kernel/irq/irqdesc.c:279 (discriminator 1))
> [0.00] start_kernel (init/main.c:563)
> [0.00] ? thread_stack_cache_init (??:
Any idea which config option triggers this code path?
I don't see it with my config, and the config from kbuild doesn't boot for me.
(I'm trying to bisect the diff between them now)
On Tue, Jul 5, 2016 at 1:42 AM, Sasha Levin wrote:
> On 06/22/2016 01:43 PM, Alexander Potapenko wr
;> Reviewed-by: Dmitry Vyukov <dvyu...@google.com>
>> Signed-off-by: Joonsoo Kim <iamjoonsoo....@lge.com>
>
> Fixes: 55834c59098d ("mm: kasan: initial memory quarantine implementation")
> Acked-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
>
Acked-b
t; But, the bug looks trivial and no need to attach oops.
>>
>> v5: rename some variable for better readability
>> v4: fix cache size bug s/cache->size/obj_cache->size/
>> v3: fix build warning
>>
>> Reviewed-by: Dmitry Vyukov
>> Signed-off-by: Joonso
For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
For KASAN builds:
- switch SLUB allocator to using stackdepot instead of storing the
allocation/deallocation stacks in the objects;
- change the freelist hook so that parts of the freelist can be put
into the quarantine.
Signed-off-by: Alexander Potapenko
---
v5: - addressed comments
On Mon, Jun 20, 2016 at 9:50 PM, Sasha Levin <sasha.le...@oracle.com> wrote:
> On 06/20/2016 08:53 AM, Alexander Potapenko wrote:
>> On Sun, Jun 19, 2016 at 7:40 PM, Sasha Levin <sasha.le...@oracle.com> wrote:
>>> > On 06/19/2016 03:24 AM, Alexander
On Mon, Jun 20, 2016 at 9:50 PM, Sasha Levin wrote:
> On 06/20/2016 08:53 AM, Alexander Potapenko wrote:
>> On Sun, Jun 19, 2016 at 7:40 PM, Sasha Levin wrote:
>>> > On 06/19/2016 03:24 AM, Alexander Potapenko wrote:
>>>> >> Hi Sasha,
>>>> >
On Sun, Jun 19, 2016 at 7:40 PM, Sasha Levin <sasha.le...@oracle.com> wrote:
> On 06/19/2016 03:24 AM, Alexander Potapenko wrote:
>> Hi Sasha,
>>
>> This commit delays the reuse of memory after it has been freed, so
>> it's intended to help peopl
On Sun, Jun 19, 2016 at 7:40 PM, Sasha Levin wrote:
> On 06/19/2016 03:24 AM, Alexander Potapenko wrote:
>> Hi Sasha,
>>
>> This commit delays the reuse of memory after it has been freed, so
>> it's intended to help people find more use-after-free errors.
>
>
n't support it (e.g. via refcount as one would expect).
> Hopefully the occupied memory doesn't grow indefinitely over time then...
The existing use case (allocation/deallocation stacks for KASAN
reports) doesn't require reference counts. Introducing those would
have added unwanted contention and i
cupied memory doesn't grow indefinitely over time then...
The existing use case (allocation/deallocation stacks for KASAN
reports) doesn't require reference counts. Introducing those would
have added unwanted contention and increase memory usage.
The amount of memory used by the stack depot is bound
On Sun, Jun 19, 2016 at 7:40 PM, Sasha Levin <sasha.le...@oracle.com> wrote:
> On 06/19/2016 03:24 AM, Alexander Potapenko wrote:
>> Hi Sasha,
>>
>> This commit delays the reuse of memory after it has been freed, so
>> it's intended to help peopl
On Sun, Jun 19, 2016 at 7:40 PM, Sasha Levin wrote:
> On 06/19/2016 03:24 AM, Alexander Potapenko wrote:
>> Hi Sasha,
>>
>> This commit delays the reuse of memory after it has been freed, so
>> it's intended to help people find more use-after-free errors.
>
>
On Sat, Jun 18, 2016 at 5:32 PM, Sasha Levin <sasha.le...@oracle.com> wrote:
> On 06/17/2016 10:27 AM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation stacks i
On Sat, Jun 18, 2016 at 5:32 PM, Sasha Levin wrote:
> On 06/17/2016 10:27 AM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation stacks in the objects;
>> - define
On Fri, Jun 17, 2016 at 5:12 PM, Andrey Ryabinin
<aryabi...@virtuozzo.com> wrote:
>
>
> On 06/17/2016 05:27 PM, Alexander Potapenko wrote:
>> On Wed, Jun 15, 2016 at 6:50 PM, Andrey Ryabinin
>> <aryabi...@virtuozzo.com> wrote:
>>>
>>>
&g
On Fri, Jun 17, 2016 at 5:12 PM, Andrey Ryabinin
wrote:
>
>
> On 06/17/2016 05:27 PM, Alexander Potapenko wrote:
>> On Wed, Jun 15, 2016 at 6:50 PM, Andrey Ryabinin
>> wrote:
>>>
>>>
>>> On 06/15/2016 06:26 PM, Alexander Potapenko wrote:
>
o know when this
>> compiler feature is in use, wee pass the define via KBUILD_CFLAGS rather
>> than CFLAGS_KCOV.
>>
>> Signed-off-by: Mark Rutland <mark.rutl...@arm.com>
>> Cc: Alexander Potapenko <gli...@google.com>
>> Cc: Andrew Morton <a...@linux
RACE_PC is not defined, the kernel will
>> return -ENOTSUPP if userspace attempts to open the kcov debugfs file,
>> indicating that kcov functionality is unavailable.
>>
>> As uninstrumented files (e.g. kernel/kcov.c) need to know when this
>> compiler feature is in use, wee pass
;
- change the freelist hook so that parts of the freelist can be put into
the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
v4: - addressed comments by Andrey Ryabinin:
- don't set slub_debug by default for everyone;
- introduce the ___cache_free()
;
- change the freelist hook so that parts of the freelist can be put into
the quarantine.
Signed-off-by: Alexander Potapenko
---
v4: - addressed comments by Andrey Ryabinin:
- don't set slub_debug by default for everyone;
- introduce the ___cache_free() helper function.
v3
On Wed, Jun 15, 2016 at 6:50 PM, Andrey Ryabinin
<aryabi...@virtuozzo.com> wrote:
>
>
> On 06/15/2016 06:26 PM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation st
On Wed, Jun 15, 2016 at 6:50 PM, Andrey Ryabinin
wrote:
>
>
> On 06/15/2016 06:26 PM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation stacks in the objects;
>> -
Add ARCH_HAS_KCOV to ARM64 config. To avoid potential crashes, disable
instrumentation of the files in arch/arm64/kvm/hyp/*.
Signed-off-by: Alexander Potapenko <gli...@google.com>
Acked-by: Mark Rutland <mark.rutl...@arm.com>
Acked-by: Marc Zyngier <marc.zyng...@arm.com>
Test
Add ARCH_HAS_KCOV to ARM64 config. To avoid potential crashes, disable
instrumentation of the files in arch/arm64/kvm/hyp/*.
Signed-off-by: Alexander Potapenko
Acked-by: Mark Rutland
Acked-by: Marc Zyngier
Tested-by: James Morse
---
v4: - added ack from Marc Zyngier and Tested-by from James
On Thu, Jun 16, 2016 at 6:32 PM, Mark Rutland <mark.rutl...@arm.com> wrote:
> On Thu, Jun 16, 2016 at 05:25:31PM +0100, Catalin Marinas wrote:
>> On Thu, Jun 16, 2016 at 04:44:12PM +0100, Mark Rutland wrote:
>> > On Thu, Jun 16, 2016 at 05:20:03PM +0200, Alexander Potapen
On Thu, Jun 16, 2016 at 6:32 PM, Mark Rutland wrote:
> On Thu, Jun 16, 2016 at 05:25:31PM +0100, Catalin Marinas wrote:
>> On Thu, Jun 16, 2016 at 04:44:12PM +0100, Mark Rutland wrote:
>> > On Thu, Jun 16, 2016 at 05:20:03PM +0200, Alexander Potapenko wrote:
>> > >
On Thu, Jun 16, 2016 at 12:47 PM, James Morse <james.mo...@arm.com> wrote:
> On 15/06/16 15:25, Mark Rutland wrote:
>> On Wed, Jun 15, 2016 at 01:53:03PM +0200, Alexander Potapenko wrote:
>>> On Wed, Jun 15, 2016 at 1:44 PM, Mark Rutland <mark.rutl...@arm.com> wr
On Thu, Jun 16, 2016 at 12:47 PM, James Morse wrote:
> On 15/06/16 15:25, Mark Rutland wrote:
>> On Wed, Jun 15, 2016 at 01:53:03PM +0200, Alexander Potapenko wrote:
>>> On Wed, Jun 15, 2016 at 1:44 PM, Mark Rutland wrote:
>>>> On Wed, Jun 15, 2016 at 10:25:
On Thu, Jun 9, 2016 at 8:22 PM, Alexander Potapenko <gli...@google.com> wrote:
> On Thu, Jun 9, 2016 at 6:45 PM, Andrey Ryabinin <aryabi...@virtuozzo.com>
> wrote:
>>
>>
>> On 06/08/2016 09:40 PM, Alexander Potapenko wrote:
>>> For KASAN builds:
>
On Thu, Jun 9, 2016 at 8:22 PM, Alexander Potapenko wrote:
> On Thu, Jun 9, 2016 at 6:45 PM, Andrey Ryabinin
> wrote:
>>
>>
>> On 06/08/2016 09:40 PM, Alexander Potapenko wrote:
>>> For KASAN builds:
>>> - switch SLUB allocator to using stackdepo
;
- change the freelist hook so that parts of the freelist can be put into
the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
v3: - addressed comments by Andrey Ryabinin:
- replaced KMALLOC_MAX_CACHE_SIZE with KMALLOC_MAX_SIZE in
kasan_cache_
;
- change the freelist hook so that parts of the freelist can be put into
the quarantine.
Signed-off-by: Alexander Potapenko
---
v3: - addressed comments by Andrey Ryabinin:
- replaced KMALLOC_MAX_CACHE_SIZE with KMALLOC_MAX_SIZE in
kasan_cache_create();
- for caches
On Thu, Jun 9, 2016 at 8:22 PM, Alexander Potapenko <gli...@google.com> wrote:
> On Thu, Jun 9, 2016 at 6:45 PM, Andrey Ryabinin <aryabi...@virtuozzo.com>
> wrote:
>>
>>
>> On 06/08/2016 09:40 PM, Alexander Potapenko wrote:
>>> For KASAN builds:
>
On Thu, Jun 9, 2016 at 8:22 PM, Alexander Potapenko wrote:
> On Thu, Jun 9, 2016 at 6:45 PM, Andrey Ryabinin
> wrote:
>>
>>
>> On 06/08/2016 09:40 PM, Alexander Potapenko wrote:
>>> For KASAN builds:
>>> - switch SLUB allocator to using stackdepo
On Wed, Jun 15, 2016 at 1:44 PM, Mark Rutland <mark.rutl...@arm.com> wrote:
> On Wed, Jun 15, 2016 at 10:25:10AM +0100, Mark Rutland wrote:
>> On Tue, Jun 14, 2016 at 08:16:08PM +0200, Alexander Potapenko wrote:
>> > On Tue, Jun 14, 2016 at 7:55 PM, Mark Rutland <
On Wed, Jun 15, 2016 at 1:44 PM, Mark Rutland wrote:
> On Wed, Jun 15, 2016 at 10:25:10AM +0100, Mark Rutland wrote:
>> On Tue, Jun 14, 2016 at 08:16:08PM +0200, Alexander Potapenko wrote:
>> > On Tue, Jun 14, 2016 at 7:55 PM, Mark Rutland wrote:
>> > > I built
Add ARCH_HAS_KCOV to ARM64 config. To avoid potential crashes, disable
instrumentation of the files in arch/arm64/kvm/hyp/*.
Signed-off-by: Alexander Potapenko <gli...@google.com>
Acked-by: Mark Rutland <mark.rutl...@arm.com>
---
v3: - reverted arch/arm64/boot/Makefile, the
Add ARCH_HAS_KCOV to ARM64 config. To avoid potential crashes, disable
instrumentation of the files in arch/arm64/kvm/hyp/*.
Signed-off-by: Alexander Potapenko
Acked-by: Mark Rutland
---
v3: - reverted arch/arm64/boot/Makefile, there's no code in that dir
- added ack from Mark Rutland
v2
On Tue, Jun 14, 2016 at 7:55 PM, Mark Rutland <mark.rutl...@arm.com> wrote:
> On Tue, Jun 14, 2016 at 06:57:21PM +0200, Alexander Potapenko wrote:
>> Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
>> instrumentation of the following files:
>>
>> ar
On Tue, Jun 14, 2016 at 7:55 PM, Mark Rutland wrote:
> On Tue, Jun 14, 2016 at 06:57:21PM +0200, Alexander Potapenko wrote:
>> Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
>> instrumentation of the following files:
>>
>> arch/arm64/boot/*
>> arch
Hi all,
On Tue, Jun 14, 2016 at 6:57 PM, Alexander Potapenko <gli...@google.com> wrote:
> Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
> instrumentation of the following files:
>
> arch/arm64/boot/*
> arch/arm64/kvm/hyp/*
>
> Signed-off-by: Alexander P
Hi all,
On Tue, Jun 14, 2016 at 6:57 PM, Alexander Potapenko wrote:
> Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
> instrumentation of the following files:
>
> arch/arm64/boot/*
> arch/arm64/kvm/hyp/*
>
> Signed-off-by: Alexander Potapenko
> ---
> v2
Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
instrumentation of the following files:
arch/arm64/boot/*
arch/arm64/kvm/hyp/*
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
v2: - disable instrumentation of arch/arm64/{boot,kvm/hyp}
- enable instrumentation o
Add ARCH_HAS_KCOV to ARM64 config. To avoid crashes, disable
instrumentation of the following files:
arch/arm64/boot/*
arch/arm64/kvm/hyp/*
Signed-off-by: Alexander Potapenko
---
v2: - disable instrumentation of arch/arm64/{boot,kvm/hyp}
- enable instrumentation of arch/arm64/lib/delay.c
pr_err("==\n");
> - add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
> - spin_unlock_irqrestore(_lock, flags);
> - kasan_enable_current();
> +
> + kasan_end_report();
> +}
> +
> +void kasan_r
==\n");
> - add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
> - spin_unlock_irqrestore(_lock, flags);
> - kasan_enable_current();
> +
> + kasan_end_report();
> +}
> +
> +void kasan_report_double_free(struct
On Thu, Jun 9, 2016 at 6:45 PM, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote:
>
>
> On 06/08/2016 09:40 PM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation st
On Thu, Jun 9, 2016 at 6:45 PM, Andrey Ryabinin wrote:
>
>
> On 06/08/2016 09:40 PM, Alexander Potapenko wrote:
>> For KASAN builds:
>> - switch SLUB allocator to using stackdepot instead of storing the
>>allocation/deallocation stacks in the objects;
>> -
;
- refactor the slab freelist hook, put freed memory into the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
v2: - incorporated kbuild fixes by Andrew Morton
---
include/linux/slab.h | 9 +
include/linux/slub_def.h | 4 +++
lib/Kconfig.kasan| 4 +
;
- refactor the slab freelist hook, put freed memory into the quarantine.
Signed-off-by: Alexander Potapenko
---
v2: - incorporated kbuild fixes by Andrew Morton
---
include/linux/slab.h | 9 +
include/linux/slub_def.h | 4 +++
lib/Kconfig.kasan| 4 +--
mm/kasan/Makefile
On Thu, Jun 9, 2016 at 4:05 PM, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote:
> On 06/01/2016 07:22 PM, Andrey Ryabinin wrote:
>>
>>
>> On 06/01/2016 03:53 PM, Alexander Potapenko wrote:
>>> To avoid draining the mempools, KASAN shouldn't put the mempool e
On Thu, Jun 9, 2016 at 4:05 PM, Andrey Ryabinin wrote:
> On 06/01/2016 07:22 PM, Andrey Ryabinin wrote:
>>
>>
>> On 06/01/2016 03:53 PM, Alexander Potapenko wrote:
>>> To avoid draining the mempools, KASAN shouldn't put the mempool elements
>>>
bject_err(cache, page, object, info);
> +#else
> object_err(cache, page, object,
> "kasan: bad access detected");
> +#endif
> return;
> }
> dump_page(page, "ka
object_err(cache, page, object,
> "kasan: bad access detected");
> +#endif
> return;
> }
> dump_page(page, "kasan: bad access detected");
> diff --git a/mm/slab.c b/mm/slab.c
> index 763096a..b8c51a6 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -2611,6 +2611,7 @@ static void cache_init_objs(struct kmem_cache *cachep,
> cachep->ctor(objp);
> kasan_poison_object_data(cachep, objp);
> }
> + kasan_init_object(cachep, index_to_obj(cachep, page, i));
>
> if (!shuffled)
> set_free_obj(page, i, i);
> @@ -3508,7 +3509,7 @@ static inline void __cache_free(struct kmem_cache
> *cachep, void *objp,
> unsigned long caller)
> {
> /* Put the object into the quarantine, don't touch it for now. */
> - if (kasan_slab_free(cachep, objp))
> + if (kasan_slab_free(cachep, objp, _RET_IP_))
> return;
>
> ___cache_free(cachep, objp, caller);
> diff --git a/mm/slub.c b/mm/slub.c
> index 5beeeb2..f25c0c2 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1344,7 +1344,7 @@ static inline void slab_free_hook(struct kmem_cache *s,
> void *x)
> if (!(s->flags & SLAB_DEBUG_OBJECTS))
> debug_check_no_obj_freed(x, s->object_size);
>
> - kasan_slab_free(s, x);
> + kasan_slab_free(s, x, _RET_IP_);
> }
>
> static inline void slab_free_freelist_hook(struct kmem_cache *s,
> --
> 1.7.1
>
--
Alexander Potapenko
Software Engineer
Google Germany GmbH
Erika-Mann-Straße, 33
80636 München
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
;
- refactor the slab freelist hook, put freed memory into the quarantine.
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
include/linux/slab.h | 9 ++
include/linux/slub_def.h | 4 +++
lib/Kconfig.kasan| 4 +--
mm/kasan/Makefile| 3 +-
mm/kasan/k
;
- refactor the slab freelist hook, put freed memory into the quarantine.
Signed-off-by: Alexander Potapenko
---
include/linux/slab.h | 9 ++
include/linux/slub_def.h | 4 +++
lib/Kconfig.kasan| 4 +--
mm/kasan/Makefile| 3 +-
mm/kasan/kasan.c | 78
> static int __init kmalloc_tests_init(void)
> {
> kmalloc_oob_right();
> @@ -436,6 +479,10 @@ static int __init kmalloc_tests_init(void)
> kasan_global_oob();
> ksize_unpoisons_memory();
> copy_user_test();
> +#ifdef CONFIG_SLAB
> +
; {
> kmalloc_oob_right();
> @@ -436,6 +479,10 @@ static int __init kmalloc_tests_init(void)
> kasan_global_oob();
> ksize_unpoisons_memory();
> copy_user_test();
> +#ifdef CONFIG_SLAB
> + kasan_double_free();
> + kasan_double_free_concurrent();
&g
On Thu, Jun 2, 2016 at 2:17 PM, Andrey Ryabinin <aryabi...@virtuozzo.com> wrote:
>
>
> On 06/02/2016 03:02 PM, Alexander Potapenko wrote:
>> On Wed, Jun 1, 2016 at 6:31 PM, Alexander Potapenko <gli...@google.com>
>> wrote:
>>> On Wed, Jun 1
On Thu, Jun 2, 2016 at 2:17 PM, Andrey Ryabinin wrote:
>
>
> On 06/02/2016 03:02 PM, Alexander Potapenko wrote:
>> On Wed, Jun 1, 2016 at 6:31 PM, Alexander Potapenko
>> wrote:
>>> On Wed, Jun 1, 2016 at 5:23 PM, Andrey Ryabinin
>>> wrote:
>>&
601 - 700 of 1004 matches
Mail list logo