diff options
author | 2019-02-20 22:20:15 -0800 | |
---|---|---|
committer | 2019-02-21 09:01:00 -0800 | |
commit | 3f41b609382388f95c0a05b69b8db0d706adafb4 (patch) | |
tree | cf5fed9746400cbda15f47acd7acceab80aa1fd5 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | tmpfs: fix link accounting when a tmpfile is linked in (diff) | |
download | wireguard-linux-3f41b609382388f95c0a05b69b8db0d706adafb4.tar.xz wireguard-linux-3f41b609382388f95c0a05b69b8db0d706adafb4.zip |
kasan: fix random seed generation for tag-based mode
There are two issues with assigning random percpu seeds right now:
1. We use for_each_possible_cpu() to iterate over cpus, but cpumask is
not set up yet at the moment of kasan_init(), and thus we only set
the seed for cpu #0.
2. A call to get_random_u32() always returns the same number and produces
a message in dmesg, since the random subsystem is not yet initialized.
Fix 1 by calling kasan_init_tags() after cpumask is set up.
Fix 2 by using get_cycles() instead of get_random_u32(). This gives us
lower quality random numbers, but it's good enough, as KASAN is meant to
be used as a debugging tool and not a mitigation.
Link: http://lkml.kernel.org/r/1f815cc914b61f3516ed4cc9bfd9eeca9bd5d9de.1550677973.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions