<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:47:29 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-11850] Relocating /proc/fs/lustre/ost to /sys/kernel/debug/lustre/ost prevents non-root access</title>
                <link>https://jira.whamcloud.com/browse/LU-11850</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;For security reasons /sys/kernel/debug is restrict to root only so by relocating /proc/fs/lustre/ost &amp;amp; mdt to /sys/kenrnel/debug/lustre breaks many tools such as &apos;performance co pilot&quot; that run as non-privilege users. We rely on such tools to collect lustre metric.&lt;/p&gt;

&lt;p&gt;We could change the permissions on /sys/kernel/debug but that is not good security practice. Can there be a build option to selected the location?&lt;/p&gt;</description>
                <environment></environment>
        <key id="54493">LU-11850</key>
            <summary>Relocating /proc/fs/lustre/ost to /sys/kernel/debug/lustre/ost prevents non-root access</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="3" iconUrl="https://jira.whamcloud.com/images/icons/statuses/inprogress.png" description="This issue is being actively worked on at the moment by the assignee.">In Progress</status>
                    <statusCategory id="4" key="indeterminate" colorName="inprogress"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="simmonsja">James A Simmons</assignee>
                                    <reporter username="mhanafi">Mahmoud Hanafi</reporter>
                        <labels>
                            <label>llnl</label>
                    </labels>
                <created>Thu, 10 Jan 2019 17:19:41 +0000</created>
                <updated>Fri, 26 Jan 2024 17:41:26 +0000</updated>
                                            <version>Lustre 2.12.0</version>
                                    <fixVersion>Upstream</fixVersion>
                                        <due></due>
                            <votes>1</votes>
                                    <watches>16</watches>
                                                                            <comments>
                            <comment id="239783" author="jaylan" created="Thu, 10 Jan 2019 23:10:57 +0000"  >&lt;p&gt;I think the question we should ask is &quot;should the information revealed in lustre/ost and lustre/mdt be kept away from non-privileged users?&quot; If not, maybe we can reconsider the decision and move the information back to procfs? Or other sysfs location that do not require root privilege to read?&lt;/p&gt;</comment>
                            <comment id="239785" author="simmonsja" created="Thu, 10 Jan 2019 23:44:57 +0000"  >&lt;p&gt;Proc is the worst place for this kind of information. Not only is frowned on by the kernel maintainers but if we every placed a large amount of data into an seq_file, which is used by procfs, the node would be brought to its knees by the cpu load. Actually this has been under discussion on the lustre-devel mailing list. If you are talking about &quot;stats&quot; I&apos;m working a netlink implementation which is way more flexible and has better performance. Give me a few days to roll something out.&lt;/p&gt;</comment>
                            <comment id="239787" author="simmonsja" created="Fri, 11 Jan 2019 00:32:43 +0000"  >&lt;p&gt;BTW here is an excellent article about a solution which I&apos;m modeling my work after.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://lwn.net/Articles/406975&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://lwn.net/Articles/406975&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The article cover why stats in proc is bad.&lt;/p&gt;</comment>
                            <comment id="239794" author="pjones" created="Fri, 11 Jan 2019 04:31:58 +0000"  >&lt;p&gt;ok James&lt;/p&gt;</comment>
                            <comment id="239868" author="adilger" created="Sun, 13 Jan 2019 01:17:57 +0000"  >&lt;blockquote&gt;
&lt;p&gt;We could change the permissions on /sys/kernel/debug but that is not good security practice.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;There is no need to change the permissions for the whole of &lt;tt&gt;/sys/kernel/debug&lt;/tt&gt; to be world readable.  Currently, it looks like &lt;tt&gt;/sys/kernel/debug&lt;/tt&gt; is itself the only directory that blocks access.  It would be possible in the short term to recursively change the permissions of this tree to remove world-readable permissions (&quot;&lt;tt&gt;chmod -R go-rw /sys/kernel/debug&lt;/tt&gt;&quot;) and then enable group access permissions for the monitoring tools to the Lustre tree after the filesystem is mounted (&quot;&lt;tt&gt;chmod -R g+rX /sys/kernel/debug/lustre; chgrp -R collectd /sys/kernel/debug/lustre&lt;/tt&gt;&quot; or similar).&lt;/p&gt;</comment>
                            <comment id="239909" author="jaylan" created="Mon, 14 Jan 2019 17:17:20 +0000"  >&lt;p&gt;James, this is great! Performance is very important! Thanks!&lt;/p&gt;</comment>
                            <comment id="239990" author="mhanafi" created="Tue, 15 Jan 2019 16:23:38 +0000"  >&lt;p&gt;Why is &lt;tt&gt;/sys/kernel/debug/lustre&lt;/tt&gt; not located at &lt;tt&gt;/sys/kernel/lustre?&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="239992" author="simmonsja" created="Tue, 15 Jan 2019 16:38:35 +0000"  >&lt;p&gt;Because all debugfs files go into /sys/kernel/debug. That is the mount point.&lt;/p&gt;</comment>
                            <comment id="240022" author="mhanafi" created="Tue, 15 Jan 2019 21:37:00 +0000"  >&lt;p&gt;But why are we considering /sys/kenrel/debug/lustre/ost/... part of &quot;debugging&quot;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="240024" author="simmonsja" created="Tue, 15 Jan 2019 21:52:56 +0000"  >&lt;p&gt;The kernel has rules about what can be in sysfs. An excellent article covering these rules is here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://lwn.net/Articles/378884&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://lwn.net/Articles/378884&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since Lustre has complex data files they are not allowed in sysfs. So the quick fix done for the linux client was moving it to debugfs . The point of this policy was due to proc becoming a dumpster. Now the dumpster is debugfs &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.whamcloud.com/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&#160;Note I have been avoiding the move of several files like stats to debugfs for the OpenSFS tree.&lt;/p&gt;

&lt;p&gt;No fear netlink will resolve these issues. I have a prototypes partially working. I just need to work out the nesting of data. I see its the ptlrpc service stats.&lt;/p&gt;</comment>
                            <comment id="240913" author="simmonsja" created="Wed, 30 Jan 2019 00:32:53 +0000"  >&lt;p&gt;I managed to get the basics working using netlink with obd stats. Just need to figure out how to link into the ptlrpc service.&lt;/p&gt;</comment>
                            <comment id="241968" author="gerrit" created="Thu, 14 Feb 2019 15:07:39 +0000"  >&lt;p&gt;James Simmons (uja.ornl@yahoo.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/34256&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/34256&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11850&quot; title=&quot;Relocating /proc/fs/lustre/ost to /sys/kernel/debug/lustre/ost prevents non-root access&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11850&quot;&gt;LU-11850&lt;/a&gt; obd: use netlink to get lustre stats&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 6c74e4ed15ad654b4a20925bd36b8cc0e014d34c&lt;/p&gt;</comment>
                            <comment id="241970" author="simmonsja" created="Thu, 14 Feb 2019 15:11:15 +0000"  >&lt;p&gt;Just pushed a prototype patch which I&apos;m going to use to discsuss Netlink API with other developers. It does sort of work with just md_stats but more is needed.&lt;/p&gt;</comment>
                            <comment id="315577" author="simmonsja" created="Thu, 14 Oct 2021 16:17:44 +0000"  >&lt;p&gt;So I have been doing research into the different stat collectors out their. From what I see you can configure them to collect the data from the lustre utilities instead of attempting to read from the debugfs files directly. For example for collectd you would use:&lt;/p&gt;

&lt;p&gt;&amp;lt;Plugin exec&amp;gt;&lt;/p&gt;

&lt;p&gt;&#160; &#160; Exec &quot;myuser:mygroup&quot; &quot;myprog&quot;&lt;/p&gt;

&lt;p&gt;&#160; &#160;Exec &quot;otheruser&quot; &quot;/path/to/another/binary&quot; &quot;arg0&quot; &quot;arg1&quot;&lt;/p&gt;

&lt;p&gt;&#160; &#160;NotificationExec &quot;user&quot; &quot;/usr/lib/collectd/exec/handle_notification&quot;&lt;/p&gt;

&lt;p&gt;&amp;lt;/Plugin&amp;gt;&lt;/p&gt;

&lt;p&gt;Looking at LMT and performance co pilot it looks to be the same case. If we can get are utilities to work without root access we should be in good shape.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="382662" author="gerrit" created="Wed, 16 Aug 2023 13:44:19 +0000"  >&lt;p&gt;&quot;James Simmons &amp;lt;jsimmons@infradead.org&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/51959&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/51959&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11850&quot; title=&quot;Relocating /proc/fs/lustre/ost to /sys/kernel/debug/lustre/ost prevents non-root access&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11850&quot;&gt;LU-11850&lt;/a&gt; lov: migrate completely to lu_tgt_descs API&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 8e49bf0a866c9214ac72bb85e2c49557615a3dd4&lt;/p&gt;</comment>
                            <comment id="400830" author="jtacquaviva" created="Tue, 23 Jan 2024 15:57:20 +0000"  >&lt;p&gt;We would need to provide access to the statistics on the client side from non-root accesses. Such access is mandatory for many performance tools running in user space.&lt;/p&gt;

&lt;p&gt;Probably the patch is of modest size, is it possible to have a hot-fix?&lt;/p&gt;</comment>
                            <comment id="400842" author="adilger" created="Tue, 23 Jan 2024 16:28:21 +0000"  >&lt;p&gt;JT, the change of &lt;tt&gt;/sys/kernel/debug&lt;/tt&gt; to root-only happened in the upstream kernel after Lustre started using it, so it would need a kernel patch on all clients (AFAIK), that I don&apos;t think anyone wants. &lt;/p&gt;

&lt;p&gt;I haven&apos;t if there is an easy way to restructure the code back to using &lt;tt&gt;/proc/fs/lustre&lt;/tt&gt; to make these stats available again, but that would probably be the least disruptive code change.  The other option would be to add a dedicated &quot;&lt;tt&gt;lparamfs&lt;/tt&gt;&quot; to hold all the Lustre stats so we don&apos;t have to deal with the kernel restrictions at all. &lt;/p&gt;</comment>
                            <comment id="400881" author="simmonsja" created="Tue, 23 Jan 2024 20:15:06 +0000"  >&lt;p&gt;Hello. Since you brought this up I do have a patch - &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/34256.&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/34256.&lt;/a&gt; After reading this I tracked down the crash I was seeing which was due to a really large message. Stats can be really huge amount of data. I need to adjust the skb. I do need to do more testing for what global_match() can handle.&lt;/p&gt;</comment>
                            <comment id="400912" author="simmonsja" created="Wed, 24 Jan 2024 01:02:01 +0000"  >&lt;p&gt;I updated patch 34256. Not perfect but is mostly works now. Give it a try. Note you will need the latest Lustre to make this work.&lt;/p&gt;</comment>
                            <comment id="401036" author="simmonsja" created="Wed, 24 Jan 2024 21:22:42 +0000"  >&lt;p&gt;Almost done with the patch for stats. Only bug left is if you grab ALL stats it overflows the liblnetconfig library. I do want to move the internal storage of the stats structures as an Xarray instead of a generic_radix struct.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="54948">LU-11988</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="36381">LU-8066</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="46759">LU-9680</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="80374">LU-17471</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="54948">LU-11988</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="55529">LU-12244</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56280">LU-12513</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="57118">LU-12841</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="80379">LU-17472</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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|i0098v:</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>