Re: [PATCH v2] kasan, slub: fix handling of kasan_slab_free hook

2018-03-07 Thread Andrey Ryabinin
s, whose >reuse must be delayed. > > Signed-off-by: Andrey Konovalov > --- Acked-by: Andrey Ryabinin

Re: [PATCH 4.4 163/193] kasan: rework Kconfig settings

2018-03-06 Thread Andrey Ryabinin
On 03/06/2018 05:29 PM, Ben Hutchings wrote: > On Fri, 2018-02-23 at 19:26 +0100, Greg Kroah-Hartman wrote: >> 4.4-stable review patch.  If anyone has any objections, please let me know. >> >> -- >> >> From: Arnd Bergmann >> >> commit

Re: [PATCH 4.4 163/193] kasan: rework Kconfig settings

2018-03-06 Thread Andrey Ryabinin
On 03/06/2018 05:29 PM, Ben Hutchings wrote: > On Fri, 2018-02-23 at 19:26 +0100, Greg Kroah-Hartman wrote: >> 4.4-stable review patch.  If anyone has any objections, please let me know. >> >> -- >> >> From: Arnd Bergmann >> >> commit e7c52b84fb18f08ce49b6067ae6285aca79084a8

Re: [PATCH 1/2] kasan: fix invalid-free test crashing the kernel

2018-03-02 Thread Andrey Ryabinin
ng destroyed. Fix this by calling kmem_cache_free with > the proper object address after the call that triggers invalid-free. > > Signed-off-by: Andrey Konovalov <andreyk...@google.com> Acked-by: Andrey Ryabinin <aryabi...@virtuozzo.com>

Re: [PATCH 1/2] kasan: fix invalid-free test crashing the kernel

2018-03-02 Thread Andrey Ryabinin
ng destroyed. Fix this by calling kmem_cache_free with > the proper object address after the call that triggers invalid-free. > > Signed-off-by: Andrey Konovalov Acked-by: Andrey Ryabinin

Re: [PATCH 2/2] kasan: disallow compiler to optimize away memset in tests

2018-03-02 Thread Andrey Ryabinin
> The solution is to add -fno-builtin flag to test_kasan.ko > > Signed-off-by: Andrey Konovalov <andreyk...@google.com> Acked-by: Andrey Ryabinin <aryabi...@virtuozzo.com>

Re: [PATCH 2/2] kasan: disallow compiler to optimize away memset in tests

2018-03-02 Thread Andrey Ryabinin
> The solution is to add -fno-builtin flag to test_kasan.ko > > Signed-off-by: Andrey Konovalov Acked-by: Andrey Ryabinin

Re: [PATCH] kasan, slub: fix handling of kasan_slab_free hook

2018-03-02 Thread Andrey Ryabinin
On 02/23/2018 06:53 PM, Andrey Konovalov wrote: > The kasan_slab_free hook's return value denotes whether the reuse of a > slab object must be delayed (e.g. when the object is put into memory > qurantine). > > The current way SLUB handles this hook is by ignoring its return value > and hardcoding

Re: [PATCH] kasan, slub: fix handling of kasan_slab_free hook

2018-03-02 Thread Andrey Ryabinin
On 02/23/2018 06:53 PM, Andrey Konovalov wrote: > The kasan_slab_free hook's return value denotes whether the reuse of a > slab object must be delayed (e.g. when the object is put into memory > qurantine). > > The current way SLUB handles this hook is by ignoring its return value > and hardcoding

Re: [tip:x86/mm] x86/mm: Consider effective protection attributes in W+X check

2018-02-26 Thread Andrey Ryabinin
On 02/26/2018 01:54 PM, Jan Beulich wrote: On 26.02.18 at 11:47, wrote: > >> >> On 02/26/2018 01:08 PM, Jan Beulich wrote: >> On 26.02.18 at 11:00, wrote: On 02/26/2018 11:48 AM, tip-bot for Jan Beulich wrote: > @@ -351,7

Re: [tip:x86/mm] x86/mm: Consider effective protection attributes in W+X check

2018-02-26 Thread Andrey Ryabinin
On 02/26/2018 01:54 PM, Jan Beulich wrote: On 26.02.18 at 11:47, wrote: > >> >> On 02/26/2018 01:08 PM, Jan Beulich wrote: >> On 26.02.18 at 11:00, wrote: On 02/26/2018 11:48 AM, tip-bot for Jan Beulich wrote: > @@ -351,7 +362,7 @@ static inline bool kasan_page_table(struct

Re: [tip:x86/mm] x86/mm: Consider effective protection attributes in W+X check

2018-02-26 Thread Andrey Ryabinin
On 02/26/2018 01:08 PM, Jan Beulich wrote: On 26.02.18 at 11:00, wrote: >> On 02/26/2018 11:48 AM, tip-bot for Jan Beulich wrote: >>> @@ -351,7 +362,7 @@ static inline bool kasan_page_table(struct seq_file *m, >>> struct pg_state *st, >>>

Re: [tip:x86/mm] x86/mm: Consider effective protection attributes in W+X check

2018-02-26 Thread Andrey Ryabinin
On 02/26/2018 01:08 PM, Jan Beulich wrote: On 26.02.18 at 11:00, wrote: >> On 02/26/2018 11:48 AM, tip-bot for Jan Beulich wrote: >>> @@ -351,7 +362,7 @@ static inline bool kasan_page_table(struct seq_file *m, >>> struct pg_state *st, >>> (pgtable_l5_enabled && __pa(pt) ==

Re: [tip:x86/mm] x86/mm: Consider effective protection attributes in W+X check

2018-02-26 Thread Andrey Ryabinin
On 02/26/2018 11:48 AM, tip-bot for Jan Beulich wrote: > static void note_page(struct seq_file *m, struct pg_state *st, > - pgprot_t new_prot, int level) > + pgprot_t new_prot, pgprotval_t new_eff, int level) > { > - pgprotval_t prot, cur; > +

Re: [tip:x86/mm] x86/mm: Consider effective protection attributes in W+X check

2018-02-26 Thread Andrey Ryabinin
On 02/26/2018 11:48 AM, tip-bot for Jan Beulich wrote: > static void note_page(struct seq_file *m, struct pg_state *st, > - pgprot_t new_prot, int level) > + pgprot_t new_prot, pgprotval_t new_eff, int level) > { > - pgprotval_t prot, cur; > +

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/22/2018 06:44 PM, Michal Hocko wrote: > On Thu 22-02-18 18:38:11, Andrey Ryabinin wrote: >>>> >>>> with the patch: >>>> best: 1.04 secs, 9.7G reclaimed >>>> worst: 2.2 secs, 16G reclaimed. >>>> >>>> with

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/22/2018 06:44 PM, Michal Hocko wrote: > On Thu 22-02-18 18:38:11, Andrey Ryabinin wrote: >>>> >>>> with the patch: >>>> best: 1.04 secs, 9.7G reclaimed >>>> worst: 2.2 secs, 16G reclaimed. >>>> >>>> with

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/22/2018 06:33 PM, Michal Hocko wrote: > On Thu 22-02-18 18:13:11, Andrey Ryabinin wrote: >> >> >> On 02/22/2018 05:09 PM, Michal Hocko wrote: >>> On Thu 22-02-18 16:50:33, Andrey Ryabinin wrote: >>>> On 02/21/2018 11:17 PM, Andrew Morton wrote

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/22/2018 06:33 PM, Michal Hocko wrote: > On Thu 22-02-18 18:13:11, Andrey Ryabinin wrote: >> >> >> On 02/22/2018 05:09 PM, Michal Hocko wrote: >>> On Thu 22-02-18 16:50:33, Andrey Ryabinin wrote: >>>> On 02/21/2018 11:17 PM, Andrew Morton wrote

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/22/2018 05:09 PM, Michal Hocko wrote: > On Thu 22-02-18 16:50:33, Andrey Ryabinin wrote: >> On 02/21/2018 11:17 PM, Andrew Morton wrote: >>> On Fri, 19 Jan 2018 16:11:18 +0100 Michal Hocko <mho...@kernel.org> wrote: >>> >>>> And to be honest,

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/22/2018 05:09 PM, Michal Hocko wrote: > On Thu 22-02-18 16:50:33, Andrey Ryabinin wrote: >> On 02/21/2018 11:17 PM, Andrew Morton wrote: >>> On Fri, 19 Jan 2018 16:11:18 +0100 Michal Hocko wrote: >>> >>>> And to be honest, I do n

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/21/2018 11:17 PM, Andrew Morton wrote: > On Fri, 19 Jan 2018 16:11:18 +0100 Michal Hocko wrote: > >> And to be honest, I do not really see why keeping retrying from >> mem_cgroup_resize_limit should be so much faster than keep retrying from >> the direct reclaim path. We

Re: [PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-02-22 Thread Andrey Ryabinin
On 02/21/2018 11:17 PM, Andrew Morton wrote: > On Fri, 19 Jan 2018 16:11:18 +0100 Michal Hocko wrote: > >> And to be honest, I do not really see why keeping retrying from >> mem_cgroup_resize_limit should be so much faster than keep retrying from >> the direct reclaim path. We are doing

Re: [PATCH 1/4] vmalloc: add vm_flags argument to internal __vmalloc_node()

2018-02-21 Thread Andrey Ryabinin
On 02/21/2018 03:24 PM, Matthew Wilcox wrote: > On Tue, Jan 23, 2018 at 01:55:22PM +0300, Konstantin Khlebnikov wrote: >> This allows to set VM_USERMAP in vmalloc_user() and vmalloc_32_user() >> directly at allocation and avoid find_vm_area() call. > > While reviewing this patch, I came across

Re: [PATCH 1/4] vmalloc: add vm_flags argument to internal __vmalloc_node()

2018-02-21 Thread Andrey Ryabinin
On 02/21/2018 03:24 PM, Matthew Wilcox wrote: > On Tue, Jan 23, 2018 at 01:55:22PM +0300, Konstantin Khlebnikov wrote: >> This allows to set VM_USERMAP in vmalloc_user() and vmalloc_32_user() >> directly at allocation and avoid find_vm_area() call. > > While reviewing this patch, I came across

[PATCH] platform/x86: wmi: fix off-by-one write in wmi_dev_probe()

2018-02-14 Thread Andrey Ryabinin
allocation size to fix this. Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers") Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> Cc: <sta...@vger.kernel.org> --- drivers/platform/x86/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] platform/x86: wmi: fix off-by-one write in wmi_dev_probe()

2018-02-14 Thread Andrey Ryabinin
allocation size to fix this. Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers") Signed-off-by: Andrey Ryabinin Cc: --- drivers/platform/x86/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform

Re: INFO: task hung in sync_blockdev

2018-02-09 Thread Andrey Ryabinin
On 02/08/2018 08:17 PM, Dmitry Vyukov wrote: > On Thu, Feb 8, 2018 at 5:23 PM, Andrey Ryabinin <aryabi...@virtuozzo.com> > wrote: >> >> >> On 02/08/2018 07:18 PM, Jan Kara wrote: >> >>>> By "full kernel crashdump" you mean kdump thing

Re: INFO: task hung in sync_blockdev

2018-02-09 Thread Andrey Ryabinin
On 02/08/2018 08:17 PM, Dmitry Vyukov wrote: > On Thu, Feb 8, 2018 at 5:23 PM, Andrey Ryabinin > wrote: >> >> >> On 02/08/2018 07:18 PM, Jan Kara wrote: >> >>>> By "full kernel crashdump" you mean kdump thing, or something else? >

Re: INFO: task hung in sync_blockdev

2018-02-08 Thread Andrey Ryabinin
On 02/08/2018 07:18 PM, Jan Kara wrote: >> By "full kernel crashdump" you mean kdump thing, or something else? > > Yes, the kdump thing (for KVM guest you can grab the memory dump also from > the host in a simplier way and it should be usable with the crash utility > AFAIK). > In QEMU

Re: INFO: task hung in sync_blockdev

2018-02-08 Thread Andrey Ryabinin
On 02/08/2018 07:18 PM, Jan Kara wrote: >> By "full kernel crashdump" you mean kdump thing, or something else? > > Yes, the kdump thing (for KVM guest you can grab the memory dump also from > the host in a simplier way and it should be usable with the crash utility > AFAIK). > In QEMU

Re: [PATCH] UBSAN: support __ubsan_handle_type_mismatch_v1

2018-02-08 Thread Andrey Ryabinin
ark Rutland <mark.rutl...@arm.com> > Cc: Andrew Morton <a...@linux-foundation.org> > Cc: Andrey Ryabinin <aryabi...@virtuozzo.com> > --- > lib/ubsan.c | 14 ++ > lib/ubsan.h | 7 +++ > 2 files changed, 21 insertions(+) > > Andrey, does this l

Re: [PATCH] UBSAN: support __ubsan_handle_type_mismatch_v1

2018-02-08 Thread Andrey Ryabinin
iled with compilers using the new ABI (e.g. clang > form the LLVM 5.0.0 release). > > This patch adds support for the new ABI. To keep things simple, we > simply convert the new data format into the old format, and hand it on > to the existing handlers. > > Signed-off-by: Ma

Re: [PATCH] kasan: remove redundant initialization of variable 'real_size'

2018-02-06 Thread Andrey Ryabinin
gt; Cleans up clang warning: > lib/test_kasan.c:422:21: warning: Value stored to 'real_size' during > its initialization is never read > > Signed-off-by: Colin Ian King <colin.k...@canonical.com> Acked-by: Andrey Ryabinin <aryabi...@virtuozzo.com> > --- > lib/test_kas

Re: [PATCH] kasan: remove redundant initialization of variable 'real_size'

2018-02-06 Thread Andrey Ryabinin
lib/test_kasan.c:422:21: warning: Value stored to 'real_size' during > its initialization is never read > > Signed-off-by: Colin Ian King Acked-by: Andrey Ryabinin > --- > lib/test_kasan.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --g

Re: [PATCH] ubsan: don't mark __ubsan_handle_builtin_unreachable as noreturn

2018-02-05 Thread Andrey Ryabinin
On 02/05/2018 01:15 PM, Arnd Bergmann wrote: > On Mon, Feb 5, 2018 at 10:02 AM, Andrey Ryabinin > <aryabi...@virtuozzo.com> wrote: >> >> >> On 02/02/2018 06:47 PM, Arnd Bergmann wrote: >>> gcc-8 complains about the prototype for this function: >>>

Re: [PATCH] ubsan: don't mark __ubsan_handle_builtin_unreachable as noreturn

2018-02-05 Thread Andrey Ryabinin
On 02/05/2018 01:15 PM, Arnd Bergmann wrote: > On Mon, Feb 5, 2018 at 10:02 AM, Andrey Ryabinin > wrote: >> >> >> On 02/02/2018 06:47 PM, Arnd Bergmann wrote: >>> gcc-8 complains about the prototype for this function: >>> >>> lib

Re: [PATCH] ubsan: don't mark __ubsan_handle_builtin_unreachable as noreturn

2018-02-05 Thread Andrey Ryabinin
On 02/02/2018 06:47 PM, Arnd Bergmann wrote: > gcc-8 complains about the prototype for this function: > > lib/ubsan.c:432:1: error: ignoring attribute 'noreturn' in declaration of a > built-in function '__ubsan_handle_builtin_unreachable' because it conflicts > with attribute 'const'

Re: [PATCH] ubsan: don't mark __ubsan_handle_builtin_unreachable as noreturn

2018-02-05 Thread Andrey Ryabinin
On 02/02/2018 06:47 PM, Arnd Bergmann wrote: > gcc-8 complains about the prototype for this function: > > lib/ubsan.c:432:1: error: ignoring attribute 'noreturn' in declaration of a > built-in function '__ubsan_handle_builtin_unreachable' because it conflicts > with attribute 'const'

Re: [PATCH] mm/kasan: Don't vfree() nonexistent vm_area.

2018-02-05 Thread Andrey Ryabinin
On 02/02/2018 08:20 PM, Matthew Wilcox wrote: > On Thu, Feb 01, 2018 at 11:22:55PM +0300, Andrey Ryabinin wrote: >>>> + vm = find_vm_area((void *)shadow_start); >>>> + if (vm) >>>> + vfree((void *)shadow_start); >>

Re: [PATCH] mm/kasan: Don't vfree() nonexistent vm_area.

2018-02-05 Thread Andrey Ryabinin
On 02/02/2018 08:20 PM, Matthew Wilcox wrote: > On Thu, Feb 01, 2018 at 11:22:55PM +0300, Andrey Ryabinin wrote: >>>> + vm = find_vm_area((void *)shadow_start); >>>> + if (vm) >>>> + vfree((void *)shadow_start); >>

Re: [PATCH] mm/kasan: Don't vfree() nonexistent vm_area.

2018-02-01 Thread Andrey Ryabinin
On 02/01/2018 10:57 PM, Matthew Wilcox wrote: > On Thu, Feb 01, 2018 at 07:33:49PM +0300, Andrey Ryabinin wrote: >> +case MEM_OFFLINE: { >> +struct vm_struct *vm; >> + >> +/* >> + * Only hot-added me

Re: [PATCH] mm/kasan: Don't vfree() nonexistent vm_area.

2018-02-01 Thread Andrey Ryabinin
On 02/01/2018 10:57 PM, Matthew Wilcox wrote: > On Thu, Feb 01, 2018 at 07:33:49PM +0300, Andrey Ryabinin wrote: >> +case MEM_OFFLINE: { >> +struct vm_struct *vm; >> + >> +/* >> + * Only hot-added me

Re: [PATCH 1/5] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()

2018-02-01 Thread Andrey Ryabinin
On 02/01/2018 09:28 PM, Linus Torvalds wrote: > Ack for the whole series. > > Will this go through Andrew's mm tree or what? I can pick it up directly too. > Whatever you'd prefer.

Re: [PATCH 1/5] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()

2018-02-01 Thread Andrey Ryabinin
On 02/01/2018 09:28 PM, Linus Torvalds wrote: > Ack for the whole series. > > Will this go through Andrew's mm tree or what? I can pick it up directly too. > Whatever you'd prefer.

[PATCH 4/5] fs/dcache: Use read_word_at_a_time() in dentry_string_cmp()

2018-02-01 Thread Andrey Ryabinin
ation to shut up kasan's reports"). This workaround is not perfect, since it allows out-of-bounds access to dentry's name for all the code, not just in dentry_string_cmp(). So it would be better to use read_word_at_a_time() instead and revert commit df4c0e36f1b1. Signed-off-by: Andrey Ryabin

[PATCH 4/5] fs/dcache: Use read_word_at_a_time() in dentry_string_cmp()

2018-02-01 Thread Andrey Ryabinin
ation to shut up kasan's reports"). This workaround is not perfect, since it allows out-of-bounds access to dentry's name for all the code, not just in dentry_string_cmp(). So it would be better to use read_word_at_a_time() instead and revert commit df4c0e36f1b1. Signed-off-by: Andrey Ryabini

[PATCH 5/5] fs: dcache: Revert "manually unpoison dname after allocation to shut up kasan's reports"

2018-02-01 Thread Andrey Ryabinin
This reverts commit df4c0e36f1b1782b0611a77c52cc240e5c4752dd. It's no longer needed since dentry_string_cmp() now uses read_word_at_a_time() to avoid kasan's reports. Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- fs/dcache.c | 5 - 1 file changed, 5 deletions(-) diff

[PATCH 5/5] fs: dcache: Revert "manually unpoison dname after allocation to shut up kasan's reports"

2018-02-01 Thread Andrey Ryabinin
This reverts commit df4c0e36f1b1782b0611a77c52cc240e5c4752dd. It's no longer needed since dentry_string_cmp() now uses read_word_at_a_time() to avoid kasan's reports. Signed-off-by: Andrey Ryabinin --- fs/dcache.c | 5 - 1 file changed, 5 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c

[PATCH 3/5] lib/strscpy: Shut up KASAN false-positives in strscpy()

2018-02-01 Thread Andrey Ryabinin
-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- lib/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string.c b/lib/string.c index 64a9e33f1daa..2c0900a5d51a 100644 --- a/lib/string.c +++ b/lib/string.c @@ -203,7 +203,7 @@ ssize_t strscpy(char *dest,

[PATCH 2/5] compiler.h: Add read_word_at_a_time() function.

2018-02-01 Thread Andrey Ryabinin
- only the first byte of access is validated. Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- include/linux/compiler.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index b8414ecf9ba1..0eb5bb0902e9 100644 --- a/i

[PATCH 3/5] lib/strscpy: Shut up KASAN false-positives in strscpy()

2018-02-01 Thread Andrey Ryabinin
-off-by: Andrey Ryabinin --- lib/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string.c b/lib/string.c index 64a9e33f1daa..2c0900a5d51a 100644 --- a/lib/string.c +++ b/lib/string.c @@ -203,7 +203,7 @@ ssize_t strscpy(char *dest, const char *src, size_t count

[PATCH 2/5] compiler.h: Add read_word_at_a_time() function.

2018-02-01 Thread Andrey Ryabinin
- only the first byte of access is validated. Signed-off-by: Andrey Ryabinin --- include/linux/compiler.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index b8414ecf9ba1..0eb5bb0902e9 100644 --- a/include/linux/compiler.h +++ b

[PATCH 1/5] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()

2018-02-01 Thread Andrey Ryabinin
Instead of having two identical __read_once_size_nocheck() functions with different attributes, consolidate all the difference in new macro __no_kasan_or_inline and use it. No functional changes. Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- include/linux/compiler.

[PATCH 1/5] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()

2018-02-01 Thread Andrey Ryabinin
Instead of having two identical __read_once_size_nocheck() functions with different attributes, consolidate all the difference in new macro __no_kasan_or_inline and use it. No functional changes. Signed-off-by: Andrey Ryabinin --- include/linux/compiler.h | 14 ++ 1 file changed, 6

[PATCH] mm/kasan: Don't vfree() nonexistent vm_area.

2018-02-01 Thread Andrey Ryabinin
allocated during boot, so we'll have to keep it. If memory will come online again that shadow will be reused. Fixes: fa69b5989bb0 ("mm/kasan: add support for memory hotplug") Reported-by: Paul Menzel <pmenzel+linux-kasan-...@molgen.mpg.de> Signed-off-by: Andrey Ryabinin <aryabi..

[PATCH] mm/kasan: Don't vfree() nonexistent vm_area.

2018-02-01 Thread Andrey Ryabinin
allocated during boot, so we'll have to keep it. If memory will come online again that shadow will be reused. Fixes: fa69b5989bb0 ("mm/kasan: add support for memory hotplug") Reported-by: Paul Menzel Signed-off-by: Andrey Ryabinin Cc: --- mm/kasan/ka

Re: [PATCH v5 1/2] mm/memcontrol.c: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-25 Thread Andrey Ryabinin
On 01/19/2018 04:25 PM, Andrey Ryabinin wrote: > mem_cgroup_resize_[memsw]_limit() tries to free only 32 (SWAP_CLUSTER_MAX) > pages on each iteration. This makes it practically impossible to decrease > limit of memory cgroup. Tasks could easily allocate back 32 pages, so we > can't r

Re: [PATCH v5 1/2] mm/memcontrol.c: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-25 Thread Andrey Ryabinin
On 01/19/2018 04:25 PM, Andrey Ryabinin wrote: > mem_cgroup_resize_[memsw]_limit() tries to free only 32 (SWAP_CLUSTER_MAX) > pages on each iteration. This makes it practically impossible to decrease > limit of memory cgroup. Tasks could easily allocate back 32 pages, so we > can't r

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-25 Thread Andrey Ryabinin
On 01/25/2018 08:55 PM, Linus Torvalds wrote: > On Thu, Jan 25, 2018 at 12:32 AM, Dmitry Vyukov wrote: >> On Wed, Jan 24, 2018 at 6:52 PM, Linus Torvalds >> wrote: >>> >>> So I'd *much* rather have some way to tell KASAN that word-at-a-time >>>

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-25 Thread Andrey Ryabinin
On 01/25/2018 08:55 PM, Linus Torvalds wrote: > On Thu, Jan 25, 2018 at 12:32 AM, Dmitry Vyukov wrote: >> On Wed, Jan 24, 2018 at 6:52 PM, Linus Torvalds >> wrote: >>> >>> So I'd *much* rather have some way to tell KASAN that word-at-a-time >>> is going on. Because that approach definitely makes

Re: [PATCH] kasan: add __asan_report_loadN/storeN_noabort callbacks

2018-01-23 Thread Andrey Ryabinin
On 01/19/2018 08:44 PM, Andrey Konovalov wrote: > Instead of __asan_report_load_n_noabort and __asan_report_store_n_noabort > callbacks Clang emits differently named __asan_report_loadN_noabort and > __asan_report_storeN_noabort (similar to __asan_loadN/storeN_noabort, whose > names both GCC and

Re: [PATCH] kasan: add __asan_report_loadN/storeN_noabort callbacks

2018-01-23 Thread Andrey Ryabinin
On 01/19/2018 08:44 PM, Andrey Konovalov wrote: > Instead of __asan_report_load_n_noabort and __asan_report_store_n_noabort > callbacks Clang emits differently named __asan_report_loadN_noabort and > __asan_report_storeN_noabort (similar to __asan_loadN/storeN_noabort, whose > names both GCC and

Re: [PATCH v2] kasan: don't emit builtin calls when sanitization is off

2018-01-23 Thread Andrey Ryabinin
On 01/23/2018 05:20 AM, Andrew Morton wrote: > On Fri, 19 Jan 2018 18:58:12 +0100 Andrey Konovalov > wrote: > >> With KASAN enabled the kernel has two different memset() functions, one >> with KASAN checks (memset) and one without (__memset). KASAN uses some >> macro

Re: [PATCH v2] kasan: don't emit builtin calls when sanitization is off

2018-01-23 Thread Andrey Ryabinin
On 01/23/2018 05:20 AM, Andrew Morton wrote: > On Fri, 19 Jan 2018 18:58:12 +0100 Andrey Konovalov > wrote: > >> With KASAN enabled the kernel has two different memset() functions, one >> with KASAN checks (memset) and one without (__memset). KASAN uses some >> macro tricks to use the proper

Re: [PATCH v2] kasan: don't emit builtin calls when sanitization is off

2018-01-23 Thread Andrey Ryabinin
On 01/19/2018 08:58 PM, Andrey Konovalov wrote: > With KASAN enabled the kernel has two different memset() functions, one > with KASAN checks (memset) and one without (__memset). KASAN uses some > macro tricks to use the proper version where required. For example memset() > calls in mm/slub.c

Re: [PATCH v2] kasan: don't emit builtin calls when sanitization is off

2018-01-23 Thread Andrey Ryabinin
On 01/19/2018 08:58 PM, Andrey Konovalov wrote: > With KASAN enabled the kernel has two different memset() functions, one > with KASAN checks (memset) and one without (__memset). KASAN uses some > macro tricks to use the proper version where required. For example memset() > calls in mm/slub.c

[PATCH] lib-ubsan-remove-returns-nonnull-attribute-checks-fix

2018-01-22 Thread Andrey Ryabinin
Fixes: lib/ubsan.c:144:13: warning: ‘location_is_valid’ defined but not used [-Wunused-function] static bool location_is_valid(struct source_location *loc) Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- lib/ubsan.c | 5 - 1 file changed, 5 deletions(-) diff --git

[PATCH] lib-ubsan-remove-returns-nonnull-attribute-checks-fix

2018-01-22 Thread Andrey Ryabinin
Fixes: lib/ubsan.c:144:13: warning: ‘location_is_valid’ defined but not used [-Wunused-function] static bool location_is_valid(struct source_location *loc) Signed-off-by: Andrey Ryabinin --- lib/ubsan.c | 5 - 1 file changed, 5 deletions(-) diff --git a/lib/ubsan.c b/lib/ubsan.c index

Re: [PATCH] kasan: don't emit builtin calls when sanitization is off

2018-01-19 Thread Andrey Ryabinin
On 01/19/2018 05:54 PM, Andrey Konovalov wrote: > diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan > index dbbd4382f15a..db473309f136 100644 > --- a/scripts/Makefile.kasan > +++ b/scripts/Makefile.kasan > @@ -39,4 +39,7 @@ else > endif > > CFLAGS_KASAN += $(call cc-option,

Re: [PATCH] kasan: don't emit builtin calls when sanitization is off

2018-01-19 Thread Andrey Ryabinin
On 01/19/2018 05:54 PM, Andrey Konovalov wrote: > diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan > index dbbd4382f15a..db473309f136 100644 > --- a/scripts/Makefile.kasan > +++ b/scripts/Makefile.kasan > @@ -39,4 +39,7 @@ else > endif > > CFLAGS_KASAN += $(call cc-option,

[PATCH 2/2] lib/ubsan: remove returns-nonnull-attribute checks.

2018-01-19 Thread Andrey Ryabinin
-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- lib/ubsan.c| 19 --- lib/ubsan.h| 5 - scripts/Makefile.ubsan | 1 - 3 files changed, 25 deletions(-) diff --git a/lib/ubsan.c b/lib/ubsan.c index 50d1d5c25deb..adada1dbbe94 100644 --- a/lib/ubsan.c +++

[PATCH 2/2] lib/ubsan: remove returns-nonnull-attribute checks.

2018-01-19 Thread Andrey Ryabinin
-by: Andrey Ryabinin --- lib/ubsan.c| 19 --- lib/ubsan.h| 5 - scripts/Makefile.ubsan | 1 - 3 files changed, 25 deletions(-) diff --git a/lib/ubsan.c b/lib/ubsan.c index 50d1d5c25deb..adada1dbbe94 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -356,25

[PATCH 1/2] lib/ubsan: Add type mismatch handler for new GCC/Clang

2018-01-19 Thread Andrey Ryabinin
compiler-dependent type mismatch data to our internal representation. This way, we can support both old and new compilers with minimal amount of change. Reported-by: Sodagudi Prasad <psoda...@codeaurora.org> Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> Cc: stable <sta...@

[PATCH 1/2] lib/ubsan: Add type mismatch handler for new GCC/Clang

2018-01-19 Thread Andrey Ryabinin
compiler-dependent type mismatch data to our internal representation. This way, we can support both old and new compilers with minimal amount of change. Reported-by: Sodagudi Prasad Signed-off-by: Andrey Ryabinin Cc: stable # 4.5+ --- lib/ubsan.c | 48

[PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-01-19 Thread Andrey Ryabinin
50M > memory.limit_in_bytes Performance counter stats for 'echo 50M': 169.403906 task-clock (msec) #0.849 CPUs utilized 14 context-switches #0.083 K/sec 0.199536900 seconds time elapsed Signed-off-by: Andrey Ryabinin &

[PATCH v5 2/2] mm/memcontrol.c: Reduce reclaim retries in mem_cgroup_resize_limit()

2018-01-19 Thread Andrey Ryabinin
50M > memory.limit_in_bytes Performance counter stats for 'echo 50M': 169.403906 task-clock (msec) #0.849 CPUs utilized 14 context-switches #0.083 K/sec 0.199536900 seconds time elapsed Signed-off-by: Andrey Ryabinin Cc: S

[PATCH v5 1/2] mm/memcontrol.c: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-19 Thread Andrey Ryabinin
-bash: echo: write error: Device or resource busy Instead of relying on retry_count, keep retrying the reclaim until the desired limit is reached or fail if the reclaim doesn't make any progress or a signal is pending. Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> Cc: Shakeel Butt &l

[PATCH v5 1/2] mm/memcontrol.c: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-19 Thread Andrey Ryabinin
-bash: echo: write error: Device or resource busy Instead of relying on retry_count, keep retrying the reclaim until the desired limit is reached or fail if the reclaim doesn't make any progress or a signal is pending. Signed-off-by: Andrey Ryabinin Cc: Shakeel Butt Cc: Michal Hocko Cc: Johan

Re: UBSAN: Undefined behaviour in drivers/net/wireless/ath/ath10k/mac.c:3092:53: signed integer overflow

2018-01-19 Thread Andrey Ryabinin
2018-01-19 13:24 GMT+03:00 Kalle Valo : > Adding linux-wireless. > > For linux-wireless the full report is here: > > https://lkml.kernel.org/r/70aa931f-2f02-dd26-c98b-695d1321f...@molgen.mpg.de > > Paul Menzel writes: > >> I enabled the

Re: UBSAN: Undefined behaviour in drivers/net/wireless/ath/ath10k/mac.c:3092:53: signed integer overflow

2018-01-19 Thread Andrey Ryabinin
2018-01-19 13:24 GMT+03:00 Kalle Valo : > Adding linux-wireless. > > For linux-wireless the full report is here: > > https://lkml.kernel.org/r/70aa931f-2f02-dd26-c98b-695d1321f...@molgen.mpg.de > > Paul Menzel writes: > >> I enabled the undefined behavior sanitizer, and built Linus’ master >>

Re: [PATCH v2 2/2] kasan: clean up KASAN_SHADOW_SCALE_SHIFT usage

2018-01-15 Thread Andrey Ryabinin
where necessary. > > Signed-off-by: Andrey Konovalov <andreyk...@google.com> > --- Acked-by: Andrey Ryabinin <aryabi...@virtuozzo.com>

Re: [PATCH v2 2/2] kasan: clean up KASAN_SHADOW_SCALE_SHIFT usage

2018-01-15 Thread Andrey Ryabinin
where necessary. > > Signed-off-by: Andrey Konovalov > --- Acked-by: Andrey Ryabinin

Re: [PATCH 4.9 84/96] x86/asm: Use register variable to get stack pointer value

2018-01-15 Thread Andrey Ryabinin
Resending with correct David's email s/d...@amazon.co.ku/d...@amazon.co.uk/ (it's incorrect in signed-off-by line) On 01/15/2018 05:31 PM, Andrey Ryabinin wrote: > > > On 01/15/2018 03:35 PM, Greg Kroah-Hartman wrote: >> 4.9-stable review patch. If anyone has any objections, ple

Re: [PATCH 4.9 84/96] x86/asm: Use register variable to get stack pointer value

2018-01-15 Thread Andrey Ryabinin
Resending with correct David's email s/d...@amazon.co.ku/d...@amazon.co.uk/ (it's incorrect in signed-off-by line) On 01/15/2018 05:31 PM, Andrey Ryabinin wrote: > > > On 01/15/2018 03:35 PM, Greg Kroah-Hartman wrote: >> 4.9-stable review patch. If anyone has any objections, ple

Re: [PATCH 4.9 84/96] x86/asm: Use register variable to get stack pointer value

2018-01-15 Thread Andrey Ryabinin
On 01/15/2018 03:35 PM, Greg Kroah-Hartman wrote: > 4.9-stable review patch. If anyone has any objections, please let me know. > > -- > > From: Andrey Ryabinin <aryabi...@virtuozzo.com> > > commit 196bd485ee4f03ce4c690bfcf38138abfcd0a4bc upst

Re: [PATCH 4.9 84/96] x86/asm: Use register variable to get stack pointer value

2018-01-15 Thread Andrey Ryabinin
On 01/15/2018 03:35 PM, Greg Kroah-Hartman wrote: > 4.9-stable review patch. If anyone has any objections, please let me know. > > -- > > From: Andrey Ryabinin > > commit 196bd485ee4f03ce4c690bfcf38138abfcd0a4bc upstream. > > Currently w

Re: [PATCH v4] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-15 Thread Andrey Ryabinin
On 01/15/2018 03:46 PM, Michal Hocko wrote: > On Mon 15-01-18 15:30:59, Andrey Ryabinin wrote: >> >> >> On 01/12/2018 03:24 PM, Michal Hocko wrote: >>> On Fri 12-01-18 00:59:38, Andrey Ryabinin wrote: >>>> On 01/11/2018 07:29 PM, Michal Hocko wrote: &

Re: [PATCH v4] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-15 Thread Andrey Ryabinin
On 01/15/2018 03:46 PM, Michal Hocko wrote: > On Mon 15-01-18 15:30:59, Andrey Ryabinin wrote: >> >> >> On 01/12/2018 03:24 PM, Michal Hocko wrote: >>> On Fri 12-01-18 00:59:38, Andrey Ryabinin wrote: >>>> On 01/11/2018 07:29 PM, Michal Hocko wrote: &

Re: [PATCH v4] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-15 Thread Andrey Ryabinin
On 01/12/2018 03:24 PM, Michal Hocko wrote: > On Fri 12-01-18 00:59:38, Andrey Ryabinin wrote: >> On 01/11/2018 07:29 PM, Michal Hocko wrote: > [...] >>> I do not think so. Consider that this reclaim races with other >>> reclaimers. Now you are reclaiming a l

Re: [PATCH v4] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-15 Thread Andrey Ryabinin
On 01/12/2018 03:24 PM, Michal Hocko wrote: > On Fri 12-01-18 00:59:38, Andrey Ryabinin wrote: >> On 01/11/2018 07:29 PM, Michal Hocko wrote: > [...] >>> I do not think so. Consider that this reclaim races with other >>> reclaimers. Now you are reclaiming a l

Re: [PATCH v4] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-15 Thread Andrey Ryabinin
On 01/13/2018 01:57 AM, Shakeel Butt wrote: > On Fri, Jan 12, 2018 at 4:24 AM, Michal Hocko <mho...@kernel.org> wrote: >> On Fri 12-01-18 00:59:38, Andrey Ryabinin wrote: >>> On 01/11/2018 07:29 PM, Michal Hocko wrote: >> [...] >>>> I do not think so. C

Re: [PATCH v4] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-15 Thread Andrey Ryabinin
On 01/13/2018 01:57 AM, Shakeel Butt wrote: > On Fri, Jan 12, 2018 at 4:24 AM, Michal Hocko wrote: >> On Fri 12-01-18 00:59:38, Andrey Ryabinin wrote: >>> On 01/11/2018 07:29 PM, Michal Hocko wrote: >> [...] >>>> I do not think so. Consider that this recl

[tip:x86/pti] x86/kasan: Panic if there is not enough memory to boot

2018-01-14 Thread tip-bot for Andrey Ryabinin
Commit-ID: 0d39e2669d7b0fefd2d8f9e7868ae669b364d9ba Gitweb: https://git.kernel.org/tip/0d39e2669d7b0fefd2d8f9e7868ae669b364d9ba Author: Andrey Ryabinin <aryabi...@virtuozzo.com> AuthorDate: Wed, 10 Jan 2018 18:36:02 +0300 Committer: Thomas Gleixner <t...@linutronix.de> Com

[tip:x86/pti] x86/kasan: Panic if there is not enough memory to boot

2018-01-14 Thread tip-bot for Andrey Ryabinin
Commit-ID: 0d39e2669d7b0fefd2d8f9e7868ae669b364d9ba Gitweb: https://git.kernel.org/tip/0d39e2669d7b0fefd2d8f9e7868ae669b364d9ba Author: Andrey Ryabinin AuthorDate: Wed, 10 Jan 2018 18:36:02 +0300 Committer: Thomas Gleixner CommitDate: Mon, 15 Jan 2018 00:32:35 +0100 x86/kasan: Panic

[tip:x86/pti] x86/kasan: Panic if there is not enough memory to boot

2018-01-14 Thread tip-bot for Andrey Ryabinin
Commit-ID: def0e7b54d63bae120302a4957c272107563ad04 Gitweb: https://git.kernel.org/tip/def0e7b54d63bae120302a4957c272107563ad04 Author: Andrey Ryabinin <aryabi...@virtuozzo.com> AuthorDate: Wed, 10 Jan 2018 18:36:02 +0300 Committer: Thomas Gleixner <t...@linutronix.de> Com

[tip:x86/pti] x86/kasan: Panic if there is not enough memory to boot

2018-01-14 Thread tip-bot for Andrey Ryabinin
Commit-ID: def0e7b54d63bae120302a4957c272107563ad04 Gitweb: https://git.kernel.org/tip/def0e7b54d63bae120302a4957c272107563ad04 Author: Andrey Ryabinin AuthorDate: Wed, 10 Jan 2018 18:36:02 +0300 Committer: Thomas Gleixner CommitDate: Sun, 14 Jan 2018 15:41:32 +0100 x86/kasan: Panic

[tip:x86/mm] x86/kasan: Panic if there is not enough memory to boot

2018-01-14 Thread tip-bot for Andrey Ryabinin
Commit-ID: 74b61d1fb59bed3a6608161b05f2c0f5cb71acf6 Gitweb: https://git.kernel.org/tip/74b61d1fb59bed3a6608161b05f2c0f5cb71acf6 Author: Andrey Ryabinin <aryabi...@virtuozzo.com> AuthorDate: Wed, 10 Jan 2018 18:36:02 +0300 Committer: Thomas Gleixner <t...@linutronix.de> Com

[tip:x86/mm] x86/kasan: Panic if there is not enough memory to boot

2018-01-14 Thread tip-bot for Andrey Ryabinin
Commit-ID: 74b61d1fb59bed3a6608161b05f2c0f5cb71acf6 Gitweb: https://git.kernel.org/tip/74b61d1fb59bed3a6608161b05f2c0f5cb71acf6 Author: Andrey Ryabinin AuthorDate: Wed, 10 Jan 2018 18:36:02 +0300 Committer: Thomas Gleixner CommitDate: Sun, 14 Jan 2018 12:59:51 +0100 x86/kasan: Panic

Re: [PATCH v4] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes

2018-01-12 Thread Andrey Ryabinin
On 01/12/2018 03:21 AM, Andrew Morton wrote: > On Thu, 11 Jan 2018 14:59:23 +0300 Andrey Ryabinin <aryabi...@virtuozzo.com> > wrote: > >> On 01/11/2018 01:31 AM, Andrew Morton wrote: >>> On Wed, 10 Jan 2018 15:43:17 +0300 Andrey Ryabinin >&

<    1   2   3   4   5   6   7   8   9   10   >