linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] x86: kernel: nmi: A possible sleep-in-atomic-context bug in nmi_handle()
@ 2018-08-10 14:03 Jia-Ju Bai
  0 siblings, 0 replies; only message in thread
From: Jia-Ju Bai @ 2018-08-10 14:03 UTC (permalink / raw)
  To: Thomas Gleixner, mingo, hpa, mark.rutland, swood, paulmck
  Cc: x86, linux-kernel

The code may sleep with holding a rcu read lock.

The function call paths (from bottom to top) in Linux-4.16 are:

========== BUG ==========
[FUNC] kmalloc(GFP_KERNEL)
arch/x86/mm/mmio-mod.c, 237: kmalloc in ioremap_trace_core
arch/x86/mm/mmio-mod.c, 289: ioremap_trace_core in mmiotrace_ioremap
arch/x86/mm/ioremap.c, 243: mmiotrace_ioremap in __ioremap_caller
arch/x86/mm/ioremap.c, 367: __ioremap_caller in ioremap_cache
./include/acpi/acpi_io.h, 13: ioremap_cache in acpi_os_ioremap
drivers/acpi/osl.c, 702: acpi_os_ioremap in acpi_os_read_memory
drivers/acpi/apei/apei-base.c, 662: acpi_os_read_memory in apei_read
drivers/acpi/apei/ghes.c, 335: apei_read in ghes_read_estatus
drivers/acpi/apei/ghes.c, 941: ghes_read_estatus in ghes_notify_nmi
arch/x86/kernel/nmi.c, 137: [FUNC_PTR]ghes_notify_nmi in nmi_handle
arch/x86/kernel/nmi.c, 124: rcu_read_lock in nmi_handle

Note that [FUNC_PTR] means a function pointer call is used.

I do not find a good way to fix it, so I only report.
These possible bugs are found by my static analysis tool (DSAC) and 
checked by my code review.


Best wishes,
Jia-Ju Bai


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-10 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 14:03 [BUG] x86: kernel: nmi: A possible sleep-in-atomic-context bug in nmi_handle() Jia-Ju Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).