From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932377AbcAXWVL (ORCPT ); Sun, 24 Jan 2016 17:21:11 -0500 Received: from mail-oi0-f52.google.com ([209.85.218.52]:35626 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932324AbcAXWVD convert rfc822-to-8bit (ORCPT ); Sun, 24 Jan 2016 17:21:03 -0500 MIME-Version: 1.0 In-Reply-To: References: <1453502345-30416-1-git-send-email-keescook@chromium.org> <1453502345-30416-3-git-send-email-keescook@chromium.org> <1453510799.3734.153.camel@decadent.org.uk> From: Andy Lutomirski Date: Sun, 24 Jan 2016 14:20:42 -0800 Message-ID: Subject: Re: [kernel-hardening] Re: [PATCH 2/2] sysctl: allow CLONE_NEWUSER to be disabled To: Kees Cook Cc: "kernel-hardening@lists.openwall.com" , =?UTF-8?B?Um9iZXJ0IMWad2nEmWNraQ==?= , "Serge E. Hallyn" , Andrew Morton , Al Viro , Richard Weinberger , "Eric W. Biederman" , Dmitry Vyukov , David Howells , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Sasha Levin , "linux-doc@vger.kernel.org" , LKML Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 24, 2016 at 12:59 PM, Kees Cook wrote: > On Fri, Jan 22, 2016 at 4:59 PM, Ben Hutchings wrote: >> On Fri, 2016-01-22 at 15:00 -0800, Kees Cook wrote: >>> On Fri, Jan 22, 2016 at 2:55 PM, Robert Święcki wrote: >>> > 2016-01-22 23:50 GMT+01:00 Kees Cook : >>> > >>> > > > Seems that Debian and some older Ubuntu versions are already using >>> > > > >>> > > > $ sysctl -a | grep usern >>> > > > kernel.unprivileged_userns_clone = 0 >>> > > > >>> > > > Shall we be consistent wit it? >>> > > >>> > > Oh! I didn't see that on systems I checked. On which version did you find that? >>> > >>> > $ uname -a >>> > Linux bc1 4.3.0-0.bpo.1-amd64 #1 SMP Debian 4.3.3-5~bpo8+1 >>> > (2016-01-07) x86_64 GNU/Linux >>> > $ cat /etc/debian_version >>> > 8.2 >>> >>> Ah-ha, Debian only, though it looks like this was just committed to >>> the Ubuntu kernel tree too: >>> >>> >>> > IIRC some older kernels delivered with Ubuntu Precise were also using >>> > it (but maybe I'm mistaken) >>> >>> I don't see it there. >>> >>> I think my patch is more complete, but I'm happy to change the name if >>> this sysctl has already started to enter the global consciousness. ;) >>> >>> Serge, Ben, what do you think? >> >> I agree that using the '_restrict' suffix for new restrictions makes >> sense. I also don't think that a third possible value for >> kernel.unprivileged_userns_clone would would be understandable. >> >> I would probably make kernel.unprivileged_userns_clone a wrapper for >> kernel.userns_restrict in Debian, then deprecate and eventually remove >> it. > > Okay, cool. We'll keep my patch as-is then. Thanks! We still need to deal with the capable check in the write handler though, right? But I must be missing something: why is mode 0644 insufficient? --Andy