linux_dsm_epyc7002/drivers/base
Neil Horman eea915bb0d firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
This oops was reported recently:
firmware_loading_store+0xf9/0x17b
dev_attr_store+0x20/0x22
sysfs_write_file+0x101/0x134
vfs_write+0xac/0xf3
sys_write+0x4a/0x6e
system_call_fastpath+0x16/0x1b

The complete backtrace was unfortunately not captured, but details can be found
here:
https://bugzilla.redhat.com/show_bug.cgi?id=769920

The cause is fairly clear.

Its caused by the fact that firmware_loading_store has a case 0 in its
switch statement that reads and writes the fw_priv->fw poniter without the
protection of the fw_lock mutex.  since there is a window between the time that
_request_firmware sets fw_priv->fw to NULL and the time the corresponding sysfs
file is unregistered, its possible for a user space application to race in, and
write a zero to the loading file, causing a NULL dereference in
firmware_loading_store.  Fix it by extending the protection of the fw_lock mutex
to cover all of the firware_loading_store function.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 16:31:29 -08:00
..
power Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
regmap drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
attribute_container.c
base.h driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
bus.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
class.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
core.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
cpu.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
dd.c drivers: base: print rejected matches with DEBUG_DRIVER 2011-09-26 16:21:15 -07:00
devres.c base/devres.c: quiet sparse noise about context imbalance 2011-08-22 14:12:24 -07:00
devtmpfs.c devtmpfsd: fix task state handling 2011-11-15 16:07:39 -08:00
dma-coherent.c drivers/base: dma-coherent.c is a module and needs module.h 2011-10-31 19:31:38 -04:00
dma-mapping.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
driver.c
firmware_class.c firmware: Fix an oops on reading fw_priv->fw in sysfs loading file 2012-01-04 16:31:29 -08:00
firmware.c
hypervisor.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
init.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
isa.c
Kconfig Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2011-07-25 23:06:24 -07:00
Makefile topology: Provide CPU topology in sysfs in !SMP configurations 2011-11-26 20:12:47 -08:00
map.c
memory.c convert 'memory' sysdev_class to a regular subsystem 2011-12-21 14:48:43 -08:00
module.c
node.c convert 'memory' sysdev_class to a regular subsystem 2011-12-21 14:48:43 -08:00
platform.c drivers_base: make argument to platform_device_register_full const 2011-12-09 16:23:49 -08:00
sys.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
syscore.c PM: Reintroduce dropped call to check_wakeup_irqs 2011-07-11 10:51:49 +02:00
topology.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
transport_class.c drivers/base: transport_class explicitly requires EXPORT_SYMBOL 2011-10-31 19:31:15 -04:00