android_kernel_xiaomi_sm8350/drivers/s390
Alex Chiang 669420644c sysfs: only allow one scheduled removal callback per kobj
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>
2009-03-24 16:38:26 -07:00
..
block [S390] dasd: fix race in dasd timer handling 2009-02-11 10:37:40 +01:00
char [S390] fix "mem=" handling in case of standby memory 2009-02-19 15:19:19 +01:00
cio sysfs: only allow one scheduled removal callback per kobj 2009-03-24 16:38:26 -07:00
crypto s390: remove s390_root_dev_*() 2009-01-06 10:44:34 -08:00
kvm s390: remove s390_root_dev_*() 2009-01-06 10:44:34 -08:00
net s390: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:21 -07:00
scsi [SCSI] zfcp: Remove unnecessary warning message 2008-12-29 11:38:29 -06:00
ebcdic.c
Makefile s390: remove s390_root_dev_*() 2009-01-06 10:44:34 -08:00
s390mach.c [PATCH] improve idle cputime accounting 2008-12-31 15:11:48 +01:00
s390mach.h
sysinfo.c [S390] service level interface. 2008-12-25 13:39:00 +01:00