Alexander Potapenko 305e519ce4 lib/stackdepot.c: fix global out-of-bounds in stack_slabs
Walter Wu has reported a potential case in which init_stack_slab() is
called after stack_slabs[STACK_ALLOC_MAX_SLABS - 1] has already been
initialized.  In that case init_stack_slab() will overwrite
stack_slabs[STACK_ALLOC_MAX_SLABS], which may result in a memory
corruption.

Link: http://lkml.kernel.org/r/20200218102950.260263-1-glider@google.com
Fixes: cd11016e5f521 ("mm, kasan: stackdepot implementation. Enable stackdepot for SLAB")
Signed-off-by: Alexander Potapenko <glider@google.com>
Reported-by: Walter Wu <walter-zh.wu@mediatek.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-02-21 11:22:15 -08:00
..
2019-09-20 09:06:26 -07:00
2018-08-22 10:52:48 -07:00
2018-10-12 09:17:46 +02:00
2020-02-04 03:05:26 +00:00
2018-08-16 12:14:42 -07:00
2014-04-30 19:49:37 +01:00
2017-02-24 17:46:57 -08:00
2020-02-11 16:39:18 -08:00
2020-01-29 15:25:34 -08:00
2019-12-07 11:00:19 -08:00
2020-02-11 16:39:18 -08:00
2018-10-16 13:45:44 +02:00
2019-07-11 15:17:41 -07:00
2018-06-27 18:58:49 +03:00
2018-10-15 16:31:29 -04:00
2017-08-15 09:02:07 -07:00