From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="HK48EzTw" Received: from sonic312-31.consmr.mail.ne1.yahoo.com (sonic312-31.consmr.mail.ne1.yahoo.com [66.163.191.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D46B1738 for ; Fri, 8 Dec 2023 16:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1702081488; bh=FupKcwsUuVApym5nZw09jZZpB4rPXEI1SLNgMEs4q+8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=HK48EzTwNvsKAP8zbdk8KsqToT+SmKt9flGHHOcWLJJb/WSQPDP2jbb1exKIOutiMGVxhyekVKmNDStRtzNJz7+HVXz5+AB98U2j39L4p4JbfH7VxQXPgYvDUQ21ps+RVZgyQORdQzInhIutBH62OcFWhAOpeD6C6sgfuF2EWBLmmIQM4c6Fp5wZQ1V5HKnL1Bm08ALHzAo1xXVfLgdMYLSb+8vyTJUf7e4TfdbRHxh29uSy2zrK8eGvMgWFgkZNIqErycsqTumS+oY7bJCXwY85k4AElq2m6B2M9pe2sOAQRZqSJ0fL283LIAurNMfiPyOtsSEkedQbRLuknE/QDg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1702081488; bh=HC6jVNF8p28r7BUwLDpMfbHBhpOv58RB2lzvkNf+ACK=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=jlJyKTNLPMAmJsNF8lBoTBVZaKpA3bqsyXISf5oERklUlXyRNCwfnJsJ4TQ+l77iat5MnjF3ONptrvjzIRG85WLosD3gp0IxY46XMl1+5PuTbFNLw3r77KuXYayzSzSKhlD3S/L8IMpA8JP0RwP7Fg1CsmFvewmVMaDfUvpRQmtqr3gu7YMQU4eLMD0xkqRDeR2RBLHHw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3XIw7cr674Zn5v1EYTrM66tFvn1DQKnp9T12U UUFqNaTaxzci0R_spA27HvGTw40I0K3i619cYZhB7JXscQLN8fXcPxozl9dHVaO0gXizafccwy4V h6PnfZdXjnlHNKeyXtxj.Hj2cMaD3n2J_0k3Z1PsphrknROudxHN_T4dpnTBljlEy4BCd2IszFVC 1FyA3myyvlACIcVxrX9JsmXEQ.VVG0V6oOPtQPHlF1iH6FmHvRZAltpemwkKiaYZbLsJwF8uc.aO 9n6Pm3_jmnTX6bbomdAmXgzEiFw-- X-Sonic-MF: X-Sonic-ID: 755ca37d-fb56-4637-b3f5-07158bf16357 Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sat, 9 Dec 2023 00:24:48 +0000 Received: by hermes--production-gq1-64499dfdcc-m6m9b (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7ca408e72ae3d6602b5fa725ef0edcd4; Sat, 09 Dec 2023 00:24:43 +0000 (UTC) Message-ID: <7ba17c0d-49c6-4322-b196-3ecb7a371c62@schaufler-ca.com> Date: Fri, 8 Dec 2023 16:24:42 -0800 Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Fw: [PATCH] proc: Update inode upon changing task security attribute Content-Language: en-US To: Paul Moore Cc: Munehisa Kamata , adobriyan@gmail.com, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, Casey Schaufler References: <20231208021433.1662438-1-kamatam@amazon.com> <0c0e8960-9221-43f0-a5d4-07c8f5342af0@schaufler-ca.com> From: Casey Schaufler In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.21943 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo On 12/8/2023 3:32 PM, Paul Moore wrote: > On Fri, Dec 8, 2023 at 6:21 PM Casey Schaufler wrote: >> On 12/8/2023 2:43 PM, Paul Moore wrote: >>> On Thu, Dec 7, 2023 at 9:14 PM Munehisa Kamata wrote: >>>> On Tue, 2023-12-05 14:21:51 -0800, Paul Moore wrote: >>> .. >>> >>>>> I think my thoughts are neatly summarized by Andrew's "yuk!" comment >>>>> at the top. However, before we go too much further on this, can we >>>>> get clarification that Casey was able to reproduce this on a stock >>>>> upstream kernel? Last I read in the other thread Casey wasn't seeing >>>>> this problem on Linux v6.5. >>>>> >>>>> However, for the moment I'm going to assume this is a real problem, is >>>>> there some reason why the existing pid_revalidate() code is not being >>>>> called in the bind mount case? From what I can see in the original >>>>> problem report, the path walk seems to work okay when the file is >>>>> accessed directly from /proc, but fails when done on the bind mount. >>>>> Is there some problem with revalidating dentrys on bind mounts? >>>> Hi Paul, >>>> >>>> https://lkml.kernel.org/linux-fsdevel/20090608201745.GO8633@ZenIV.linux.org.uk/ >>>> >>>> After reading this thread, I have doubt about solving this in VFS. >>>> Honestly, however, I'm not sure if it's entirely relevant today. >>> Have you tried simply mounting proc a second time instead of using a bind mount? >>> >>> % mount -t proc non /new/location/for/proc >>> >>> I ask because from your description it appears that proc does the >>> right thing with respect to revalidation, it only becomes an issue >>> when accessing proc through a bind mount. Or did I misunderstand the >>> problem? >> It's not hard to make the problem go away by performing some simple >> action. I was unable to reproduce the problem initially because I >> checked the Smack label on the bind mounted proc entry before doing >> the cat of it. The problem shows up if nothing happens to update the >> inode. > A good point. > > I'm kinda thinking we just leave things as-is, especially since the > proposed fix isn't something anyone is really excited about. "We have to compromise the performance of our sandboxing tool because of a kernel bug that's known and for which a fix is available." If this were just a curiosity that wasn't affecting real development I might agree. But we've got a real world problem, and I don't see ignoring it as a good approach. I can't see maintainers of other LSMs thinking so if this were interfering with their users.