Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-27 Thread Andrey Ryabinin
On 02/26/2015 04:30 AM, Rusty Russell wrote: > Andrey Ryabinin writes: >> On 02/25/2015 09:25 AM, Rusty Russell wrote: >>> Andrey Ryabinin writes: On 02/23/2015 11:26 AM, Rusty Russell wrote: > Andrey Ryabinin writes: >> On 02/20/2015 03:15 AM, Rusty Russell wrote: >>> Andrey

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-27 Thread Andrey Ryabinin
On 02/26/2015 04:30 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/25/2015 09:25 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/23/2015 11:26 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/20/2015

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-25 Thread Rusty Russell
Andrey Ryabinin writes: > On 02/25/2015 09:25 AM, Rusty Russell wrote: >> Andrey Ryabinin writes: >>> On 02/23/2015 11:26 AM, Rusty Russell wrote: Andrey Ryabinin writes: > On 02/20/2015 03:15 AM, Rusty Russell wrote: >> Andrey Ryabinin writes: >>> On 02/19/2015 02:10 AM,

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-25 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/25/2015 09:25 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/23/2015 11:26 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/20/2015 03:15 AM, Rusty Russell wrote: Andrey Ryabinin

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-24 Thread Andrey Ryabinin
On 02/25/2015 09:25 AM, Rusty Russell wrote: > Andrey Ryabinin writes: >> On 02/23/2015 11:26 AM, Rusty Russell wrote: >>> Andrey Ryabinin writes: On 02/20/2015 03:15 AM, Rusty Russell wrote: > Andrey Ryabinin writes: >> On 02/19/2015 02:10 AM, Rusty Russell wrote: >>> This is

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-24 Thread Rusty Russell
Andrey Ryabinin writes: > On 02/23/2015 11:26 AM, Rusty Russell wrote: >> Andrey Ryabinin writes: >>> On 02/20/2015 03:15 AM, Rusty Russell wrote: Andrey Ryabinin writes: > On 02/19/2015 02:10 AM, Rusty Russell wrote: >> This is not portable. Other archs don't use vmalloc, or

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-24 Thread Andrey Ryabinin
On 02/23/2015 11:26 AM, Rusty Russell wrote: > Andrey Ryabinin writes: >> On 02/20/2015 03:15 AM, Rusty Russell wrote: >>> Andrey Ryabinin writes: On 02/19/2015 02:10 AM, Rusty Russell wrote: > This is not portable. Other archs don't use vmalloc, or don't use > (or define)

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-24 Thread Andrey Ryabinin
On 02/23/2015 11:26 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/20/2015 03:15 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/19/2015 02:10 AM, Rusty Russell wrote: This is not portable. Other archs don't use vmalloc, or don't

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-24 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/23/2015 11:26 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/20/2015 03:15 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/19/2015 02:10 AM, Rusty Russell wrote: This is not

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-24 Thread Andrey Ryabinin
On 02/25/2015 09:25 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/23/2015 11:26 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/20/2015 03:15 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/19/2015

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-23 Thread Rusty Russell
Andrey Ryabinin writes: > On 02/20/2015 03:15 AM, Rusty Russell wrote: >> Andrey Ryabinin writes: >>> On 02/19/2015 02:10 AM, Rusty Russell wrote: This is not portable. Other archs don't use vmalloc, or don't use (or define) MODULES_VADDR. If you really want to hook here, you'd

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-23 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/20/2015 03:15 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/19/2015 02:10 AM, Rusty Russell wrote: This is not portable. Other archs don't use vmalloc, or don't use (or define) MODULES_VADDR. If you really

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Andrey Ryabinin
On 02/20/2015 03:15 AM, Rusty Russell wrote: > Andrey Ryabinin writes: >> On 02/19/2015 02:10 AM, Rusty Russell wrote: >>> This is not portable. Other archs don't use vmalloc, or don't use >>> (or define) MODULES_VADDR. If you really want to hook here, you'd >>> need a new flag (or maybe use

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Rusty Russell
Andrey Ryabinin writes: > On 02/19/2015 02:10 AM, Rusty Russell wrote: >> This is not portable. Other archs don't use vmalloc, or don't use >> (or define) MODULES_VADDR. If you really want to hook here, you'd >> need a new flag (or maybe use PAGE_KERNEL_EXEC after an audit). >> > > Well,

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Andrey Ryabinin
On 02/19/2015 02:10 AM, Rusty Russell wrote: > Andrey Ryabinin writes: >> Current approach in handling shadow memory for modules is broken. >> >> Shadow memory could be freed only after memory shadow corresponds >> it is no longer used. >> vfree() called from interrupt context could use memory

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Andrey Ryabinin
On 02/19/2015 02:10 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: Current approach in handling shadow memory for modules is broken. Shadow memory could be freed only after memory shadow corresponds it is no longer used. vfree() called from interrupt context could

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Andrey Ryabinin
On 02/20/2015 03:15 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/19/2015 02:10 AM, Rusty Russell wrote: This is not portable. Other archs don't use vmalloc, or don't use (or define) MODULES_VADDR. If you really want to hook here, you'd need a new flag (or

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/19/2015 02:10 AM, Rusty Russell wrote: This is not portable. Other archs don't use vmalloc, or don't use (or define) MODULES_VADDR. If you really want to hook here, you'd need a new flag (or maybe use PAGE_KERNEL_EXEC after an audit).

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-18 Thread Rusty Russell
Andrey Ryabinin writes: > Current approach in handling shadow memory for modules is broken. > > Shadow memory could be freed only after memory shadow corresponds > it is no longer used. > vfree() called from interrupt context could use memory its > freeing to store 'struct llist_node' in it: > >

[PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-18 Thread Andrey Ryabinin
Current approach in handling shadow memory for modules is broken. Shadow memory could be freed only after memory shadow corresponds it is no longer used. vfree() called from interrupt context could use memory its freeing to store 'struct llist_node' in it: void vfree(const void *addr) { ...

[PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-18 Thread Andrey Ryabinin
Current approach in handling shadow memory for modules is broken. Shadow memory could be freed only after memory shadow corresponds it is no longer used. vfree() called from interrupt context could use memory its freeing to store 'struct llist_node' in it: void vfree(const void *addr) { ...

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-18 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: Current approach in handling shadow memory for modules is broken. Shadow memory could be freed only after memory shadow corresponds it is no longer used. vfree() called from interrupt context could use memory its freeing to store 'struct