]> git.baikalelectronics.ru Git - kernel.git/commit
sysfs: don't block indefinitely for unmapped files.
authorEric W. Biederman <ebiederm@aristanetworks.com>
Wed, 4 Mar 2009 19:57:20 +0000 (11:57 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Mar 2009 23:38:26 +0000 (16:38 -0700)
commitb0f93c862e4f55b310be4e6bc74dcb09f723e7fa
treee9d7a8834eba3f19635f770f5d19bfe88a2485e4
parente5b00834dec48273330f20f99bbaa17f4f2f3011
sysfs: don't block indefinitely for unmapped files.

Modify sysfs bin files so that we can remove the bin file while they are
still mapped.  When the kobject is removed we unmap the bin file and
arrange for future accesses to the mapping to receive SIGBUS.

Implementing this prevents a nasty DOS when pci devices are hot plugged
and unplugged.  Where if any of their resources were mmaped the kernel
could not free up their pci resources or release their pci data
structures.

[akpm@linux-foundation.org: remove unused var]
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/bin.c
fs/sysfs/dir.c
fs/sysfs/sysfs.h