Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5565502imw; Wed, 20 Jul 2022 08:05:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vPY+rvmt+zjAhCSLhKakktA0ZhxCHpWubJ3KYUlsLJsgLhuYsJpNlknNzJyvzCr4ORQ4Vx X-Received: by 2002:a05:6402:270c:b0:43a:d5f4:c4fa with SMTP id y12-20020a056402270c00b0043ad5f4c4famr51660468edd.107.1658329520714; Wed, 20 Jul 2022 08:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658329520; cv=none; d=google.com; s=arc-20160816; b=FQAUBHMqbdQMWYF3FZdpENOyFo/I59M8phgzY50VQDLVCshSyIvePfSEbzGDF8Lhdd 7xmx7D8+8TADCgCdR5jXYYzOlgusOs4XJ73Nto7O3pDdlnH9kfbI1uYR3ocYYxF3H1qs 1k2uiW1vCszm0mg9/52NnviEBO0jV9w3eGgOSPLrGAc0sFeERhcGeHOplYkzZi09hnol WOF9TFIV8uao4r/fCQ/9F7D5IF4qmG2R7UnUv7Y9yNr6Vm1elTwGU+rNhv9NnmE3qgF/ BJLPHbKrNKpeO7Wgw6lHkYYol8K6mZ+zprpejteWdgRKQuTpshwf685jNWrul/V744KQ z9FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=PUMNzOcke9F/E6l0+nSlaEl2q/BLzsi49G5O8oR/nQk=; b=LOJVEiUxx/vhAppOsPwBVNztp/vbfaVjc9md66lsv9LeCF+qOpVZMtqAMphYsi0FtL J9VO+y+vlcZ/ko5sn4JeEcCc7S1/yRMiHxyX9GNcU2vbkAum+LwvEr7xaDD6MyauXvJe oCM6ZYA+PZvZikUq577YrjhJipaA8g+IcStbY+OHKcHDYZ4sVW6pIJm1d5sGzLm82Ba6 8jIGoJA1liA/k0fdYEKDX1Y9A2kUuwiUJUSta+7RwZSLVfFbtI1o35CxPrlHvgsucgLD AuLWJwb0bxT9OAvrtPM0Dz7tGqnMhX6F2ZHeHeSxIUNsRZYiSBBTldazHJkxH9WlJf6F ZNcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=05e5XLBm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho12-20020a1709070e8c00b0072b67b81430si28466169ejc.577.2022.07.20.08.04.54; Wed, 20 Jul 2022 08:05:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=05e5XLBm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240631AbiGTOwi (ORCPT + 99 others); Wed, 20 Jul 2022 10:52:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239908AbiGTOwh (ORCPT ); Wed, 20 Jul 2022 10:52:37 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8F2A17A8A for ; Wed, 20 Jul 2022 07:52:35 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id b26so26494109wrc.2 for ; Wed, 20 Jul 2022 07:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=PUMNzOcke9F/E6l0+nSlaEl2q/BLzsi49G5O8oR/nQk=; b=05e5XLBmfccOHOTn5Xi23vWg8lqNJPD/R1R0dBx9OAM6rEtAjGyDb7fFMs3y3i/7oD /Ok5WoBVNnLuPSv+vaxNoWo7ozHczx628+bmwDooSBy4Ell7vhkiyYtko7XwBb+kbr/R BAjORV2J0Is7Zf5la7TDJ8tdimEtSTjqnhLmTWTo+VkhDV2SDH+8N+fLRE2KY7wZfezY T+8JyFzZ6P9hW/0ZmdZZ/B/Uv/FqGJI9SKb0Tf0iLP0d+exKHiujMl9frRdeNNWZHTAH i9rgvXBSrNV3XeYyu2mF/sA2JpA/OlBjHP/f6HQ3JwqaawYdWHZ7Uly6ofxMlSylDhlx Vy5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PUMNzOcke9F/E6l0+nSlaEl2q/BLzsi49G5O8oR/nQk=; b=EUE5RSljzcXQFaKafBliAVOAi5Ox3Ohx3jyfi663Lqdfl/CXINpU4LDs4N1n1Pd6rl /ATxUQbdmUezkEIupn6HZ4yofe6Uie/Poe1unRgFjMHctBHtDXTslhO4av7v142gm3IN iFXN/oFWp7ay0zLWUDqtiB4cUwGKyeCClFmiURj31jBQ3s3hfjMsDggaqQjZ6n0VXnCt YIy4jV5BYsoZUUyWi/vFm2+HpJ9VgrV8SejuYoZ5ioQ/1t9anDasblrOi4L8bXPTKxvi e3G4ED9s2HfDLoMSe4fNhg+VnEbnlBtrQV+SCaDQ3xZMdSwmfzF4atg/GYQGy4hwT2bj OfEA== X-Gm-Message-State: AJIora+yNuFTILroynVruX5wfHjX++OBwRbF2+ABagv/75y0Km0TR5+v E6d67cA/aiy5B7fY19QNuZ/9kCDWJexc2JwpNwgO X-Received: by 2002:a5d:4f8f:0:b0:21e:4f09:9e15 with SMTP id d15-20020a5d4f8f000000b0021e4f099e15mr1313451wru.55.1658328754216; Wed, 20 Jul 2022 07:52:34 -0700 (PDT) MIME-Version: 1.0 References: <20220707223228.1940249-1-fred@cloudflare.com> <20220707223228.1940249-5-fred@cloudflare.com> In-Reply-To: From: Paul Moore Date: Wed, 20 Jul 2022 10:52:23 -0400 Message-ID: Subject: Re: [PATCH v2 4/4] selinux: Implement create_user_ns hook To: Karl MacMillan Cc: Frederick Lawler , andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org, brauner@kernel.org, casey@schaufler-ca.com, daniel@iogearbox.net, ebiederm@xmission.com, eparis@parisplace.org, jackmanb@chromium.org, jmorris@namei.org, john.fastabend@gmail.com, kafai@fb.com, kernel-team@cloudflare.com, kpsingh@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, revest@chromium.org, selinux@vger.kernel.org, serge@hallyn.com, shuah@kernel.org, songliubraving@fb.com, stephen.smalley.work@gmail.com, yhs@fb.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2022 at 10:42 PM Karl MacMillan wrote: > On Thu, Jul 7, 2022 at 6:34 PM Frederick Lawler wro= te: >> >> Unprivileged user namespace creation is an intended feature to enable >> sandboxing, however this feature is often used to as an initial step to >> perform a privilege escalation attack. >> >> This patch implements a new namespace { userns_create } access control >> permission to restrict which domains allow or deny user namespace >> creation. This is necessary for system administrators to quickly protect >> their systems while waiting for vulnerability patches to be applied. >> >> This permission can be used in the following way: >> >> allow domA_t domB_t : namespace { userns_create }; > > > Isn=E2=80=99t this actually domA_t domA_t : namespace . . . > > I got confused reading this initially trying to figure out what the secon= d domain type would be, but looking at the code cleared that up. Ah, good catch, thanks Karl! --=20 paul-moore.com