<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:37:06 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-3811] non-root users cannot archive files, root cannot archive non-root users&apos; files</title>
                <link>https://jira.whamcloud.com/browse/LU-3811</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Non-root users cannot archive their files and root cannot archive files owned by other users. Moreover the lfs hsm_archive command fails silently. To reproduce, start HSM and do the following:&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;# cd /mnt/lustre
# dd if=/dev/zero of=Asterix bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0633262 s, 166 MB/s
# chown sanity: Asterix 
# lfs hsm_archive Asterix 
# echo $?
0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Running the same operation with trace enabled show that the failure originates from:&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;00000004:00000001:3.0:1377109173.525959:0:15687:0:(mdd_object.c:911:mdd_xattr_sanity_check()) Process leaving (rc=18446744073709551615 : -1 : ffffffffffffffff)
00000004:00000001:3.0:1377109173.525959:0:15687:0:(mdd_object.c:1034:mdd_xattr_set()) Process leaving (rc=18446744073709551615 : -1 : ffffffffffffffff)
00000004:00000001:3.0:1377109173.525964:0:15687:0:(mdt_hsm.c:77:mdt_hsm_attr_set()) Process leaving (rc=18446744073709551615 : -1 : ffffffffffffffff)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The failure in mdd_xattr_sanity_check() is because the file ownership is not root and the coordinator runs with no capabilities.&lt;/p&gt;

&lt;p&gt;The failed request leaves an orphaned agent action according to proc&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;# lfs path2fid /mnt/lustre/Asterix 
[0x200000400:0x1:0x0]
# cat /proc/fs/lustre/mdt/lustre-MDT0000/hsm/agent_actions 
lrh=[type=10680000 len=136 idx=73] fid=[0x200000400:0x1:0x0] dfid=[0x200000400:0x1:0x0] compound/cookie=0x52150414/0x52150414 action=ARCHIVE archive#=0 flags=0x0 extent=0x0-0xffffffffffffffff gid=0x0 datalen=0 status=WAITING data=[]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Similarly a non-root user cannot archive any files.&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;# cd /mnt/lustre
# mkdir sanity
# chown sanity: sanity
# cd sanity
# su sanity
$ dd if=/dev/zero of=Obelix bs=1M count=50
$ ls -l Obelix
-rw-rw-r-- 1 sanity sanity 52428800 Aug 21 14:03 Obelix
$ lfs hsm_archive Obelix 
$ echo $?
0
$ sleep 60
$ lfs hsm_state Obelix
Obelix: (0x00000000)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="20544">LU-3811</key>
            <summary>non-root users cannot archive files, root cannot archive non-root users&apos; files</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="20020">LU-3647</parent>
                                    <priority id="1" iconUrl="https://jira.whamcloud.com/images/icons/priorities/blocker.svg">Blocker</priority>
                        <status id="6" iconUrl="https://jira.whamcloud.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="jay">Jinshan Xiong</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>HB</label>
                            <label>HSM</label>
                    </labels>
                <created>Wed, 21 Aug 2013 19:07:27 +0000</created>
                <updated>Mon, 21 Oct 2013 22:23:54 +0000</updated>
                            <resolved>Wed, 4 Sep 2013 13:49:56 +0000</resolved>
                                    <version>Lustre 2.5.0</version>
                                    <fixVersion>Lustre 2.5.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                            <comments>
                            <comment id="64874" author="jay" created="Thu, 22 Aug 2013 19:12:33 +0000"  >&lt;p&gt;good catch. For command line tool, only the root can archive and release files; normal users should be able to restore their own files, by either `lfs hsm_restore&apos; or directly access.&lt;/p&gt;</comment>
                            <comment id="65027" author="jcl" created="Sun, 25 Aug 2013 10:41:33 +0000"  >&lt;p&gt;IMO there is no reason to distinguish explicit request (through cmd line) from implicit request. Also archive/restore must be doable by user. One use case is in a job epilog, the user archive all the data produced by the run. In any case there is no security issue, the only issue is the interaction with quotas which is an open pb. For me, inforced quotas are incompatible with HSM.&lt;/p&gt;</comment>
                            <comment id="65074" author="adilger" created="Mon, 26 Aug 2013 16:33:52 +0000"  >&lt;p&gt;I think there are two problems here:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the volatile files created should use the uid/gid of the creating process for the new file, as with any regular file create&lt;/li&gt;
	&lt;li&gt;the root copytool should chown/chmod the file to the correct ownership before trying to swap the layout&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="65082" author="jhammond" created="Mon, 26 Aug 2013 18:47:12 +0000"  >&lt;p&gt;Andreas, indeed.&lt;/p&gt;

&lt;p&gt;Supporting HSM archive by normal users requires raising the capabilities of the coordinator which we need to do anyway. Then we have there is the issue that an unprivileged user may archive files they don&apos;t own.&lt;/p&gt;

&lt;p&gt;Should normal users be allowed to release their own files? If so then there is also the problem that, as implemented, HSM release requires that the user possess create privileges in the MDT&apos;s local root.&lt;/p&gt;

&lt;p&gt;I believe that we all agree that implicit restore should be handled transparently. This can be fixed in the copytool. What about explicit restore? There are some weak security issues here, since user space can just give an arbitrary FID to llite.&lt;/p&gt;

&lt;p&gt;On the permissions question, I think this is policy and so should be deferred to the site admins, via proc tunables (yucky but whatever) or a setuid() binary (less yucky but not something we usually do). &lt;/p&gt;</comment>
                            <comment id="65087" author="jay" created="Mon, 26 Aug 2013 19:19:39 +0000"  >&lt;blockquote&gt;
&lt;p&gt;IMO there is no reason to distinguish explicit request (through cmd line) from implicit request. Also archive/restore must be doable by user. One use case is in a job epilog, the user archive all the data produced by the run. In any case there is no security issue, the only issue is the interaction with quotas which is an open pb. For me, inforced quotas are incompatible with HSM.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I tend to think we need to distinguish request from command line and policy engine. Archive and release should be a privileged operation because it will consume system resources. Otherwise, the system may be easily DoS attack by malicious users. This is the usual case for similar kind of product.&lt;/p&gt;

&lt;p&gt;For epilog cases, I think we should do some work on policy engine so that it can be picked.&lt;/p&gt;</comment>
                            <comment id="65150" author="jhammond" created="Tue, 27 Aug 2013 13:04:20 +0000"  >&lt;p&gt;Please see &lt;a href=&quot;http://review.whamcloud.com/7461&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/7461&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="65211" author="jcl" created="Tue, 27 Aug 2013 21:55:49 +0000"  >&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the volatile files created should use the uid/gid of the creating process for the new file, as with any regular file create&lt;br/&gt;
so it will not be possible to restore a file in a RO directory. there is no reason for such restriction &lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="65215" author="jhammond" created="Tue, 27 Aug 2013 22:37:06 +0000"  >&lt;p&gt;Also note that there is not enough permission checking in mdt_hsm_request() and friends. A non-root user can cancel HSM requests, do hsm_remove, ...&lt;/p&gt;</comment>
                            <comment id="65236" author="leibovici-cea" created="Wed, 28 Aug 2013 12:57:35 +0000"  >&lt;blockquote&gt;&lt;p&gt;Archive and release should be a privileged operation because it will consume system resources.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Release is not really resource consuming, it is resource freeing (it is a way for the user to do a kind of posix_fadvise(DONTNEED) with HSM meaning).&lt;/p&gt;

&lt;p&gt;I&apos;d rather say restore is the more resource consuming (use Lustre disk space + copy bandwidth + tape drive). And archive, that use copy bandwidth.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Otherwise, the system may be easily DoS attack by malicious users.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;A DoS is still easy on a HSM system by restoring all readable files.&lt;br/&gt;
For archive and restore, it is more a QoS issue to avoid a single user to get all the bandwidth.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;A non-root user can cancel HSM requests, do hsm_remove, ...&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Indeed, this is dangerous...&lt;/p&gt;</comment>
                            <comment id="65281" author="jay" created="Wed, 28 Aug 2013 17:31:27 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Release is not really resource consuming, it is resource freeing (it is a way for the user to do a kind of posix_fadvise(DONTNEED) with HSM meaning).&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;thinking about a case that an archive already exists so the malicious user can keep releasing and restoring a file in an infinite loop.&lt;/p&gt;</comment>
                            <comment id="65454" author="jhammond" created="Fri, 30 Aug 2013 17:03:28 +0000"  >&lt;p&gt;I though it best to restart the permissions debate in a net ticket. Please see &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3866&quot; title=&quot;missing permission checks on HSM operations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3866&quot;&gt;&lt;del&gt;LU-3866&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="65727" author="jhammond" created="Wed, 4 Sep 2013 13:49:56 +0000"  >&lt;p&gt;Patch landed to master.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="20565">LU-3825</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="20731">LU-3866</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_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzvyuf:</customfieldvalue>

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