<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:39:01 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-10884] stat() on lustre mount point / limited client trust in l_getidentity</title>
                <link>https://jira.whamcloud.com/browse/LU-10884</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;On our Oak storage system, which is a global storage system with limited access, we use the nodemap feature for GIDs, and UIDs are only a subset of the ones available on the different client clusters. A recent compatibility issue with Singularity (&lt;a href=&quot;https://github.com/singularityware/singularity/issues/1313&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/singularityware/singularity/issues/1313&lt;/a&gt;&#160;if you&apos;re interested in the whole story)&#160;led to the discovery of stat() failing on the client /oak mount point from time to time. It wasn&apos;t a problem so far until we hit this issue with Singularity. Correct me if I&apos;m wrong, but the issue is that the MDT will refuse to answer any rpc from an unknown UID, leading to stat() on /oak returning EPERM. This leads to things like this for unknown UIDs:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[user@sh-104-49 ~]$ ls -l /
ls: cannot access /oak: Permission denied
total 44
...
d??????????   ? ?    ?        ?            ? oak
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I said from time to time, because IF a user with Oak access did previously run Singularity on this compute node, thus (I believe) populating the client inode cache, stat() would then work even for unknown users. As a non-reproductible issue, it has been painful to troubleshoot.&lt;/p&gt;

&lt;p&gt;Anyway, we recently fixed the issue by forking l_getidentity.c to allow unknown UIDs to query the MDT so that stat() on the mount point &apos;/oak&apos; doesn&apos;t fail:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;diff --git a/lustre/utils/l_getidentity.c b/lustre/utils/l_getidentity.c
index 6aca6dc..72896a8 100644
--- a/lustre/utils/l_getidentity.c
+++ b/lustre/utils/l_getidentity.c
@@ -111,9 +111,11 @@ &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; get_groups_local(struct identity_downcall_data *data,
 
        pw = getpwuid(data-&amp;gt;idd_uid);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!pw) {
-               errlog(&lt;span class=&quot;code-quote&quot;&gt;&quot;no such user %u\n&quot;&lt;/span&gt;, data-&amp;gt;idd_uid);
-               data-&amp;gt;idd_err = errno ? errno : EIDRM;
-               &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; -1;
+               &lt;span class=&quot;code-comment&quot;&gt;/* Stanford limited client trust: all uid are mapped with primary group 37 */&lt;/span&gt;
+               errlog(&lt;span class=&quot;code-quote&quot;&gt;&quot;warning: no secondary groups &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; unknown user %u\n&quot;&lt;/span&gt;, data-&amp;gt;idd_uid);
+               data-&amp;gt;idd_gid = 37;
+               data-&amp;gt;idd_ngroups = 0;
+               &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; 0;
        }
 
        data-&amp;gt;idd_gid = pw-&amp;gt;pw_gid;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Because all access control is done using UID &lt;b&gt;and&lt;/b&gt; secondary GIDs, we should be good. Now stat() does work on every host mount points, making Singularity happy to run with autofs.&lt;/p&gt;

&lt;p&gt;So I wanted to raise the issue here to know what you think about this issue? Maybe Lustre filesystems should allow the stat rpc from unknown users on its root directory? Or would it make sense to add this kind of limited UID trust to l_getidentity?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;br/&gt;
 Stephane&lt;/p&gt;</description>
                <environment>CentOS 7.4</environment>
        <key id="51683">LU-10884</key>
            <summary>stat() on lustre mount point / limited client trust in l_getidentity</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="pjones">Peter Jones</assignee>
                                    <reporter username="sthiell">Stephane Thiell</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Apr 2018 22:41:59 +0000</created>
                <updated>Wed, 11 Apr 2018 19:02:16 +0000</updated>
                                            <version>Lustre 2.10.3</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="225309" author="jhammond" created="Fri, 6 Apr 2018 14:04:21 +0000"  >&lt;p&gt;Hi Stephane,&lt;/p&gt;

&lt;p&gt;Have you tried using the &lt;tt&gt;squash_uid&lt;/tt&gt; and &lt;tt&gt;squash_gid&lt;/tt&gt; properties of the nodemap here?&lt;/p&gt;

&lt;p&gt;&amp;gt; I said from time to time, because IF a user with Oak access did previously run Singularity on this compute node, thus (I believe) populating the client inode cache, stat() would then work even for unknown users. As a non-reproductible issue, it has been painful to troubleshoot.&lt;/p&gt;

&lt;p&gt;Indeed, this is a (perhaps poorly) known limitation of nodemapping/Lustre permissions/caching.&lt;/p&gt;

&lt;p&gt;&amp;gt; So I wanted to raise the issue here to know what you think about this issue? Maybe Lustre filesystems should allow the stat rpc from unknown users on its root directory? Or would it make sense to add this kind of limited UID trust to l_getidentity?&lt;/p&gt;

&lt;p&gt;I agree with the premise that &quot;If you can see it then you should be able to stat it.&quot; But I would be hesitant to poke holes in the security policy for special cases such as this. If we go down this road then we should make sure that it interacts properly with filesets.&lt;/p&gt;</comment>
                            <comment id="225791" author="sthiell" created="Wed, 11 Apr 2018 19:01:59 +0000"  >&lt;p&gt;Hi John - Thanks for your reply, that&apos;s useful.&lt;/p&gt;

&lt;p&gt;Note that we&apos;re not using nodemap for UIDs, only GIDs (we use gid_only), so that won&apos;t work I think. What we would need is some kind of default squash_uid.&lt;/p&gt;

&lt;p&gt;I agree too with the statement &quot;If you can see it then you should be able to stat it.&quot;&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
 Stephane&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzzvcn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>