Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1201987rwp; Thu, 13 Jul 2023 07:35:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqB+q2vIxb8bLWHif6bZg16U3iBXONwg8VpGwj1m4dxzrUL4iw8FOmAjfLJQCPmDik+kRq X-Received: by 2002:a17:90a:c7cb:b0:25c:2260:9f5c with SMTP id gf11-20020a17090ac7cb00b0025c22609f5cmr984946pjb.34.1689258934191; Thu, 13 Jul 2023 07:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689258934; cv=none; d=google.com; s=arc-20160816; b=tUm0XLoEpQ+fn/UiVhbXnSeIAubpJu30dv/nk0KLQQaEadqpxQsY8hX1I8He+XMDWl 1AW7xVnK/JetZvw6GAcxopmD5KmhqGpAW5Z1qnKghAaqLsh3WX95bh8V9enPUTGxI0V6 ztr12AgUic4LGm8zPmBXZ54Kc+qHRhHIBF9a/YZEVuRF8jJdsr7rVrehiyhrexZgj50r kN6is3LYAkKhSOoUaTY9uwlsQiyKLFDuTradHrtlQXpm5i4D4ZfpDrHSly1rQKwFhBjp D677Hc5SGniDa7JIBlRzXt2Y+8JmgXr0pEn4cyu45uAN4smftGYdUXEymPiYgkKHTSjx Rt2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZMZOWPNncf/1aOM0SqCrmeem2JnHn02pihgZxljBHmQ=; fh=SQ4HjlAai4qPfj/E60y35dmatpyxj2CU0I5f1etQn7s=; b=ZCIIas7G0T1KQP6iFpCroAze2QP5czAAlc1Cs+qQjN40WGzGkpDUoWF/48WJdnE9XR m1fyzAZC3/PER/bp1ce79d518Gb6R+SjFDmt5HCMGToRNK4q4+KGa2cP/2913Aoklpci 9naOPMEabuoTJ66RClNy3ZSE1kmwr69xOR2nG1CkBnnKZmwloUTLNQ6JxXSQL4x5VxHs 8Bfjf7mSEKQo8ARKSDVjvKlv+ChMC2jHCh0cLUDOJyYS1YYTU6zpLSzDEXxvtZkXr5Zb mJEuyB54wSJEdzbCPnLZ0jxsZf7P3XyxsPqj4Kg50u3ItPmwkxOGVpwP5YuWqW7dbiIs badw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cyphar.com header.s=MBO0001 header.b=QzJdzaU0; 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=cyphar.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a17090a714800b00265e48c115csi3176722pjs.114.2023.07.13.07.35.22; Thu, 13 Jul 2023 07:35:34 -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=@cyphar.com header.s=MBO0001 header.b=QzJdzaU0; 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=cyphar.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234264AbjGMOGT (ORCPT + 99 others); Thu, 13 Jul 2023 10:06:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbjGMOGS (ORCPT ); Thu, 13 Jul 2023 10:06:18 -0400 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050:0:465::102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2349C1FF7; Thu, 13 Jul 2023 07:06:17 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4R1xGs48pSz9smd; Thu, 13 Jul 2023 16:06:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cyphar.com; s=MBO0001; t=1689257173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZMZOWPNncf/1aOM0SqCrmeem2JnHn02pihgZxljBHmQ=; b=QzJdzaU0KsG33pgKxrLZYRPQMPtvzQkcD8wGfhqq920WjbIqLouFXILrGp8umXb22H3vmJ ozwnmt3RTGLKATrmyf6XtUslDxANMZPYGAhCcVLr/QrfW9da38NsnJpCK+z8kD8a6aEZVg sb3sGDms4XaM0ciYU1A2bx+2DK6lqoDACJv5CrLBaei/cpHxvvA9rBYIXF46/onVQ8MkdO jHyeG6fgoQYau/3ytcBUCrSPCOHX2rr+P72Pvss6gJ8oWzGjgwoB1cazRYdFOvRo5wJx4w puPYQGdHwerjpvhNeInqhM6JbOIJEBBrp+Xv3wHfKn8xMVmIixoLUuqoPks5AA== Date: Fri, 14 Jul 2023 00:06:02 +1000 From: Aleksa Sarai To: Willy Tarreau Cc: Shuah Khan , Andrew Morton , Christian Brauner , 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, Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Subject: Re: [PATCH] procfs: block chmod on /proc/thread-self/comm Message-ID: References: <20230713121907.9693-1-cyphar@cyphar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4R1xGs48pSz9smd X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 On 2023-07-13, Willy Tarreau wrote: > +Cc Thomas Wei?schuh as this seems quite related to > his finding about /proc/self/net: > > https://lore.kernel.org/lkml/20230624-proc-net-setattr-v1-0-73176812adee@weissschuh.net/#b Yeah I saw this patch and (along with an earlier discussion with Christian on the topic of chmod on symlinks -- see [1]) lead us to find that there were three other cases where this happens unintentionally: * /proc/self (on the symlink itself) * /proc/thread-self (on the symlink itself) * /proc/thread-self/comm The first two will be fixed by [1] so fixing them isn't necessary. [1]: https://lore.kernel.org/linux-fsdevel/20230712-vfs-chmod-symlinks-v2-1-08cfb92b61dd@kernel.org/ -- Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH