• Kees Cook's avatar
    pstore: Convert buf_lock to semaphore · f72ecfe9
    Kees Cook authored
    commit ea84b580b95521644429cc6748b6c2bf27c8b0f3 upstream.
    
    Instead of running with interrupts disabled, use a semaphore. This should
    make it easier for backends that may need to sleep (e.g. EFI) when
    performing a write:
    
    |BUG: sleeping function called from invalid context at kernel/sched/completion.c:99
    |in_atomic(): 1, irqs_disabled(): 1, pid: 2236, name: sig-xstate-bum
    |Preemption disabled at:
    |[<ffffffff99d60512>] pstore_dump+0x72/0x330
    |CPU: 26 PID: 2236 Comm: sig-xstate-bum Tainted: G      D           4.20.0-rc3 #45
    |Call Trace:
    | dump_stack+0x4f/0x6a
    | ___might_sleep.cold.91+0xd3/0xe4
    | __might_sleep+0x50/0x90
    | wait_for_completion+0x32/0x130
    | virt_efi_query_variable_info+0x14e/0x160
    | efi_query_variable_store+0x51/0x1a0
    | efivar_entry_set_safe+0xa3/0x1b0
    | efi_pstore_write+0x109/0x140
    | pstore_dump+0x11c/0x330
    | kmsg_dump+0xa4/0xd0
    | oops_exit+0x22/0x30
    ...
    Reported-by: 's avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
    Fixes: 21b3ddd3 ("efi: Don't use spinlocks for efi vars")
    Signed-off-by: 's avatarKees Cook <keescook@chromium.org>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f72ecfe9
Name
Last commit
Last update
..
acpica Loading commit data...
apei Loading commit data...
arm64 Loading commit data...
dptf Loading commit data...
nfit Loading commit data...
pmic Loading commit data...
x86 Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
ac.c Loading commit data...
acpi_amba.c Loading commit data...
acpi_apd.c Loading commit data...
acpi_cmos_rtc.c Loading commit data...
acpi_configfs.c Loading commit data...
acpi_dbg.c Loading commit data...
acpi_extlog.c Loading commit data...
acpi_ipmi.c Loading commit data...
acpi_lpat.c Loading commit data...
acpi_lpss.c Loading commit data...
acpi_memhotplug.c Loading commit data...
acpi_pad.c Loading commit data...
acpi_platform.c Loading commit data...
acpi_pnp.c Loading commit data...
acpi_processor.c Loading commit data...
acpi_video.c Loading commit data...
acpi_watchdog.c Loading commit data...
battery.c Loading commit data...
battery.h Loading commit data...
bgrt.c Loading commit data...
blacklist.c Loading commit data...
bus.c Loading commit data...
button.c Loading commit data...
cm_sbs.c Loading commit data...
container.c Loading commit data...
cppc_acpi.c Loading commit data...
custom_method.c Loading commit data...
debugfs.c Loading commit data...
device_pm.c Loading commit data...
device_sysfs.c Loading commit data...
dock.c Loading commit data...
ec.c Loading commit data...
ec_sys.c Loading commit data...
event.c Loading commit data...
evged.c Loading commit data...
fan.c Loading commit data...
glue.c Loading commit data...
hed.c Loading commit data...
internal.h Loading commit data...
ioapic.c Loading commit data...
irq.c Loading commit data...
numa.c Loading commit data...
nvs.c Loading commit data...
osi.c Loading commit data...
osl.c Loading commit data...
pci_irq.c Loading commit data...
pci_link.c Loading commit data...
pci_mcfg.c Loading commit data...
pci_root.c Loading commit data...
pci_slot.c Loading commit data...
power.c Loading commit data...
proc.c Loading commit data...
processor_core.c Loading commit data...
processor_driver.c Loading commit data...
processor_idle.c Loading commit data...
processor_pdc.c Loading commit data...
processor_perflib.c Loading commit data...
processor_thermal.c Loading commit data...
processor_throttling.c Loading commit data...
property.c Loading commit data...
reboot.c Loading commit data...
resource.c Loading commit data...
sbs.c Loading commit data...
sbshc.c Loading commit data...
sbshc.h Loading commit data...
scan.c Loading commit data...
sleep.c Loading commit data...
sleep.h Loading commit data...
spcr.c Loading commit data...
sysfs.c Loading commit data...
tables.c Loading commit data...
thermal.c Loading commit data...
utils.c Loading commit data...
video_detect.c Loading commit data...
wakeup.c Loading commit data...