Received: by 2002:a05:6830:16d2:b0:61c:ac69:ca1b with SMTP id l18csp43470otr; Tue, 2 Aug 2022 15:42:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vTBa2KNYfH4PeN/gJRsLSh5uBlFEYzQ8J7Z8HAb93fZF2elT2OLlPJBAfN2jmuHTyMQZIR X-Received: by 2002:a17:907:7292:b0:72f:d76:b243 with SMTP id dt18-20020a170907729200b0072f0d76b243mr17997510ejc.230.1659480144305; Tue, 02 Aug 2022 15:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659480144; cv=none; d=google.com; s=arc-20160816; b=HPaRvp1qIKzPBptBoQZMCJxeaD03r7VGBwYshjpmEPFBzOh46oyeiS6OEc3YwGAUZC oQsD/BYXRvnYmpgALczvKIKWXHqG3q3kuUmrF4fh5lFrFJDkQpVdnjmuGNTfGQoVBFLB /u3rhMw/pW35XtDtQs4KrxUT4VgTSQOGeEZvymjza2+0zFio/fJW6knJ/L/+nzlWiTYZ +hQ2mXtSxWvR4JQT/szz2wUC8Aqxs8xD0ulCu3eYYRYDUKwvtSd1KY27Y6cGudNDeTnr +CeVUMi90B2OWcdhsWZYgzrozMj44KiFVlRhApnpYZAP1XMW1AdG7AWVFehdZ+jnkL7G /aEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JhfxA3fzhiFdey/18EBXsznHFUblEWmRdFNmlBS/VkU=; b=nlOpSGqeGW+ffsfA5NG3ikFtzZTheFTsanNGWiCuH10DkwXfemTXRs3ZpA27FAGRy3 vHfGZz3yTmLLRKD8q+KwmYXfri6NXVTCUN3WtdsElxyun2EVrkWoun462oi9BTD6ghr+ o8bWqxfZnz28TD1e+oZzmb10cVtV1txOkzfsQePBB6v0Bn3hH0CS3ZmsBD3Z9ch5qDLy SbbUt4ulSZCAXkT6YhpAdCPTOJzEqbhsHbc8exgGCfYRkR94M+wU3tS4V6T3bHun5uBC A3twqPCjl+5ZuEwYCAkjmotqCSUBzOPsIudrrpLaLHzXPAL4uArmEbqM2Q2PBkE+KvdB Se9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mwc0mJ/U"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f14-20020a17090631ce00b0072b452acb53si3324116ejf.875.2022.08.02.15.41.59; Tue, 02 Aug 2022 15:42:24 -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=@kernel.org header.s=k20201202 header.b="mwc0mJ/U"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234385AbiHBWJH (ORCPT + 99 others); Tue, 2 Aug 2022 18:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiHBWJF (ORCPT ); Tue, 2 Aug 2022 18:09:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 499561D0E1 for ; Tue, 2 Aug 2022 15:09:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D9DB461575 for ; Tue, 2 Aug 2022 22:09:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46E45C433C1 for ; Tue, 2 Aug 2022 22:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659478144; bh=FcdHNfXuQiJB9HM66+G68cqs7BlM13zGpj+qnB1hK7Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mwc0mJ/Uagxs63fdJ+TLVG3mhnFR4VGPxxOjmn5oiMB8BQud58sGsuAPuA24OkUhF 997xHQkIq6P2In0oUqnXvW4avG4GxfsQHBbJFkWAu1yF6ZIMcGOg93CoxQga5vSR+o eTgI07G4JLKJ9kETODLdvZX3i8ZmDlIctv7rmJF5CrNIirBCAxjwvhHeUzFZeeRmfH U2zDHnBz/u+RSon9OzX+HeJEo2qB9OK/IOJu75UWUMcMd6XHp5rSPUF1rL+ORpz55I rfJA0UzdiKngh2f145eitGYoz/MvP1S68gKxsIDgTHjhGDFPFqkObZxaYIQuP5jzlo Asq0za7Wvsvtg== Received: by mail-yb1-f175.google.com with SMTP id g5so1333515ybg.11 for ; Tue, 02 Aug 2022 15:09:04 -0700 (PDT) X-Gm-Message-State: ACgBeo3iv+hbO+1lX2cVTbdWiU943IUeSsa3GgvFtJo+5Y7Vm9hPIqIq WqzYL110vFtKiMIvDrpSfRu+uWXrtwpKM2YlOfRW8g== X-Received: by 2002:a81:14c7:0:b0:328:25f0:9c89 with SMTP id 190-20020a8114c7000000b0032825f09c89mr2602862ywu.476.1659478133089; Tue, 02 Aug 2022 15:08:53 -0700 (PDT) MIME-Version: 1.0 References: <20220801180146.1157914-1-fred@cloudflare.com> <20220801180146.1157914-4-fred@cloudflare.com> In-Reply-To: <20220801180146.1157914-4-fred@cloudflare.com> From: KP Singh Date: Wed, 3 Aug 2022 00:08:42 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 3/4] selftests/bpf: Add tests verifying bpf lsm userns_create hook To: Frederick Lawler Cc: revest@chromium.org, jackmanb@chromium.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, jmorris@namei.org, serge@hallyn.com, paul@paul-moore.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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Mon, Aug 1, 2022 at 8:02 PM Frederick Lawler wrote: > > The LSM hook userns_create was introduced to provide LSM's an > opportunity to block or allow unprivileged user namespace creation. This > test serves two purposes: it provides a test eBPF implementation, and > tests the hook successfully blocks or allows user namespace creation. > > This tests 3 cases: > > 1. Unattached bpf program does not block unpriv user namespace > creation. > 2. Attached bpf program allows user namespace creation given > CAP_SYS_ADMIN privileges. > 3. Attached bpf program denies user namespace creation for a > user without CAP_SYS_ADMIN. > > Signed-off-by: Frederick Lawler Looks good to me (Also checked it on vmtest.sh) Acked-by: KP Singh