Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1125189rwp; Thu, 13 Jul 2023 06:33:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlH3V/+8W8m4LHUCw6c7n4bJrQ9w+jHfpgzxez0Z9RR7Xug8DjAfq28VbutAvdJZde0/sZEO X-Received: by 2002:a05:6a20:3d0c:b0:111:a0e5:d2b7 with SMTP id y12-20020a056a203d0c00b00111a0e5d2b7mr2069525pzi.4.1689255226431; Thu, 13 Jul 2023 06:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689255226; cv=none; d=google.com; s=arc-20160816; b=hng6rhM6jQmTEkldioFvFa57uSoO/Zs/FKsawVDhbes9+0hMyPUh1NbncjjEoky9W0 DLys4yYWnP+F2vHV7hNqGWLEk3nPEmsMulQVPa3pnAiqh8FigbOx9FgSsdE5xqOwW952 tBt6bkuBvjswROjNcrkRVGRA84a/UGO6vqByAmHToTbZl8VkZuzEk4Llzx/BV8mrFiv2 aS9xnLNyeAQkv2i4jqxhG/hBYCYdoyFzVPcBwNOyu21sFsPH7fv242RZ8YMCNW0eKdxA pQ8fCHyvLMiD2O7hHsPSMyxxpA716iIfp3jww5Vegi/cbOZ5lFkdEMFNwaztowQgDH+N retQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=2O13L6Vxw5fc8Ers3Wc9pGKzflLgFcRTo6OE/YNPEA0=; fh=+DQ6MuoaNGppMWvYCb7M3YLYBcyEEic4lWka+NVkUrQ=; b=pEOc7d73nxq29tcwfhrdPlBhVy5iXJD9Hh8EwWvUKS/dfSuO/LLTxbY5rvHgwzKjZX On6kArLDUMQ5BAwortJ3LhW1CrBsxhA8qlKlDmOPdjARBIfirtUgOD4mekp0BzbCIoe5 WK4wYSuwHiX3dzNfO6g4LqRu9FeFOeO/EgKtjexJUDryQh/PoDb3Fg4a9M7KDY9oGnWK qXGb0FoTdrNYcLeNjd6BUmylgPPSs2fnTWX9wm1K1sj5jWDI8DuGZOFhTH43p5/NikGh i0XZ0VN2kVlz8vQqQ0rKi2tLf/W92LUPqfm6d5FZtUx1gmMlTPFSXvQj8VNiMbTUmxmW ZQ5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JhOxNiBd; 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 n17-20020a056a000d5100b006826f3512fesi4910945pfv.200.2023.07.13.06.33.34; Thu, 13 Jul 2023 06:33:46 -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=JhOxNiBd; 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 S235259AbjGMNYf (ORCPT + 99 others); Thu, 13 Jul 2023 09:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235242AbjGMNYR (ORCPT ); Thu, 13 Jul 2023 09:24:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 478E03C01; Thu, 13 Jul 2023 06:23:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8557C612FC; Thu, 13 Jul 2023 13:22:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73C62C433C7; Thu, 13 Jul 2023 13:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689254550; bh=bOUAPzYMXtdmmDSu2PZbdjTsWvkvo0nimQiCAPr8Yhw=; h=Date:From:To:Cc:Subject:From; b=JhOxNiBdFSDCF2V9/Owve15T7sqX4XOaeLrOvcgSNwS3EOX8VGPBTRWhuKoRbgBd6 UZFYLGBzQhDg3neOr3DuwW0ysPNNI3j+3TqncYXQx5UByAPqlrSR9FNQA9+GAO5LFF y0krZvqDmQ5nsqpEiy0GeMLmk+sjw1pb6NYckaT6eXLvP7V99Bmw8ctkemXlii6Yzb LjhV08DNKdnVDxVeYlcOFk53tsOZU4+Jo52jzg8OzM36DdGHFjIQHeCqY+8H+mRPpa fGonogsNanTUNMQAXXtHV+wsT033vaVk2i34k/TuiaojjLu7D980TKd4GHtOwPNXA1 kcr1qYNL3l4Gg== Date: Thu, 13 Jul 2023 15:22:24 +0200 From: Christian Brauner To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Cc: Aleksa Sarai , Willy Tarreau , Shuah Khan , Andrew Morton , Dave Chinner , xu xin , Al Viro , Stefan Roesch , Zhihao Cheng , "Liam R. Howlett" , Janis Danisevskis , Kees Cook , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH] procfs: block chmod on /proc/thread-self/comm Message-ID: <20230713-unerschrocken-kutschieren-9be3c8958b5d@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c > > index 486334981e60..08f0969208eb 100644 > > --- a/tools/testing/selftests/nolibc/nolibc-test.c > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > > @@ -580,6 +580,10 @@ int run_syscall(int min, int max) > > CASE_TEST(chmod_net); EXPECT_SYSZR(proc, chmod("/proc/self/net", 0555)); break; > > CASE_TEST(chmod_self); EXPECT_SYSER(proc, chmod("/proc/self", 0555), -1, EPERM); break; > > CASE_TEST(chown_self); EXPECT_SYSER(proc, chown("/proc/self", 0, 0), -1, EPERM); break; > > + CASE_TEST(chmod_self_comm); EXPECT_SYSER(proc, chmod("/proc/self/comm", 0777), -1, EPERM); break; > > + CASE_TEST(chmod_tid_comm); EXPECT_SYSER(proc, chmod("/proc/thread-self/comm", 0777), -1, EPERM); break; > > + CASE_TEST(chmod_self_environ);EXPECT_SYSER(proc, chmod("/proc/self/environ", 0777), -1, EPERM); break; > > + CASE_TEST(chmod_tid_environ); EXPECT_SYSER(proc, chmod("/proc/thread-self/environ", 0777), -1, EPERM); break; > > I'm not a big fan of this, it abuses the nolibc testsuite to test core > kernel functionality. Yes, this should be dropped. We need a minimal patch to fix this. This just makes backporting harder and any test doesn't need to be backported.