linux-stable/mm/kmsan
Alexander Potapenko fdea03e12a mm: kmsan: handle alloc failures in kmsan_ioremap_page_range()
Similarly to kmsan_vmap_pages_range_noflush(), kmsan_ioremap_page_range()
must also properly handle allocation/mapping failures.  In the case of
such, it must clean up the already created metadata mappings and return an
error code, so that the error can be propagated to ioremap_page_range(). 
Without doing so, KMSAN may silently fail to bring the metadata for the
page range into a consistent state, which will result in user-visible
crashes when trying to access them.

Link: https://lkml.kernel.org/r/20230413131223.4135168-2-glider@google.com
Fixes: b073d7f8ae ("mm: kmsan: maintain KMSAN metadata for page operations")
Signed-off-by: Alexander Potapenko <glider@google.com>
Reported-by: Dipanjan Das <mail.dipanjan.das@gmail.com>
  Link: https://lore.kernel.org/linux-mm/CANX2M5ZRrRA64k0hOif02TjmY9kbbO2aCBPyq79es34RXZ=cAw@mail.gmail.com/
Reviewed-by: Marco Elver <elver@google.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-04-18 14:22:13 -07:00
..
Makefile kmsan: disable ftrace in kmsan core code 2023-02-20 12:46:16 -08:00
core.c lib/stacktrace, kasan, kmsan: rework extra_bits interface 2023-02-16 20:43:51 -08:00
hooks.c mm: kmsan: handle alloc failures in kmsan_ioremap_page_range() 2023-04-18 14:22:13 -07:00
init.c init: kmsan: call KMSAN initialization routines 2022-10-03 14:03:21 -07:00
instrumentation.c kmsan: silence -Wmissing-prototypes warnings 2023-02-02 22:33:05 -08:00
kmsan.h kmsan: core: kmsan_in_runtime() should return true in NMI context 2022-11-08 15:57:24 -08:00
kmsan_test.c kmsan: include linux/vmalloc.h 2022-12-21 14:31:51 -08:00
report.c
shadow.c mm: kmsan: handle alloc failures in kmsan_vmap_pages_range_noflush() 2023-04-18 14:22:13 -07:00