[bug report] acpi/ghes: Process CXL Component Events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ira Weiny,

The patch 671a794c33c6: "acpi/ghes: Process CXL Component Events"
from Dec 20, 2023 (linux-next), leads to the following Smatch static
checker warning:

	drivers/acpi/apei/ghes.c:724 cxl_cper_post_event()
	warn: sleeping in atomic context

drivers/acpi/apei/ghes.c
    709 static void cxl_cper_post_event(enum cxl_event_type event_type,
    710                                 struct cxl_cper_event_rec *rec)
    711 {
    712         if (rec->hdr.length <= sizeof(rec->hdr) ||
    713             rec->hdr.length > sizeof(*rec)) {
    714                 pr_err(FW_WARN "CXL CPER Invalid section length (%u)\n",
    715                        rec->hdr.length);
    716                 return;
    717         }
    718 
    719         if (!(rec->hdr.validation_bits & CPER_CXL_COMP_EVENT_LOG_VALID)) {
    720                 pr_err(FW_WARN "CXL CPER invalid event\n");
    721                 return;
    722         }
    723 
--> 724         guard(rwsem_read)(&cxl_cper_rw_sem);

rwsem_read is a sleeping lock however there are several callers which
hold spinlocks or disable preemption.

    725         if (cper_callback)
    726                 cper_callback(event_type, rec);
    727 }

Here are the call trees that trigger the Smatch warning.

ghes_poll_func() <- disables preempt
ghes_irq_func() <- disables preempt
ghes_notify_hed() <- disables preempt
ghes_probe() <- disables preempt
-> ghes_proc()
   -> ghes_do_proc()
      -> cxl_cper_post_event()

Probe for example is holding spin_lock_irqsave(&ghes_notify_lock_irq, flags);

regards,
dan carpenter




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux