From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Morris Subject: Re: [PATCH v5 next 0/5] Improve Module autoloading infrastructure Date: Tue, 28 Nov 2017 10:44:52 +1100 (AEDT) Message-ID: References: <1511803118-2552-1-git-send-email-tixxdz@gmail.com> <20171128.041426.801732093971324601.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: Linus Torvalds , David Miller , Djalal Harouni , Andy Lutomirski , Andrew Morton , "Luis R. Rodriguez" , Ben Hutchings , Solar Designer , "Serge E. Hallyn" , Jessica Yu , Rusty Russell , LKML , linux-security-module , kernel-hardening@lists.openwall.com, Jonathan Corbet , Ingo Molnar , Network Development , Peter Zijlstra To: Kees Cook Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: List-Id: netdev.vger.kernel.org On Mon, 27 Nov 2017, Kees Cook wrote: > > if (WARN_ON_ONCE(!capable(CAP_SYS_MODULE) || > > !capable(CAP_SYS_ADMIN) || > > !capable(CAP_NET_ADMIN) || > > !unprivileged_autoload(module_name))) (Side note: the capable() calls would ideally come after the whitelist check). > We have some of this already with the module prefixes. Doing this > per-module would need to be exported to userspace, I think. It'd be > way too fragile sitting in the kernel. What about writing a whitelist to /proc (per-task) or /sys/fs (global) ? The per-task whitelist is inherited from the global one by default, or from a parent process if it's been modified in the parent. -- James Morris