<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:18:57 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-8598] flaw in the ldiskfs group quota enforcement</title>
                <link>https://jira.whamcloud.com/browse/LU-8598</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;A user found out that the Lustre group quota enforcement can be overwhelmed&lt;br/&gt;
under particular circumstances.&lt;/p&gt;

&lt;p&gt;Here is an example provided by our customer. On their system a user is a member&lt;br/&gt;
of group matlab. Group matlab is a group intended to give access to a licensed&lt;br/&gt;
application, but it is not supposed to give access to any additional project&lt;br/&gt;
storage resources. On any Unix or Linux system, it is allowed to that users,&lt;br/&gt;
owners of a file, can change the group of their files to any other group they&lt;br/&gt;
are a member of. So to prevent that group matlab, and similar groups, are&lt;br/&gt;
abused for gaining access to additional storage resources, they set the limits&lt;br/&gt;
for such groups as low as possible &#8211; i.e. to 1, since 0 actually means&lt;br/&gt;
&#8220;unlimited&#8221;.&lt;/p&gt;

&lt;p&gt;The example below shows how easily the limits can be circumvented when new&lt;br/&gt;
files are created with a group GID that is not over quota yet, and then&lt;br/&gt;
immediately changed to another group. The output of the lfs quota command at&lt;br/&gt;
the end demonstrates that Lustre knowns about the exceeded limit, but does not&lt;br/&gt;
stop or enforce anything at all.&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;cli1$ lfs quota -g matlab /scratch
Disk quotas &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; group matlab (gid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
       /scratch       0       0       0       -       1*      1       1       -
cli1$ 
cli1$ 
cli1$ &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; i in {0..4999}; &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; touch file.$i &amp;amp;&amp;amp; chgrp matlab file.$i; done
cli1$ lfs quota -g matlab /scratch
Disk quotas &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; group matlab (gid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
       /scratch       0       0       0       -    5001*      1       1       -
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This issue is easily reproducible. By looking at the debug log, the quota code&lt;br/&gt;
in Lustre returns -EDQUOT, but the chgrp operation is allowed anyway.&lt;/p&gt;

&lt;p&gt;The defect is in osd_declare_attr_set() where rc is changed to 0 if (rc ==&lt;br/&gt;
-EDQUOT || rc == -EINPROGRESS).&lt;/p&gt;

&lt;p&gt;We can find the following comment in the code:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;    /* Changing ownership is always preformed by super user, it should not&lt;br/&gt;
     &amp;#42; fail with EDQUOT.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;While this is true for the user ownership, this is not for the group ownership.&lt;/p&gt;

&lt;p&gt;A similar issue is already described in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5152&quot; title=&quot;Can&amp;#39;t enforce block quota when unprivileged user change group&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5152&quot;&gt;&lt;del&gt;LU-5152&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment>Lustre 2.5.3.90 w/ Bull patches, ldiskfs backend</environment>
        <key id="39726">LU-8598</key>
            <summary>flaw in the ldiskfs group quota enforcement</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="niu">Niu Yawei</assignee>
                                    <reporter username="bruno.travouillon">Bruno Travouillon</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Sep 2016 22:01:04 +0000</created>
                <updated>Sat, 4 Mar 2017 00:40:18 +0000</updated>
                            <resolved>Sat, 4 Mar 2017 00:40:18 +0000</resolved>
                                    <version>Lustre 2.5.3</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="165536" author="pjones" created="Fri, 9 Sep 2016 22:05:01 +0000"  >&lt;p&gt;Niu&lt;/p&gt;

&lt;p&gt;Could you please advise with this issue?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="165538" author="gerrit" created="Fri, 9 Sep 2016 22:21:27 +0000"  >&lt;p&gt;Bruno Travouillon (bruno.travouillon@atos.net) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/22421&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/22421&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8598&quot; title=&quot;flaw in the ldiskfs group quota enforcement&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8598&quot;&gt;&lt;del&gt;LU-8598&lt;/del&gt;&lt;/a&gt; osd-ldiskfs: enforce group quota while chgrp&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 33ddd52a0a9212bdd9f1c3ceba3fbd844ee495f6&lt;/p&gt;</comment>
                            <comment id="165607" author="niu" created="Mon, 12 Sep 2016 02:06:10 +0000"  >&lt;p&gt;This isn&apos;t a ldiskfs specific issue, it&apos;s Lustre quota issue. To fix the group inode quota is relative easy, while fixing the group block quota requires much more work (which is described in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5152&quot; title=&quot;Can&amp;#39;t enforce block quota when unprivileged user change group&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5152&quot;&gt;&lt;del&gt;LU-5152&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="165615" author="bruno.travouillon" created="Mon, 12 Sep 2016 05:54:43 +0000"  >&lt;p&gt;Indeed, I started to work on another patch for osd-zfs when &lt;a href=&quot;http://review.whamcloud.com/22421&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/22421&lt;/a&gt; failed sanity-quota check.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="25048">LU-5152</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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_10030" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Epic/Theme</customfieldname>
                        <customfieldvalues>
                                        <label>Quota</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzynvr:</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>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>