All of lore.kernel.org
 help / color / mirror / Atom feed
* EDD - set sysfs attr owner field
@ 2004-04-21 15:18 Matt Domsch
  0 siblings, 0 replies; only message in thread
From: Matt Domsch @ 2004-04-21 15:18 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, Michael_E_Brown

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]

Andrew, the patch below from Michael E. Brown properly sets the owner
field of a sysfs attribute.  Without this patch, it is possible to
crash the kernel with a simultaneous insmod/rmmod while reading files
exported by the module.

Thanks,
Matt

-- 
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com


# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/04/21 00:13:44-05:00 michael_e_brown@meb-laptop.michaels-house.net 
#   fix edd module unload race vs sysfs access
# 
# drivers/firmware/edd.c
#   2004/04/21 00:13:35-05:00 michael_e_brown@meb-laptop.michaels-house.net +1 -1
#   fix edd module unload race vs sysfs access
# 
diff -Nru a/drivers/firmware/edd.c b/drivers/firmware/edd.c
--- a/drivers/firmware/edd.c	Wed Apr 21 00:41:03 2004
+++ b/drivers/firmware/edd.c	Wed Apr 21 00:41:03 2004
@@ -86,7 +86,7 @@
 
 #define EDD_DEVICE_ATTR(_name,_mode,_show,_test) \
 struct edd_attribute edd_attr_##_name = { 	\
-	.attr = {.name = __stringify(_name), .mode = _mode },	\
+	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },	\
 	.show	= _show,				\
 	.test	= _test,				\
 };

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-21 15:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-21 15:18 EDD - set sysfs attr owner field Matt Domsch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.