From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752565AbdK2A0n (ORCPT ); Tue, 28 Nov 2017 19:26:43 -0500 Received: from mail-ua0-f193.google.com ([209.85.217.193]:43788 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbdK2A0l (ORCPT ); Tue, 28 Nov 2017 19:26:41 -0500 X-Google-Smtp-Source: AGs4zMaXtzBObjbwEuJQay1Wa4lK2lxY0NI6k45+0lQO29Zsg6+TLdASCrHBQ+O7zakqIM29HvhlC1ZMgVgHGV6cnoQ= MIME-Version: 1.0 In-Reply-To: References: <1511803118-2552-1-git-send-email-tixxdz@gmail.com> <1511803118-2552-6-git-send-email-tixxdz@gmail.com> <1100603534.56586.1511871419952@ichabod.co-bxl> <20171128193243.4fymnjk7fplqw62x@thunk.org> <708003731.69563.1511905898471@ichabod.co-bxl> From: Kees Cook Date: Tue, 28 Nov 2017 16:26:39 -0800 X-Google-Sender-Auth: JqA7GK84SE9u9D9tRMgZW3FJG9Y Message-ID: Subject: Re: [kernel-hardening] Re: [PATCH v5 next 5/5] net: modules: use request_module_cap() to load 'netdev-%s' modules To: Linus Torvalds Cc: Geo Kozey , LSM List , Linux Kernel Mailing List , "kernel-hardening@lists.openwall.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 28, 2017 at 4:17 PM, Linus Torvalds wrote: > But at the same time, if people can't even be bothered to try to > improve the general case, and only do things that you have to opt in > for, it really isn't much of an improvement. We had this whole Right, and I'm fine to help with those general improvements. As I mentioned in another reply, we've been steadily narrowing the exposures by keeping request_module() from being exposed to "all possible modules" in many of the places it's been exposed to userspace: 7f78e0351394 ("fs: Limit sys_mount to only request filesystem modules.") 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"") 4943ba16bbc2 ("crypto: include crypto- module prefix in template") I don't want you to think this is an area where work hasn't already been done to try to improve things. > The model that I am a proponent of is to take a softer approach > initially: don't forbid module loading (because that breaks users), > but instead _warn_ about non-root module loading. And then we can > start fixing the cases that we find. I am totally fine with this. The question I'm hoping to have answered is, "then what?" We already have concrete examples of module autoloading that will still be need to stay unprivileged and as-is in the kernel (even if we remove others). What do you see as the way to allow an admin to turn those off? -Kees -- Kees Cook Pixel Security From mboxrd@z Thu Jan 1 00:00:00 1970 From: keescook@chromium.org (Kees Cook) Date: Tue, 28 Nov 2017 16:26:39 -0800 Subject: [kernel-hardening] Re: [PATCH v5 next 5/5] net: modules: use request_module_cap() to load 'netdev-%s' modules In-Reply-To: References: <1511803118-2552-1-git-send-email-tixxdz@gmail.com> <1511803118-2552-6-git-send-email-tixxdz@gmail.com> <1100603534.56586.1511871419952@ichabod.co-bxl> <20171128193243.4fymnjk7fplqw62x@thunk.org> <708003731.69563.1511905898471@ichabod.co-bxl> Message-ID: To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Tue, Nov 28, 2017 at 4:17 PM, Linus Torvalds wrote: > But at the same time, if people can't even be bothered to try to > improve the general case, and only do things that you have to opt in > for, it really isn't much of an improvement. We had this whole Right, and I'm fine to help with those general improvements. As I mentioned in another reply, we've been steadily narrowing the exposures by keeping request_module() from being exposed to "all possible modules" in many of the places it's been exposed to userspace: 7f78e0351394 ("fs: Limit sys_mount to only request filesystem modules.") 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"") 4943ba16bbc2 ("crypto: include crypto- module prefix in template") I don't want you to think this is an area where work hasn't already been done to try to improve things. > The model that I am a proponent of is to take a softer approach > initially: don't forbid module loading (because that breaks users), > but instead _warn_ about non-root module loading. And then we can > start fixing the cases that we find. I am totally fine with this. The question I'm hoping to have answered is, "then what?" We already have concrete examples of module autoloading that will still be need to stay unprivileged and as-is in the kernel (even if we remove others). What do you see as the way to allow an admin to turn those off? -Kees -- Kees Cook Pixel Security -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Sender: keescook@google.com In-Reply-To: References: <1511803118-2552-1-git-send-email-tixxdz@gmail.com> <1511803118-2552-6-git-send-email-tixxdz@gmail.com> <1100603534.56586.1511871419952@ichabod.co-bxl> <20171128193243.4fymnjk7fplqw62x@thunk.org> <708003731.69563.1511905898471@ichabod.co-bxl> From: Kees Cook Date: Tue, 28 Nov 2017 16:26:39 -0800 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [kernel-hardening] Re: [PATCH v5 next 5/5] net: modules: use request_module_cap() to load 'netdev-%s' modules To: Linus Torvalds Cc: Geo Kozey , LSM List , Linux Kernel Mailing List , "kernel-hardening@lists.openwall.com" List-ID: On Tue, Nov 28, 2017 at 4:17 PM, Linus Torvalds wrote: > But at the same time, if people can't even be bothered to try to > improve the general case, and only do things that you have to opt in > for, it really isn't much of an improvement. We had this whole Right, and I'm fine to help with those general improvements. As I mentioned in another reply, we've been steadily narrowing the exposures by keeping request_module() from being exposed to "all possible modules" in many of the places it's been exposed to userspace: 7f78e0351394 ("fs: Limit sys_mount to only request filesystem modules.") 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"") 4943ba16bbc2 ("crypto: include crypto- module prefix in template") I don't want you to think this is an area where work hasn't already been done to try to improve things. > The model that I am a proponent of is to take a softer approach > initially: don't forbid module loading (because that breaks users), > but instead _warn_ about non-root module loading. And then we can > start fixing the cases that we find. I am totally fine with this. The question I'm hoping to have answered is, "then what?" We already have concrete examples of module autoloading that will still be need to stay unprivileged and as-is in the kernel (even if we remove others). What do you see as the way to allow an admin to turn those off? -Kees -- Kees Cook Pixel Security