<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:10:59 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-14581] el8.3/lu2.14 cannot mount mgs with selinux enabled</title>
                <link>https://jira.whamcloud.com/browse/LU-14581</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;I just tried setting up a test server on el8 and took a bit of time to realize selinux was the problem, even if set to permissive.&lt;/p&gt;

&lt;p&gt;Setting selinux to disabled allowed me to mount the server normally.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The problem seems to be that selinux thinks there is no xattr support and throws the baby with the water?&lt;/p&gt;

&lt;p&gt;Might be relevant: I&apos;ve only tested with a loop mount, it might work with real devices.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Here are the traces I have; happy to provide more if required:&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;
# rm -f mgt &amp;amp;&amp;amp; truncate -s 50M mgt &amp;amp;&amp;amp; mkfs.lustre --mgs mgt
# mount -t lustre -o loop ./mgt /mnt/lustre/mgt/
mount.lustre: mount /dev/loop0 at /mnt/lustre/mgt failed: Operation not supported
# dmesg | tail
[  100.138808] LDISKFS-fs (loop0): mounted filesystem with ordered data mode. Opts: user_xattr,errors=remount-ro,no_mbcache,nodelalloc
[  101.210730] SELinux: (dev lustre, type lustre) has no xattr support
[  101.236892] Lustre: server umount MGS complete
# (nothing obvious in lctl dk as the umount was not initiated from lustre code)
# bpftrace -e &lt;span class=&quot;code-quote&quot;&gt;&apos;kprobe:server_put_super { printf(&lt;span class=&quot;code-quote&quot;&gt;&quot;umount: %s\n&quot;&lt;/span&gt;, kstack); }&apos;&lt;/span&gt;
Attaching 1 probe...
umount: 
        server_put_super+1
        generic_shutdown_super+108
        kill_anon_super+20
        deactivate_locked_super+52
        mount_fs+308
        vfs_kern_mount.part.35+84
        do_mount+508
        ksys_mount+182
        __x64_sys_mount+33
        do_syscall_64+91
        entry_SYSCALL_64_after_hwframe+101
# cd /usr/src/debug/kernel-4.18.0-240.15.1.el8_3/linux-4.18.0-240.15.1.el8_3.x86_64/
# vim -t mount_fs
...
struct dentry *
mount_fs(struct file_system_type *type, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; flags, &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *name, void *data)
{
...
        error = security_sb_kern_mount(sb, flags, secdata);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (error)
                &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; out_sb;
...
out_sb:
        dput(root);
        deactivate_locked_super(sb);
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So the selinux message in dmesg was a real hard error and not a safe-to-ignore warning as I&apos;m used to...&lt;/p&gt;

&lt;p&gt;I didn&apos;t look further into why selinux thinks there is no xattr support, but quick tracing shows selinux_sb_kern_mount() is called twice - once for osd_mount for the actual ldiskfs device which works, and once more for the actual lustre layer mount call which I guess is probably expected not to have xattrs, so I guess selinux got a bit more strict lately, or a policy change? I&apos;m not sure policies can make the difference between the &quot;lustre&quot; server mount and the &quot;lustre&quot; client mount unfortunately.&lt;/p&gt;</description>
                <environment></environment>
        <key id="63644">LU-14581</key>
            <summary>el8.3/lu2.14 cannot mount mgs with selinux enabled</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="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="wc-triage">WC Triage</assignee>
                                    <reporter username="asmadeus">Dominique Martinet</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Apr 2021 02:38:19 +0000</created>
                <updated>Sun, 4 Apr 2021 14:21:26 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                            <comments>
                            <comment id="297771" author="asmadeus" created="Sun, 4 Apr 2021 12:27:27 +0000"  >&lt;p&gt;I just recalled there&apos;s a lustre_tgt mount type now, that works with selinux enabled.&lt;/p&gt;

&lt;p&gt;Is that a known issue? Would it be possible for the server code to detect we&apos;re mounting a target and adjust the type internally so selinux applies the right things&#8482;?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;(note my report title says mgs but this applies to all server types)&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="56282">LU-12514</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|i01ran:</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>