Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module update from Rusty Russell:
"Nothing major: support for compressing modules, and auto-tainting
params.
PS. My virtio-next tree is empty: DaveM took the patches I had. There
might be a virtio-rng starvation fix, but so far it's a bit voodoo
so I will get to that in the next two days or it will wait"
* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
moduleparam: Resolve missing-field-initializer warning
kbuild: handle module compression while running 'make modules_install'.
modinst: wrap long lines in order to enhance cmd_modules_install
modsign: lookup lines ending in .ko in .mod files
modpost: simplify file name generation of *.mod.c files
modpost: reduce visibility of symbols and constify r/o arrays
param: check for tainting before calling set op.
drm/i915: taint the kernel if unsafe module parameters are set
module: add module_param_unsafe and module_param_named_unsafe
module: make it possible to have unsafe, tainting module params
module: rename KERNEL_PARAM_FL_NOARG to avoid confusion
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ static int param_set_bool_enable_only(const char *val,
|
||||
}
|
||||
|
||||
static const struct kernel_param_ops param_ops_bool_enable_only = {
|
||||
.flags = KERNEL_PARAM_FL_NOARG,
|
||||
.flags = KERNEL_PARAM_OPS_FL_NOARG,
|
||||
.set = param_set_bool_enable_only,
|
||||
.get = param_get_bool,
|
||||
};
|
||||
|
||||
+14
-3
@@ -83,6 +83,15 @@ bool parameq(const char *a, const char *b)
|
||||
return parameqn(a, b, strlen(a)+1);
|
||||
}
|
||||
|
||||
static void param_check_unsafe(const struct kernel_param *kp)
|
||||
{
|
||||
if (kp->flags & KERNEL_PARAM_FL_UNSAFE) {
|
||||
pr_warn("Setting dangerous option %s - tainting kernel\n",
|
||||
kp->name);
|
||||
add_taint(TAINT_USER, LOCKDEP_STILL_OK);
|
||||
}
|
||||
}
|
||||
|
||||
static int parse_one(char *param,
|
||||
char *val,
|
||||
const char *doing,
|
||||
@@ -104,11 +113,12 @@ static int parse_one(char *param,
|
||||
return 0;
|
||||
/* No one handled NULL, so do it here. */
|
||||
if (!val &&
|
||||
!(params[i].ops->flags & KERNEL_PARAM_FL_NOARG))
|
||||
!(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG))
|
||||
return -EINVAL;
|
||||
pr_debug("handling %s with %p\n", param,
|
||||
params[i].ops->set);
|
||||
mutex_lock(¶m_lock);
|
||||
param_check_unsafe(¶ms[i]);
|
||||
err = params[i].ops->set(val, ¶ms[i]);
|
||||
mutex_unlock(¶m_lock);
|
||||
return err;
|
||||
@@ -318,7 +328,7 @@ int param_get_bool(char *buffer, const struct kernel_param *kp)
|
||||
EXPORT_SYMBOL(param_get_bool);
|
||||
|
||||
struct kernel_param_ops param_ops_bool = {
|
||||
.flags = KERNEL_PARAM_FL_NOARG,
|
||||
.flags = KERNEL_PARAM_OPS_FL_NOARG,
|
||||
.set = param_set_bool,
|
||||
.get = param_get_bool,
|
||||
};
|
||||
@@ -369,7 +379,7 @@ int param_set_bint(const char *val, const struct kernel_param *kp)
|
||||
EXPORT_SYMBOL(param_set_bint);
|
||||
|
||||
struct kernel_param_ops param_ops_bint = {
|
||||
.flags = KERNEL_PARAM_FL_NOARG,
|
||||
.flags = KERNEL_PARAM_OPS_FL_NOARG,
|
||||
.set = param_set_bint,
|
||||
.get = param_get_int,
|
||||
};
|
||||
@@ -552,6 +562,7 @@ static ssize_t param_attr_store(struct module_attribute *mattr,
|
||||
return -EPERM;
|
||||
|
||||
mutex_lock(¶m_lock);
|
||||
param_check_unsafe(attribute->param);
|
||||
err = attribute->param->ops->set(buf, attribute->param);
|
||||
mutex_unlock(¶m_lock);
|
||||
if (!err)
|
||||
|
||||
Reference in New Issue
Block a user