Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1172281AbdDXOZx (ORCPT ); Mon, 24 Apr 2017 10:25:53 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34902 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164722AbdDXOZm (ORCPT ); Mon, 24 Apr 2017 10:25:42 -0400 MIME-Version: 1.0 In-Reply-To: References: <1492640420-27345-1-git-send-email-tixxdz@gmail.com> <1492640420-27345-3-git-send-email-tixxdz@gmail.com> From: Djalal Harouni Date: Mon, 24 Apr 2017 16:25:40 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] modules:capabilities: add a per-task modules autoload restriction To: Kees Cook Cc: Andy Lutomirski , Linux Kernel Mailing List , Andrew Morton , "Serge E. Hallyn" , "kernel-hardening@lists.openwall.com" , LSM List , Linux API , Dongsu Park , Casey Schaufler , James Morris , Paul Moore , Tetsuo Handa , Greg Kroah-Hartman , Jonathan Corbet , Jessica Yu , Rusty Russell , Arnaldo Carvalho de Melo , Mauro Carvalho Chehab , Ingo Molnar , belakhdar abdeldjalil , Peter Zijlstra Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1652 Lines: 43 On Sat, Apr 22, 2017 at 9:29 PM, Kees Cook wrote: > On Fri, Apr 21, 2017 at 11:51 PM, Andy Lutomirski wrote: >> On Fri, Apr 21, 2017 at 5:12 PM, Djalal Harouni wrote: >>> On Sat, Apr 22, 2017 at 1:51 AM, Andy Lutomirski wrote: >>> [...] >>> * DCCP use after free CVE-2017-6074 >>> * n_hldc CVE-2017-2636 >>> * XFRM framework CVE-2017-7184 >>> * L2TPv3 CVE-2016-10200 >>> >>> Most of these need CAP_NET_ADMIN to be autoloaded, however we also >>> need CAP_NET_ADMIN for other things... therefore it is better to have >>> an extra facility that could coexist with CAP_NET_ADMIN and other >>> sandbox features. >>> >> >> I agree that the feature is important, but I think your implementation >> is needlessly dangerous. I imagine that the main uses that you care >> about involve containers. How about doing it in a safer way that >> works for containers? I can think of a few. For example: >> >> 1. A sysctl that, if set, prevents autoloading outside the root >> userns. This isn't very flexible at all, but it might work. >> >> 2. Your patch, but require privilege within the calling namespace to >> set the prctl. > > How about CAP_SYS_ADMIN || no_new_privs? > > -Kees > Yes I can update as per Andy suggestion to require privileges inside the calling namespace to set prctl. Other options that are not prctl based have more variants, that make them hard to use. So I would got with CAP_SYS_ADMIN in the calling userns || no_new_privs , I would have said CAP_SYS_MODULE in the userns but it seems better to standardize on CAP_SYS_ADMIN to set the prctl. -- tixxdz