1
0
Fork 0
alistair23-linux/mm/kasan
Marco Elver c2a26769b4 kasan: disable branch tracing for core runtime
commit 33cd65e73a upstream.

During early boot, while KASAN is not yet initialized, it is possible to
enter reporting code-path and end up in kasan_report().

While uninitialized, the branch there prevents generating any reports,
however, under certain circumstances when branches are being traced
(TRACE_BRANCH_PROFILING), we may recurse deep enough to cause kernel
reboots without warning.

To prevent similar issues in future, we should disable branch tracing
for the core runtime.

[elver@google.com: remove duplicate DISABLE_BRANCH_PROFILING, per Qian Cai]
  Link: https://lore.kernel.org/lkml/20200517011732.GE24705@shao2-debian/
  Link: http://lkml.kernel.org/r/20200522075207.157349-1-elver@google.com
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Qian Cai <cai@lca.pw>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r//20200517011732.GE24705@shao2-debian/
Link: http://lkml.kernel.org/r/20200519182459.87166-1-elver@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27 17:46:48 +02:00
..
Makefile kasan: disable branch tracing for core runtime 2020-05-27 17:46:48 +02:00
common.c mm: introduce compound_nr() 2019-09-24 15:54:08 -07:00
generic.c kasan: disable branch tracing for core runtime 2020-05-27 17:46:48 +02:00
generic_report.c kasan: remove use after scope bugs detection. 2019-03-05 21:07:13 -08:00
init.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
kasan.h kasan: add memory corruption identification for software tag-based mode 2019-09-24 15:54:07 -07:00
quarantine.c mm: convert totalram_pages and totalhigh_pages variables to atomic 2018-12-28 12:11:47 -08:00
report.c kasan: add memory corruption identification for software tag-based mode 2019-09-24 15:54:07 -07:00
tags.c kasan: disable branch tracing for core runtime 2020-05-27 17:46:48 +02:00
tags_report.c kasan: add memory corruption identification for software tag-based mode 2019-09-24 15:54:07 -07:00