Re: [PATCH v5 next 0/5] Improve Module autoloading infrastructure

From
James Morris <hidden>
Date
2017-11-27 22:32:55
Also in
linux-security-module, lkml
Reply to
David Miller, 2017-11-27
On Tue, 28 Nov 2017, David Miller wrote:
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon, 27 Nov 2017 10:41:30 -0800
quoted
What are the real life use-cases for normal users having modules
auto-load?
User opens SCTP socket, SCTP protocol module loads.

People build test cases via namespaces, and in that namespaces normal
users can setup virtual tunnel devices themselves, and those configure
operations can bring the tunnel module in.
What about implementing a white list of modules which are able to be 
loaded by unprivileged users?

Then, Linus' solution would look something like:

	va_start(args, fmt);
	ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
	va_end(args);

	if (WARN_ON_ONCE(!capable(CAP_SYS_MODULE) ||
                         !capable(CAP_SYS_ADMIN) ||
                         !capable(CAP_NET_ADMIN) ||
                         !unprivileged_autoload(module_name)))
		return -EPERM;



-- 
James Morris
[off-list ref]
Thread (49 messages) 49 messages, 11 authors, last reply 2017-11-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help