mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
669420644c
The only way for a sysfs attribute to remove itself (without deadlock) is to use the sysfs_schedule_callback() interface. Vegard Nossum discovered that a poorly written sysfs ->store callback can repeatedly schedule remove callbacks on the same device over and over, e.g. $ while true ; do echo 1 > /sys/devices/.../remove ; done If the 'remove' attribute uses the sysfs_schedule_callback API and also does not protect itself from concurrent accesses, its callback handler will be called multiple times, and will eventually attempt to perform operations on a freed kobject, leading to many problems. Instead of requiring all callers of sysfs_schedule_callback to implement their own synchronization, provide the protection in the infrastructure. Now, sysfs_schedule_callback will only allow one scheduled callback per kobject. On subsequent calls with the same kobject, return -EAGAIN. This is a short term fix. The long term fix is to allow sysfs attributes to remove themselves directly, without any of this callback hokey pokey. [cornelia.huck@de.ibm.com: s390 ccwgroup bits] Reported-by: vegard.nossum@gmail.com Signed-off-by: Alex Chiang <achiang@hp.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
||
---|---|---|
.. | ||
airq.c | ||
blacklist.c | ||
blacklist.h | ||
ccwgroup.c | ||
chp.c | ||
chp.h | ||
chsc_sch.c | ||
chsc_sch.h | ||
chsc.c | ||
chsc.h | ||
cio_debug.h | ||
cio.c | ||
cio.h | ||
cmf.c | ||
css.c | ||
css.h | ||
device_fsm.c | ||
device_id.c | ||
device_ops.c | ||
device_pgid.c | ||
device_status.c | ||
device.c | ||
device.h | ||
fcx.c | ||
idset.c | ||
idset.h | ||
io_sch.h | ||
ioasm.h | ||
isc.c | ||
itcw.c | ||
Makefile | ||
qdio_debug.c | ||
qdio_debug.h | ||
qdio_main.c | ||
qdio_perf.c | ||
qdio_perf.h | ||
qdio_setup.c | ||
qdio_thinint.c | ||
qdio.h | ||
scsw.c |