diff options
author | Dan Williams <dan.j.williams@intel.com> | 2014-12-30 17:46:14 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2015-01-09 09:44:17 -0500 |
commit | ed09dcc8bd7fe0991af7737e675996cbd022f38f (patch) | |
tree | 1d789e23989575d366b2bf657c7b7fbf89772733 /include/linux/enclosure.h | |
parent | acd6d73826224c20c44f505f56b0503f022d695c (diff) |
ses: close potential registration race
The slot and address fields have a small window of instability when
userspace can read them before initialization. Separate
enclosure_component
allocation from registration.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Reviewed-by: Jens Axboe <axboe@fb.com>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/enclosure.h')
-rw-r--r-- | include/linux/enclosure.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 9a33c5f7e126..a835d335b924 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
@@ -120,8 +120,9 @@ enclosure_register(struct device *, const char *, int, | |||
120 | struct enclosure_component_callbacks *); | 120 | struct enclosure_component_callbacks *); |
121 | void enclosure_unregister(struct enclosure_device *); | 121 | void enclosure_unregister(struct enclosure_device *); |
122 | struct enclosure_component * | 122 | struct enclosure_component * |
123 | enclosure_component_register(struct enclosure_device *, unsigned int, | 123 | enclosure_component_alloc(struct enclosure_device *, unsigned int, |
124 | enum enclosure_component_type, const char *); | 124 | enum enclosure_component_type, const char *); |
125 | int enclosure_component_register(struct enclosure_component *); | ||
125 | int enclosure_add_device(struct enclosure_device *enclosure, int component, | 126 | int enclosure_add_device(struct enclosure_device *enclosure, int component, |
126 | struct device *dev); | 127 | struct device *dev); |
127 | int enclosure_remove_device(struct enclosure_device *, struct device *); | 128 | int enclosure_remove_device(struct enclosure_device *, struct device *); |