Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp679220rdb; Thu, 30 Nov 2023 15:39:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8YdzUmyqA4DgTr+IqijJ7AeCmHvOw7BmOyU0wpmg6hLF4CV58wHWGQvAjcfUGgrKpSk8V X-Received: by 2002:a17:90b:3a8b:b0:285:cc9c:75a6 with SMTP id om11-20020a17090b3a8b00b00285cc9c75a6mr17560672pjb.32.1701387542858; Thu, 30 Nov 2023 15:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701387542; cv=none; d=google.com; s=arc-20160816; b=D6g2Oszw0+fVYtBP+Bu1oLXiixqUlnS47N4/lrVJwiwJaKiFXCe39Ng8R0wq2fuOhs SP9V6Ra0infXxDUz6780s2JEtik4sJAi5CX97Qc44fRXgG6eDSWLmLmS3l4oJOU0QzYM OihVwUkRN4VNHlwW3hLdXGmM/ciA+9TSOg0JJ9kkrrgJ6iKa/U+1EzFnxCcpI9aELRzO A6abtO13UaofCpO2igqUidMqCyWvTOufIXdgfwAlVp87yFO3aDoKhfWmuRVJ9Nt7/uRI bI530FlsU0fwlK1aM9T29zjCvWatwW5eX8jtxFiKIGqHZZcoAk/GVja7QzSQ5rZ0ZT3G IVhQ== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=B8VSO3h3YSEqNeVJ9Fi67nw8jeBYbkM3BVJqSu9EWHk=; fh=CbVmcaLNT9cbMYfb9e/4qkiVDgnya4up4hbFu0qdCTk=; b=kZ/EEJiExsp6A4Yc9Pw0lAi4eARTo3JmZ7AtL4PG4BUAbJKVxYz868ngF44T4t6KEG zQgIpUWpxDfLNk2vE8OrWKjIuZoSa3PrMyFyNEGEjTOjYsbib6VRu6LQ/mG2+3KDmwJ7 qzTuw2D3KIIQPgeB6FgTZVBEdXsqTmVuE+8YUWZ5v3oDEYeJImzYvbIHisrlI+aIWEgz UOoqOOk0hVgzMPvK79ttiaFa1lJlRP2cdx5dAJjf+BPXDcCsSrOR+3ZE1T9kmC6pxyVZ /k02IX1FFz9SueRKwdGnVFsIXefzbiLAXQL51TnNpJJD+khexvNEy7f1aBZdCM4M84Sq aOBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=DqR0Teck; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x10-20020a17090a970a00b0028000d77e32si2334950pjo.23.2023.11.30.15.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 15:39:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=DqR0Teck; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4185B80F5F21; Thu, 30 Nov 2023 15:39:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377297AbjK3Xik (ORCPT + 99 others); Thu, 30 Nov 2023 18:38:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377292AbjK3Xij (ORCPT ); Thu, 30 Nov 2023 18:38:39 -0500 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F56310F8 for ; Thu, 30 Nov 2023 15:38:44 -0800 (PST) Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-7b37a2e6314so18488039f.1 for ; Thu, 30 Nov 2023 15:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1701387524; x=1701992324; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=B8VSO3h3YSEqNeVJ9Fi67nw8jeBYbkM3BVJqSu9EWHk=; b=DqR0TeckTPH0f/xMcGeWS4IKoZaabx6L4jisrC9MW3J44g1ChAieZOWI8HNHUO2sNU ka+h21TdBDLx5ILIEyuke1ohSusAkQYjJ/pegmu3lJlY4l1+n9XCIVE5cEZnrnTvllo6 qYWtTuYq/3Ie3VHgbpskXgXxWrKWHfyi5gm/w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701387524; x=1701992324; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B8VSO3h3YSEqNeVJ9Fi67nw8jeBYbkM3BVJqSu9EWHk=; b=aLE94P6ATH2FfudpEhzhNLhXd1BeEYPJUbJ14uU0EQ6tJYt7jrjCHO9c/5AlGY+FJi hreyn+ND/HaEupEl7S3G93UF30fe3G4pQFdZ0gfQjYn850jeRhCj5+4rZ6YhGpY2t1E+ XIlBrSpjKrgdMUCdJnWAt3Ws3lLmt3J1uL51yzypugXxWzTwNt0WotqG//oLigQOeI/3 WbQLGn9O7q2iLTmsi3GJ8oUXCpUIi3/jKT57cliZlO+ttIJqN0d3gNFjDYpwdJxL9+A8 5uOvx5rc/tmUZnIlwa9WIzg2aYxO+3wdkdxRnS8U9sKv+1ukdU3T+VQLpaDLgK5qULef r7hA== X-Gm-Message-State: AOJu0Yxoap6xLx05E5MDUxc1I++hnkZMbtPD5LhPQvQv76Cei1R3K3y8 rvnl7dLf4H+dcjIcbM7RWUuW/g== X-Received: by 2002:a6b:6915:0:b0:7b0:aea8:2643 with SMTP id e21-20020a6b6915000000b007b0aea82643mr3960976ioc.1.1701387523699; Thu, 30 Nov 2023 15:38:43 -0800 (PST) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id ft18-20020a056638661200b004667eb7fd91sm565078jab.101.2023.11.30.15.38.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Nov 2023 15:38:43 -0800 (PST) Message-ID: <7900802c-3860-4a52-aede-edc544461a57@linuxfoundation.org> Date: Thu, 30 Nov 2023 16:38:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] selftests: capabilities: namespace create varies for root and normal user Content-Language: en-US To: Swarup Laxman Kotiaklapudi , shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, luto@kernel.org, Shuah Khan References: <20231111173806.16775-1-swarupkotikalapudi@gmail.com> From: Shuah Khan In-Reply-To: <20231111173806.16775-1-swarupkotikalapudi@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 15:39:00 -0800 (PST) On 11/11/23 10:38, Swarup Laxman Kotiaklapudi wrote: > This patchset fixes TODO: > "If we're already root, we could skip creating the userns." > > Change namespace creation for root and non-root > user differently in create_and_enter_ns() function > in this file: > tools/testing/selftests/capabilities/test_execve.c > > Test result with root user: > $sudo make TARGETS="capabilities" kselftest > ... > TAP version 13 > 1..1 > timeout set to 45 > selftests: capabilities: test_execve > TAP version 13 > 1..12 > [RUN] +++ Tests with uid == 0 +++ > [NOTE] Using global UIDs for tests > [RUN] Root => ep > ... > ok 12 Passed > Totals: pass:12 fail:0 xfail:0 xpass:0 skip:0 error:0 > ================================================== > TAP version 13 > 1..9 > [RUN] +++ Tests with uid != 0 +++ > [NOTE] Using global UIDs for tests > [RUN] Non-root => no caps > ... > ok 9 Passed > Totals: pass:9 fail:0 xfail:0 xpass:0 skip:0 error:0 > > Test result without root or normal user: > $make TARGETS="capabilities" kselftest > ... > timeout set to 45 > selftests: capabilities: test_execve > TAP version 13 > 1..12 > [RUN] +++ Tests with uid == 0 +++ > [NOTE] Using a user namespace for tests > [RUN] Root => ep > validate_cap:: Capabilities after execve were correct > ok 1 Passed > Check cap_ambient manipulation rules > ok 2 PR_CAP_AMBIENT_RAISE failed on non-inheritable cap > ok 3 PR_CAP_AMBIENT_RAISE failed on non-permitted cap > ok 4 PR_CAP_AMBIENT_RAISE worked > ok 5 Basic manipulation appears to work > [RUN] Root +i => eip > validate_cap:: Capabilities after execve were correct > ok 6 Passed > [RUN] UID 0 +ia => eipa > validate_cap:: Capabilities after execve were correct > ok 7 Passed > ok 8 # SKIP SUID/SGID tests (needs privilege) > Planned tests != run tests (12 != 8) > Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0 > ================================================== > TAP version 13 > 1..9 > [RUN] +++ Tests with uid != 0 +++ > [NOTE] Using a user namespace for tests > [RUN] Non-root => no caps > validate_cap:: Capabilities after execve were correct > ok 1 Passed > Check cap_ambient manipulation rules > ok 2 PR_CAP_AMBIENT_RAISE failed on non-inheritable cap > ok 3 PR_CAP_AMBIENT_RAISE failed on non-permitted cap > ok 4 PR_CAP_AMBIENT_RAISE worked > ok 5 Basic manipulation appears to work > [RUN] Non-root +i => i > validate_cap:: Capabilities after execve were correct > ok 6 Passed > [RUN] UID 1 +ia => eipa > validate_cap:: Capabilities after execve were correct > ok 7 Passed > ok 8 # SKIP SUID/SGID tests (needs privilege) > Planned tests != run tests (9 != 8) > Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0 > > Signed-off-by: Swarup Laxman Kotiaklapudi > --- > > Changes in V2: > - Change the commit message explaining > why this patchset is needed. > Applied to linux-kselftest next for Linux 6.8-rc1 thanks, -- Shuah