Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1959428imn; Mon, 1 Aug 2022 06:20:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4zdlItsXSHZ3f+MgfM+SOZglSQ6trCsOBGocfRZWFd5VOUCoqX/pTv3k+EFvXBvYV6tZlU X-Received: by 2002:a63:8748:0:b0:41b:fa46:7118 with SMTP id i69-20020a638748000000b0041bfa467118mr5153054pge.281.1659360050332; Mon, 01 Aug 2022 06:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659360050; cv=none; d=google.com; s=arc-20160816; b=bOi0z0afiCiY57R5aP56bHNf5L30RmRhdS8+se28ATkY1Pf9LGfKZxDOtq5kPeFMFF g+n3kSYKTLYFu/g6ZafVC1Y3T3kIT5QoREqoexWyJKTNMc66SCLihnDF9tH9EnKA18/x 6ZuNmML9iCa8boordJBhCGRWLARRIlxg2OtA4GsucH4yKC1L2R3GTsyIFaIBPzp5Oub3 fz5mMGeANOoMIJe4RYqizQPBAoNiukMF10Fzs37/NcsX3vjuSEvpe6rl+Wxf/wbiyxPf XBO5onpn/sHSR03eFZz+6SSp7F+3CMafOASHYIT/GBk6HVA2oCye1x9RvkwtY/rXfeBw jeEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=S4v2xzmivjkPNxxCfifaPK4xR7fi1R2DYRzw0gzDhqk=; b=fTaPkq5RoETAja06igcni4t0CGAIPE2Zw3WOC76i8EtH/4JyXjxXVpTHSX/M6JgHek DTFY9RYRUNo3oRnHvF2C2Fl+YtNbsgtTbOzIhz89ceWrwX9gDhGI8XUIUD6+uhQWahHl KE/xWFoVNLs2EnU0dlceZ/lQBXvatnIew9+xnIY/4kMDEVLJEiQOC8IEUhHwOzaeie8D KV0adyxe8C0r38ziZteQIoKvM4itdPqNJYBWPE5CNbAMuwkIE+PwJ5JwNyz5r1htLThb SQz1yI4tAdeai/JWK4eonH9PkKW+YdanO/cPUOtx+7El8NOwDD3VwJQ3v8Qm6Lab6uvY BYPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b="aU/EMjwv"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc22-20020a656d96000000b0041c359673a9si1225374pgb.728.2022.08.01.06.20.34; Mon, 01 Aug 2022 06:20:50 -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=@cloudflare.com header.s=google header.b="aU/EMjwv"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231749AbiHANN7 (ORCPT + 99 others); Mon, 1 Aug 2022 09:13:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbiHANN6 (ORCPT ); Mon, 1 Aug 2022 09:13:58 -0400 Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAC4C255A5 for ; Mon, 1 Aug 2022 06:13:55 -0700 (PDT) Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-10ea30a098bso8711308fac.8 for ; Mon, 01 Aug 2022 06:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=S4v2xzmivjkPNxxCfifaPK4xR7fi1R2DYRzw0gzDhqk=; b=aU/EMjwvPmQHuC3EBkgE95P1u4OscFyLNRNnnObQ+qrX4FI5VdaEavlkuJv0eLaafS LRfaSM+ftYFZBzQXUQVTjMlxhJ82TBVrX2MBIhQvsXC+TEYUHrHEHfxiIZvTEcQvnkne otTWe5IN176ijSIBTW+IPCt5doE2JAB8vJu0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=S4v2xzmivjkPNxxCfifaPK4xR7fi1R2DYRzw0gzDhqk=; b=TlD/cxUdYooqHLqCoF5rSnrnfBGPpcPqHumlrINhKdFvG6SvIikII3ii0vrfN20qXO r5CfqLVQiAhNKQaP38DJy8hV0TP5O5SRtk+S+56De5UUTSiJSu0d9ZnSaqogi2J/P6rt B4hOG98C2Azwv6RQXIoB+Ixd/hH+JZVz0n+Vzw3Fo6fYwh++lGL02pP/GQoNYIwFFJcE zm1qNAUlBJch47s9XYZqrCz5JiIx4A89lHyqZY2Ax2VZFF8IMVlaBlTtRnEwwHFxCCIT 4+DLnR9RQnKfueGlzlfsnjbW/hVR6BogzVNTR97umqsxWxc8mCCF3TBxrmY2kyFx3715 xBbg== X-Gm-Message-State: AJIora/+AnLJBwhqH+4kCm9aTs2Zh5u904ciTXOqgeMFE5yBOVoETQ1K 3wMemVVt9uW/MJkABDLhWudy3A== X-Received: by 2002:a05:6870:f149:b0:de:e873:4a46 with SMTP id l9-20020a056870f14900b000dee8734a46mr6761101oac.286.1659359635202; Mon, 01 Aug 2022 06:13:55 -0700 (PDT) Received: from [192.168.0.41] ([184.4.90.121]) by smtp.gmail.com with ESMTPSA id 22-20020aca2816000000b00339ff117f38sm2400911oix.53.2022.08.01.06.13.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Aug 2022 06:13:54 -0700 (PDT) Message-ID: Date: Mon, 1 Aug 2022 08:13:57 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 0/4] Introduce security_create_user_ns() Content-Language: en-US To: Paul Moore , Martin KaFai Lau Cc: kpsingh@kernel.org, revest@chromium.org, jackmanb@chromium.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, shuah@kernel.org, brauner@kernel.org, casey@schaufler-ca.com, ebiederm@xmission.com, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kernel-team@cloudflare.com, cgzones@googlemail.com, karl@bigbadwolfsecurity.com References: <20220721172808.585539-1-fred@cloudflare.com> <20220722061137.jahbjeucrljn2y45@kafai-mbp.dhcp.thefacebook.com> <18225d94bf0.28e3.85c95baa4474aabc7814e68940a78392@paul-moore.com> From: Frederick Lawler In-Reply-To: <18225d94bf0.28e3.85c95baa4474aabc7814e68940a78392@paul-moore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 7/22/22 7:20 AM, Paul Moore wrote: > On July 22, 2022 2:12:03 AM Martin KaFai Lau wrote: > >> On Thu, Jul 21, 2022 at 12:28:04PM -0500, Frederick Lawler wrote: >>> While creating a LSM BPF MAC policy to block user namespace creation, we >>> used the LSM cred_prepare hook because that is the closest hook to prevent >>> a call to create_user_ns(). >>> >>> The calls look something like this: >>> >>> cred = prepare_creds() >>> security_prepare_creds() >>> call_int_hook(cred_prepare, ... >>> if (cred) >>> create_user_ns(cred) >>> >>> We noticed that error codes were not propagated from this hook and >>> introduced a patch [1] to propagate those errors. >>> >>> The discussion notes that security_prepare_creds() >>> is not appropriate for MAC policies, and instead the hook is >>> meant for LSM authors to prepare credentials for mutation. [2] >>> >>> Ultimately, we concluded that a better course of action is to introduce >>> a new security hook for LSM authors. [3] >>> >>> This patch set first introduces a new security_create_user_ns() function >>> and userns_create LSM hook, then marks the hook as sleepable in BPF. >> Patch 1 and 4 still need review from the lsm/security side. > > > This patchset is in my review queue and assuming everything checks out, I expect to merge it after the upcoming merge window closes. > > I would also need an ACK from the BPF LSM folks, but they're CC'd on this patchset. > Based on last weeks comments, should I go ahead and put up v4 for 5.20-rc1 when that drops, or do I need to wait for more feedback? > -- > paul-moore.com > >