Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-25 Thread Will Deacon
On Mon, Aug 24, 2015 at 06:47:36PM +0100, Russell King - ARM Linux wrote: > On Mon, Aug 24, 2015 at 05:15:22PM +0300, Andrey Ryabinin wrote: > > Yes, ~130Mb (3G/1G split) should work. 512Mb shadow is optional. > > The only advantage of 512Mb shadow is better handling of user memory > > accesses

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-25 Thread Will Deacon
On Mon, Aug 24, 2015 at 06:47:36PM +0100, Russell King - ARM Linux wrote: On Mon, Aug 24, 2015 at 05:15:22PM +0300, Andrey Ryabinin wrote: Yes, ~130Mb (3G/1G split) should work. 512Mb shadow is optional. The only advantage of 512Mb shadow is better handling of user memory accesses bugs

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Russell King - ARM Linux
On Mon, Aug 24, 2015 at 05:15:22PM +0300, Andrey Ryabinin wrote: > Yes, ~130Mb (3G/1G split) should work. 512Mb shadow is optional. > The only advantage of 512Mb shadow is better handling of user memory > accesses bugs > (access to user memory without copy_from_user/copy_to_user/strlen_user etc >

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Andrey Ryabinin
2015-08-24 19:16 GMT+03:00 Vladimir Murzin : > On 24/08/15 17:00, Andrey Ryabinin wrote: >> 2015-08-24 18:44 GMT+03:00 Vladimir Murzin : >>> >>> Another option would be having "sparse" shadow memory based on page >>> extension. I did play with that some time ago based on ideas from >>> original v1

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Vladimir Murzin
On 24/08/15 17:00, Andrey Ryabinin wrote: > 2015-08-24 18:44 GMT+03:00 Vladimir Murzin : >> >> Another option would be having "sparse" shadow memory based on page >> extension. I did play with that some time ago based on ideas from >> original v1 KASan support for x86/arm - it is how 614be38

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Andrey Ryabinin
2015-08-24 18:44 GMT+03:00 Vladimir Murzin : > > Another option would be having "sparse" shadow memory based on page > extension. I did play with that some time ago based on ideas from > original v1 KASan support for x86/arm - it is how 614be38 "irqchip: > gic-v3: Fix out of bounds access to

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Vladimir Murzin
On 24/08/15 15:15, Andrey Ryabinin wrote: > 2015-08-24 16:45 GMT+03:00 Linus Walleij : >> On Mon, Aug 24, 2015 at 3:15 PM, Russell King - ARM Linux >> wrote: >>> On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin wrote:

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Andrey Ryabinin
2015-08-24 16:45 GMT+03:00 Linus Walleij : > On Mon, Aug 24, 2015 at 3:15 PM, Russell King - ARM Linux > wrote: >> On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: >>> On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin >>> wrote: >>> >>> > I used vexpress. Anyway, it doesn't matter

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Linus Walleij
On Mon, Aug 24, 2015 at 3:15 PM, Russell King - ARM Linux wrote: > On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: >> On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin >> wrote: >> >> > I used vexpress. Anyway, it doesn't matter now, since I have an update >> > with a lot of stuff

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Russell King - ARM Linux
On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: > On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin > wrote: > > > I used vexpress. Anyway, it doesn't matter now, since I have an update > > with a lot of stuff fixed, and it works on hardware. > > I still need to do some work on it

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Linus Walleij
On Wed, Aug 19, 2015 at 4:51 PM, Andrey Ryabinin wrote: > On 08/19/2015 03:14 PM, Linus Walleij wrote: >> Integrator/AP (ARMv5): >> >> This one mounted with an ARMv5 ARM926 tile. It boots nicely >> (but takes forever) with KASan and run all test cases (!) just like >> for the other platforms but

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Linus Walleij
On Mon, Aug 24, 2015 at 3:15 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: I used vexpress. Anyway, it doesn't matter now, since I have

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Linus Walleij
On Wed, Aug 19, 2015 at 4:51 PM, Andrey Ryabinin ryabinin@gmail.com wrote: On 08/19/2015 03:14 PM, Linus Walleij wrote: Integrator/AP (ARMv5): This one mounted with an ARMv5 ARM926 tile. It boots nicely (but takes forever) with KASan and run all test cases (!) just like for the other

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Russell King - ARM Linux
On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: I used vexpress. Anyway, it doesn't matter now, since I have an update with a lot of stuff fixed, and it works on hardware. I still need to do

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Andrey Ryabinin
2015-08-24 16:45 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Mon, Aug 24, 2015 at 3:15 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin a.ryabi...@samsung.com

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Andrey Ryabinin
2015-08-24 19:16 GMT+03:00 Vladimir Murzin vladimir.mur...@arm.com: On 24/08/15 17:00, Andrey Ryabinin wrote: 2015-08-24 18:44 GMT+03:00 Vladimir Murzin vladimir.mur...@arm.com: Another option would be having sparse shadow memory based on page extension. I did play with that some time ago

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Andrey Ryabinin
2015-08-24 18:44 GMT+03:00 Vladimir Murzin vladimir.mur...@arm.com: Another option would be having sparse shadow memory based on page extension. I did play with that some time ago based on ideas from original v1 KASan support for x86/arm - it is how 614be38 irqchip: gic-v3: Fix out of bounds

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Vladimir Murzin
On 24/08/15 17:00, Andrey Ryabinin wrote: 2015-08-24 18:44 GMT+03:00 Vladimir Murzin vladimir.mur...@arm.com: Another option would be having sparse shadow memory based on page extension. I did play with that some time ago based on ideas from original v1 KASan support for x86/arm - it is how

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Vladimir Murzin
On 24/08/15 15:15, Andrey Ryabinin wrote: 2015-08-24 16:45 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Mon, Aug 24, 2015 at 3:15 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Tue, Jul 21, 2015 at 11:27:56PM +0200, Linus Walleij wrote: On Tue, Jul 21, 2015 at 4:27 PM,

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-24 Thread Russell King - ARM Linux
On Mon, Aug 24, 2015 at 05:15:22PM +0300, Andrey Ryabinin wrote: Yes, ~130Mb (3G/1G split) should work. 512Mb shadow is optional. The only advantage of 512Mb shadow is better handling of user memory accesses bugs (access to user memory without copy_from_user/copy_to_user/strlen_user etc

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-19 Thread Andrey Ryabinin
On 08/19/2015 03:14 PM, Linus Walleij wrote: > On Wed, Jul 22, 2015 at 7:54 PM, Andrey Ryabinin > wrote: > >> So here is updated version: >> git://github.com/aryabinin/linux.git kasan/arm_v0_1 >> >> The code is still ugly in some places and it probably have some bugs. >> Lightly tested

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-19 Thread Linus Walleij
On Wed, Jul 22, 2015 at 7:54 PM, Andrey Ryabinin wrote: > So here is updated version: > git://github.com/aryabinin/linux.git kasan/arm_v0_1 > > The code is still ugly in some places and it probably have some bugs. > Lightly tested on exynos 5410/5420. I compiled this for various ARM

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-19 Thread Linus Walleij
On Wed, Jul 22, 2015 at 7:54 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: So here is updated version: git://github.com/aryabinin/linux.git kasan/arm_v0_1 The code is still ugly in some places and it probably have some bugs. Lightly tested on exynos 5410/5420. I compiled this

Re: [PATCH v2 5/5] arm64: add KASan support

2015-08-19 Thread Andrey Ryabinin
On 08/19/2015 03:14 PM, Linus Walleij wrote: On Wed, Jul 22, 2015 at 7:54 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: So here is updated version: git://github.com/aryabinin/linux.git kasan/arm_v0_1 The code is still ugly in some places and it probably have some bugs.

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-22 Thread Andrey Ryabinin
On 07/22/2015 12:27 AM, Linus Walleij wrote: > On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin > wrote: > >> I used vexpress. Anyway, it doesn't matter now, since I have an update >> with a lot of stuff fixed, and it works on hardware. >> I still need to do some work on it and tomorrow,

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-22 Thread Andrey Ryabinin
On 07/22/2015 12:27 AM, Linus Walleij wrote: On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: I used vexpress. Anyway, it doesn't matter now, since I have an update with a lot of stuff fixed, and it works on hardware. I still need to do some work on it and

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-21 Thread Linus Walleij
On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin wrote: > I used vexpress. Anyway, it doesn't matter now, since I have an update > with a lot of stuff fixed, and it works on hardware. > I still need to do some work on it and tomorrow, probably, I will share. Ah awesome. I have a stash of ARM

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-21 Thread Andrey Ryabinin
On 07/21/2015 01:36 PM, Linus Walleij wrote: > On Wed, Jun 17, 2015 at 11:32 PM, Andrey Ryabinin > wrote: >> 2015-06-13 18:25 GMT+03:00 Linus Walleij : >>> >>> On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin >>> wrote: 2015-06-11 16:39 GMT+03:00 Linus Walleij : > On Fri, May 15, 2015

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-21 Thread Linus Walleij
On Wed, Jun 17, 2015 at 11:32 PM, Andrey Ryabinin wrote: > 2015-06-13 18:25 GMT+03:00 Linus Walleij : >> >> On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin >> wrote: >> > 2015-06-11 16:39 GMT+03:00 Linus Walleij : >> >> On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin >> >> wrote: >> >> >>

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-21 Thread Linus Walleij
On Tue, Jul 21, 2015 at 4:27 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: I used vexpress. Anyway, it doesn't matter now, since I have an update with a lot of stuff fixed, and it works on hardware. I still need to do some work on it and tomorrow, probably, I will share. Ah awesome. I

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-21 Thread Linus Walleij
On Wed, Jun 17, 2015 at 11:32 PM, Andrey Ryabinin ryabinin@gmail.com wrote: 2015-06-13 18:25 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin ryabinin@gmail.com wrote: 2015-06-11 16:39 GMT+03:00 Linus Walleij

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-21 Thread Andrey Ryabinin
On 07/21/2015 01:36 PM, Linus Walleij wrote: On Wed, Jun 17, 2015 at 11:32 PM, Andrey Ryabinin ryabinin@gmail.com wrote: 2015-06-13 18:25 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin ryabinin@gmail.com wrote: 2015-06-11 16:39

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-17 Thread Andrey Ryabinin
On 07/16/2015 07:03 PM, Catalin Marinas wrote: > On Thu, Jul 16, 2015 at 06:30:11PM +0300, Andrey Ryabinin wrote: >> >> I think this may work, if pud_none(*pud) will be replaced with >> !pud_val(*pud). >> We can't use pud_none() because with 2-level page tables it's always false, >> so >> we

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-17 Thread Andrey Ryabinin
On 07/16/2015 07:03 PM, Catalin Marinas wrote: On Thu, Jul 16, 2015 at 06:30:11PM +0300, Andrey Ryabinin wrote: I think this may work, if pud_none(*pud) will be replaced with !pud_val(*pud). We can't use pud_none() because with 2-level page tables it's always false, so we will never go

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-16 Thread Catalin Marinas
On Thu, Jul 16, 2015 at 06:30:11PM +0300, Andrey Ryabinin wrote: > On 07/15/2015 07:37 PM, Catalin Marinas wrote: > > Ok, so simply taking the call out of the loop won't work unless we > > conditionally define these functions (wouldn't be too bad since we have > > some #if CONFIG_PGTABLE_LEVELS

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-16 Thread Andrey Ryabinin
On 07/15/2015 07:37 PM, Catalin Marinas wrote: > Ok, so simply taking the call out of the loop won't work unless we > conditionally define these functions (wouldn't be too bad since we have > some #if CONFIG_PGTABLE_LEVELS already introduced by this patch but it > would be nicer without). > >

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-16 Thread Andrey Ryabinin
On 07/15/2015 07:37 PM, Catalin Marinas wrote: Ok, so simply taking the call out of the loop won't work unless we conditionally define these functions (wouldn't be too bad since we have some #if CONFIG_PGTABLE_LEVELS already introduced by this patch but it would be nicer without). Anyway, I

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-16 Thread Catalin Marinas
On Thu, Jul 16, 2015 at 06:30:11PM +0300, Andrey Ryabinin wrote: On 07/15/2015 07:37 PM, Catalin Marinas wrote: Ok, so simply taking the call out of the loop won't work unless we conditionally define these functions (wouldn't be too bad since we have some #if CONFIG_PGTABLE_LEVELS already

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-15 Thread Catalin Marinas
On Wed, Jul 15, 2015 at 11:55:20AM +0300, Andrey Ryabinin wrote: > On 07/14/2015 06:04 PM, Catalin Marinas wrote: > > On Fri, Jul 10, 2015 at 08:11:03PM +0300, Andrey Ryabinin wrote: > >>> kasan_early_pte_populate(); > >>> kasan_early_pmd_populate(..., pte); > >>>

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-15 Thread Andrey Ryabinin
On 07/14/2015 06:04 PM, Catalin Marinas wrote: > On Fri, Jul 10, 2015 at 08:11:03PM +0300, Andrey Ryabinin wrote: +#if CONFIG_PGTABLE_LEVELS > 3 +pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss; +#endif +#if CONFIG_PGTABLE_LEVELS > 2 +pmd_t

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-15 Thread Andrey Ryabinin
On 07/14/2015 06:04 PM, Catalin Marinas wrote: On Fri, Jul 10, 2015 at 08:11:03PM +0300, Andrey Ryabinin wrote: +#if CONFIG_PGTABLE_LEVELS 3 +pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss; +#endif +#if CONFIG_PGTABLE_LEVELS 2 +pmd_t kasan_zero_pmd[PTRS_PER_PMD] __page_aligned_bss;

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-15 Thread Catalin Marinas
On Wed, Jul 15, 2015 at 11:55:20AM +0300, Andrey Ryabinin wrote: On 07/14/2015 06:04 PM, Catalin Marinas wrote: On Fri, Jul 10, 2015 at 08:11:03PM +0300, Andrey Ryabinin wrote: kasan_early_pte_populate(); kasan_early_pmd_populate(..., pte); kasan_early_pud_populate(..., pmd);

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-14 Thread Catalin Marinas
On Fri, Jul 10, 2015 at 08:11:03PM +0300, Andrey Ryabinin wrote: > >> +#if CONFIG_PGTABLE_LEVELS > 3 > >> +pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss; > >> +#endif > >> +#if CONFIG_PGTABLE_LEVELS > 2 > >> +pmd_t kasan_zero_pmd[PTRS_PER_PMD] __page_aligned_bss; > >> +#endif > >> +pte_t

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-14 Thread Catalin Marinas
On Fri, Jul 10, 2015 at 08:11:03PM +0300, Andrey Ryabinin wrote: +#if CONFIG_PGTABLE_LEVELS 3 +pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss; +#endif +#if CONFIG_PGTABLE_LEVELS 2 +pmd_t kasan_zero_pmd[PTRS_PER_PMD] __page_aligned_bss; +#endif +pte_t

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-10 Thread Andrey Ryabinin
>> select HAVE_ARCH_KGDB >> select HAVE_ARCH_SECCOMP_FILTER >> select HAVE_ARCH_TRACEHOOK >> @@ -119,6 +120,12 @@ config GENERIC_CSUM >> config GENERIC_CALIBRATE_DELAY >> def_bool y >> >> +config KASAN_SHADOW_OFFSET >> +hex >> +default 0xdfff2000 if

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-10 Thread Andrey Ryabinin
select HAVE_ARCH_KGDB select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_TRACEHOOK @@ -119,6 +120,12 @@ config GENERIC_CSUM config GENERIC_CALIBRATE_DELAY def_bool y +config KASAN_SHADOW_OFFSET +hex +default 0xdfff2000 if ARM64_VA_BITS_48 +

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-08 Thread Catalin Marinas
On Fri, May 15, 2015 at 04:59:04PM +0300, Andrey Ryabinin wrote: > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 7796af4..4cc73cc 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -44,6 +44,7 @@ config ARM64 > select HAVE_ARCH_AUDITSYSCALL > select

Re: [PATCH v2 5/5] arm64: add KASan support

2015-07-08 Thread Catalin Marinas
On Fri, May 15, 2015 at 04:59:04PM +0300, Andrey Ryabinin wrote: diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7796af4..4cc73cc 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -44,6 +44,7 @@ config ARM64 select HAVE_ARCH_AUDITSYSCALL select

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-17 Thread Andrey Ryabinin
2015-06-13 18:25 GMT+03:00 Linus Walleij : > > On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin > wrote: > > 2015-06-11 16:39 GMT+03:00 Linus Walleij : > >> On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin > >> wrote: > >> > >>> This patch adds arch specific code for kernel address sanitizer >

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-17 Thread Andrey Ryabinin
2015-06-13 18:25 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin ryabinin@gmail.com wrote: 2015-06-11 16:39 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin a.ryabi...@samsung.com

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-13 Thread Linus Walleij
On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin wrote: > 2015-06-11 16:39 GMT+03:00 Linus Walleij : >> On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin >> wrote: >> >>> This patch adds arch specific code for kernel address sanitizer >>> (see Documentation/kasan.txt). >> >> I looked closer at

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-13 Thread Linus Walleij
On Fri, Jun 12, 2015 at 8:14 PM, Andrey Ryabinin ryabinin@gmail.com wrote: 2015-06-11 16:39 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: This patch adds arch specific code for kernel address sanitizer

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-12 Thread Andrey Ryabinin
2015-06-11 16:39 GMT+03:00 Linus Walleij : > On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin > wrote: > >> This patch adds arch specific code for kernel address sanitizer >> (see Documentation/kasan.txt). > > I looked closer at this again ... I am trying to get KASan up for > ARM(32) with some

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-12 Thread Andrey Ryabinin
2015-06-11 16:39 GMT+03:00 Linus Walleij linus.wall...@linaro.org: On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: This patch adds arch specific code for kernel address sanitizer (see Documentation/kasan.txt). I looked closer at this again ... I am trying to

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-11 Thread Linus Walleij
On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin wrote: > This patch adds arch specific code for kernel address sanitizer > (see Documentation/kasan.txt). I looked closer at this again ... I am trying to get KASan up for ARM(32) with some tricks and hacks. > +config KASAN_SHADOW_OFFSET > +

Re: [PATCH v2 5/5] arm64: add KASan support

2015-06-11 Thread Linus Walleij
On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: This patch adds arch specific code for kernel address sanitizer (see Documentation/kasan.txt). I looked closer at this again ... I am trying to get KASan up for ARM(32) with some tricks and hacks. +config

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-27 Thread Linus Walleij
On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin wrote: > This patch adds arch specific code for kernel address sanitizer > (see Documentation/kasan.txt). OK fixed a newer GCC (4.9.3, so still just KASAN_OUTLINE), compiled and booted on the ARM Juno Development System: kasan test:

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-27 Thread Linus Walleij
On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: This patch adds arch specific code for kernel address sanitizer (see Documentation/kasan.txt). OK fixed a newer GCC (4.9.3, so still just KASAN_OUTLINE), compiled and booted on the ARM Juno Development System:

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Linus Walleij
On Tue, May 26, 2015 at 4:22 PM, Andrey Ryabinin wrote: > On 05/26/2015 05:12 PM, Andrey Ryabinin wrote: >> On 05/26/2015 04:35 PM, Linus Walleij wrote: >>> I wonder were the problem lies, any hints where to start looking >>> to fix this? >>> >> >> I suspect that your compiler lack

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Andrey Ryabinin
On 05/26/2015 05:12 PM, Andrey Ryabinin wrote: > On 05/26/2015 04:35 PM, Linus Walleij wrote: >> I wonder were the problem lies, any hints where to start looking >> to fix this? >> > > I suspect that your compiler lack -fsantize=kernel-address support. > It seems that GCC 4.9.2 doesn't supports

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Andrey Ryabinin
On 05/26/2015 04:35 PM, Linus Walleij wrote: > On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin > wrote: > > And then at boot I just get this: > > kasan test: kmalloc_oob_right out-of-bounds to right > kasan test: kmalloc_oob_left out-of-bounds to left > kasan test: kmalloc_node_oob_right

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Linus Walleij
On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin wrote: > This patch adds arch specific code for kernel address sanitizer > (see Documentation/kasan.txt). I'm trying to test this on the Juno hardware (39 VA bits). I get this at boot: Virtual kernel memory layout: kasan :

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Linus Walleij
On Tue, May 26, 2015 at 4:22 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: On 05/26/2015 05:12 PM, Andrey Ryabinin wrote: On 05/26/2015 04:35 PM, Linus Walleij wrote: I wonder were the problem lies, any hints where to start looking to fix this? I suspect that your compiler lack

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Linus Walleij
On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: This patch adds arch specific code for kernel address sanitizer (see Documentation/kasan.txt). I'm trying to test this on the Juno hardware (39 VA bits). I get this at boot: Virtual kernel memory layout: kasan

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Andrey Ryabinin
On 05/26/2015 05:12 PM, Andrey Ryabinin wrote: On 05/26/2015 04:35 PM, Linus Walleij wrote: I wonder were the problem lies, any hints where to start looking to fix this? I suspect that your compiler lack -fsantize=kernel-address support. It seems that GCC 4.9.2 doesn't supports

Re: [PATCH v2 5/5] arm64: add KASan support

2015-05-26 Thread Andrey Ryabinin
On 05/26/2015 04:35 PM, Linus Walleij wrote: On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin a.ryabi...@samsung.com wrote: And then at boot I just get this: kasan test: kmalloc_oob_right out-of-bounds to right kasan test: kmalloc_oob_left out-of-bounds to left kasan test:

[PATCH v2 5/5] arm64: add KASan support

2015-05-15 Thread Andrey Ryabinin
This patch adds arch specific code for kernel address sanitizer (see Documentation/kasan.txt). 1/8 of kernel addresses reserved for shadow memory. There was no big enough hole for this, so virtual addresses for shadow were stolen from vmalloc area. At early boot stage the whole shadow region

[PATCH v2 5/5] arm64: add KASan support

2015-05-15 Thread Andrey Ryabinin
This patch adds arch specific code for kernel address sanitizer (see Documentation/kasan.txt). 1/8 of kernel addresses reserved for shadow memory. There was no big enough hole for this, so virtual addresses for shadow were stolen from vmalloc area. At early boot stage the whole shadow region