diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 20:34:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 20:34:29 -0400 |
commit | 3398d252a4da80c47fe9b802184fa0a792387732 (patch) | |
tree | 3def3b476b597487193718508f5644a6075a736f /include | |
parent | 27703bb4a66df49ff16b44b864d307d2eb71774c (diff) | |
parent | 942e443127e928a5631c3d5102aca8c8b3c2dd98 (diff) |
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module updates from Rusty Russell:
"Minor fixes mainly, including a potential use-after-free on remove
found by CONFIG_DEBUG_KOBJECT_RELEASE which may be theoretical"
* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
module: Fix mod->mkobj.kobj potentially freed too early
kernel/params.c: use scnprintf() instead of sprintf()
kernel/module.c: use scnprintf() instead of sprintf()
module/lsm: Have apparmor module parameters work with no args
module: Add NOARG flag for ops with param_set_bool_enable_only() set function
module: Add flag to allow mod params to have no arguments
modules: add support for soft module dependencies
scripts/mod/modpost.c: permit '.cranges' secton for sh64 architecture.
module: fix sprintf format specifier in param_get_byte()
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/module.h | 6 | ||||
-rw-r--r-- | include/linux/moduleparam.h | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 46f1ea01e6f6..05f2447f8c15 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -42,6 +42,7 @@ struct module_kobject { | |||
42 | struct module *mod; | 42 | struct module *mod; |
43 | struct kobject *drivers_dir; | 43 | struct kobject *drivers_dir; |
44 | struct module_param_attrs *mp; | 44 | struct module_param_attrs *mp; |
45 | struct completion *kobj_completion; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | struct module_attribute { | 48 | struct module_attribute { |
@@ -97,6 +98,11 @@ extern const struct gtype##_id __mod_##gtype##_table \ | |||
97 | /* For userspace: you can also call me... */ | 98 | /* For userspace: you can also call me... */ |
98 | #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) | 99 | #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) |
99 | 100 | ||
101 | /* Soft module dependencies. See man modprobe.d for details. | ||
102 | * Example: MODULE_SOFTDEP("pre: module-foo module-bar post: module-baz") | ||
103 | */ | ||
104 | #define MODULE_SOFTDEP(_softdep) MODULE_INFO(softdep, _softdep) | ||
105 | |||
100 | /* | 106 | /* |
101 | * The following license idents are currently accepted as indicating free | 107 | * The following license idents are currently accepted as indicating free |
102 | * software modules | 108 | * software modules |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 27d9da3f86ff..c3eb102a9cc8 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -36,7 +36,18 @@ static const char __UNIQUE_ID(name)[] \ | |||
36 | 36 | ||
37 | struct kernel_param; | 37 | struct kernel_param; |
38 | 38 | ||
39 | /* | ||
40 | * Flags available for kernel_param_ops | ||
41 | * | ||
42 | * NOARG - the parameter allows for no argument (foo instead of foo=1) | ||
43 | */ | ||
44 | enum { | ||
45 | KERNEL_PARAM_FL_NOARG = (1 << 0) | ||
46 | }; | ||
47 | |||
39 | struct kernel_param_ops { | 48 | struct kernel_param_ops { |
49 | /* How the ops should behave */ | ||
50 | unsigned int flags; | ||
40 | /* Returns 0, or -errno. arg is in kp->arg. */ | 51 | /* Returns 0, or -errno. arg is in kp->arg. */ |
41 | int (*set)(const char *val, const struct kernel_param *kp); | 52 | int (*set)(const char *val, const struct kernel_param *kp); |
42 | /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ | 53 | /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ |
@@ -187,7 +198,7 @@ struct kparam_array | |||
187 | /* Obsolete - use module_param_cb() */ | 198 | /* Obsolete - use module_param_cb() */ |
188 | #define module_param_call(name, set, get, arg, perm) \ | 199 | #define module_param_call(name, set, get, arg, perm) \ |
189 | static struct kernel_param_ops __param_ops_##name = \ | 200 | static struct kernel_param_ops __param_ops_##name = \ |
190 | { (void *)set, (void *)get }; \ | 201 | { 0, (void *)set, (void *)get }; \ |
191 | __module_param_call(MODULE_PARAM_PREFIX, \ | 202 | __module_param_call(MODULE_PARAM_PREFIX, \ |
192 | name, &__param_ops_##name, arg, \ | 203 | name, &__param_ops_##name, arg, \ |
193 | (perm) + sizeof(__check_old_set_param(set))*0, -1) | 204 | (perm) + sizeof(__check_old_set_param(set))*0, -1) |