forked from rubenslte/android_kernel_samsung_msm8226
BACKPORT: module: add flags arg to sys_finit_module()
Thanks to Michael Kerrisk for keeping us honest. These flags are actually useful for eliminating the only case where kmod has to mangle a module's internals: for overriding module versioning. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Lucas De Marchi <lucas.demarchi@profusion.mobi> Acked-by: Kees Cook <keescook@chromium.org> (backported from Rusty's modules-next tree) BUG=None, keeping us in sync with upstream for this API TEST=daisy build, manual testing CQ-DEPEND=I5b5a9bee3f9e73eb076f01e8aacee51eff095c56 Change-Id: I40f0b55ff903dda411a04b088f4ca5b6ab5cf05e Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/37278 Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
This commit is contained in:
committed by
Francescodario Cuzzocrea
parent
4908705452
commit
af5dd2f171
+5
-2
@@ -3498,7 +3498,7 @@ static int init_module_permission(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE2(finit_module, int, fd, const char __user *, uargs)
|
||||
SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
|
||||
{
|
||||
int err;
|
||||
struct load_info info = { };
|
||||
@@ -3507,7 +3507,10 @@ SYSCALL_DEFINE2(finit_module, int, fd, const char __user *, uargs)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
pr_debug("finit_module: fd=%d, uargs=%p\n", fd, uargs);
|
||||
pr_debug("finit_module: fd=%d, uargs=%p, flags=%i\n", fd, uargs, flags);
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
if (fd < 0)
|
||||
return -ENOEXEC;
|
||||
|
||||
Reference in New Issue
Block a user