<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:58:33 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-13119] lustre-initialization crashed in common_file_perm() on SLES12</title>
                <link>https://jira.whamcloud.com/browse/LU-13119</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;This issue was created by maloo for Andreas Dilger  &amp;lt;adilger@whamcloud.com&amp;gt;&lt;/p&gt;

&lt;p&gt;This issue relates to the following test suite run: &lt;a href=&quot;https://testing.whamcloud.com/test_sets/f8038c56-3208-11ea-adca-52540065bddc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://testing.whamcloud.com/test_sets/f8038c56-3208-11ea-adca-52540065bddc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;lustre-initialization failed with the following error:&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;&apos;trevis-42vm12 crashed during lustre-initialization-1&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The stack trace on the MDS looks like:&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;LDISKFS-fs (dm-4): mounted filesystem with ordered data mode.
Opts: user_xattr,errors=remount-ro,no_mbcache,nodelalloc
BUG: unable to handle kernel NULL pointer dereference at 0000000000000078
IP: [&amp;lt;ffffffff812d5995&amp;gt;] common_file_perm+0x15/0x180
Oops: 0000 [#1] SMP 
Supported: No, Unsupported modules are loaded
CPU: 0 PID: 2995 Comm: mount.lustre Tainted: 4.4.180-94.100_lustre
Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
Call Trace:
security_file_permission+0x3e/0xc0
iterate_dir+0x32/0x110
osd_ios_general_scan+0x12e/0x250 [osd_ldiskfs]
osd_initial_OI_scrub+0x5e/0xc00 [osd_ldiskfs]
osd_scrub_setup+0x8f5/0x960 [osd_ldiskfs]
osd_device_alloc+0x5ac/0x8c0 [osd_ldiskfs]
obd_setup+0xb8/0x230 [obdclass]
class_setup+0x468/0x7c0 [obdclass]
class_process_config+0x1890/0x27b0 [obdclass]
do_lcfg+0x235/0x490 [obdclass]
lustre_start_simple+0x85/0x1f0 [obdclass]
server_fill_super+0xe81/0x1640 [obdclass]
lustre_fill_super+0x436/0x8d0 [obdclass]
mount_nodev+0x48/0xa0
mount_fs+0x3a/0x170
vfs_kern_mount+0x62/0x110
do_mount+0x213/0xcd0
SyS_mount+0x85/0xd0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It could be that this is related to &lt;tt&gt;iterate_dir()&lt;/tt&gt; taking a fake &lt;tt&gt;filp&lt;/tt&gt; as an argument, and somehow &lt;tt&gt;filp&lt;/tt&gt; is not  filled in sufficiently for &lt;tt&gt;security_file_permission()-&amp;gt;common_file_perm()&lt;/tt&gt;.&lt;/p&gt;






&lt;p&gt;VVVVVVV DO NOT REMOVE LINES BELOW, Added by Maloo for auto-association VVVVVVV&lt;br/&gt;
lustre-initialization lustre-initialization - &apos;trevis-42vm12 crashed during lustre-initialization-1&apos;&lt;/p&gt;</description>
                <environment></environment>
        <key id="57757">LU-13119</key>
            <summary>lustre-initialization crashed in common_file_perm() on SLES12</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="1">Fixed</resolution>
                                        <assignee username="simmonsja">James A Simmons</assignee>
                                    <reporter username="maloo">Maloo</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Jan 2020 05:42:05 +0000</created>
                <updated>Thu, 23 Jan 2020 13:43:03 +0000</updated>
                            <resolved>Thu, 23 Jan 2020 13:43:03 +0000</resolved>
                                                    <fixVersion>Lustre 2.14.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="260818" author="adilger" created="Thu, 9 Jan 2020 05:55:58 +0000"  >&lt;p&gt;It looks like the use of &lt;tt&gt;iterate_dir()&lt;/tt&gt; was introduced by patch &lt;a href=&quot;https://review.whamcloud.com/34714&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/34714&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11832&quot; title=&quot;ARM servers crashing on MDS startup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11832&quot;&gt;&lt;del&gt;LU-11832&lt;/del&gt;&lt;/a&gt; ldiskfs: properly handle VFS parallel locking&lt;/tt&gt;&quot;.&lt;/p&gt;</comment>
                            <comment id="260917" author="simmonsja" created="Thu, 9 Jan 2020 18:38:56 +0000"  >&lt;p&gt;Which SLES is this?&lt;/p&gt;</comment>
                            <comment id="260921" author="adilger" created="Thu, 9 Jan 2020 19:36:37 +0000"  >&lt;p&gt;According to the data on the Maloo page it is SLES12.3.&lt;/p&gt;</comment>
                            <comment id="260925" author="simmonsja" created="Thu, 9 Jan 2020 20:09:23 +0000"  >&lt;p&gt;SUSE is using app amour which has different requirements. osd-ldiskfs open codes struct file creating instead of using&#160;&lt;/p&gt;

&lt;p&gt;alloc_file_pseudo() so bits are missed. Looking at common_file_perm() in the SUSE kernel code it expects&#160;&lt;/p&gt;

&lt;p&gt;file-&amp;gt;f_cred to set. Eventually I like to move to alloc_file_pseudo() but that is a bit tricky in the way struct file data structures are handling in ldiskfs as scratch areas.&lt;/p&gt;</comment>
                            <comment id="261030" author="gerrit" created="Fri, 10 Jan 2020 14:49:43 +0000"  >&lt;p&gt;James Simmons (jsimmons@infradead.org) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/37184&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/37184&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13119&quot; title=&quot;lustre-initialization crashed in common_file_perm() on SLES12&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13119&quot;&gt;&lt;del&gt;LU-13119&lt;/del&gt;&lt;/a&gt; osd-ldiskfs: set f_cred for app armour&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 82d5ab9c64a290791be79b83ff006c926ddc0311&lt;/p&gt;</comment>
                            <comment id="261081" author="adilger" created="Sat, 11 Jan 2020 03:50:48 +0000"  >&lt;p&gt;It seems that the SLES kernel is trying to apply AppArmor security policies to the Lustre filesystem (not sure why, since we , since &lt;tt&gt;common_file_perm()&lt;/tt&gt; only exists in &lt;tt&gt;security/apparmor/lsm.c&lt;/tt&gt;:&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;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; common_file_perm(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; op, struct file *file, u32 mask)
{
        struct aa_file_cxt *fcxt = file-&amp;gt;f_security;
        struct aa_profile *profile, *fprofile = aa_cred_profile(file-&amp;gt;f_cred);
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; error = 0;

        BUG_ON(!fprofile);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!file-&amp;gt;f_path.mnt ||
            !mediated_filesystem(file-&amp;gt;f_path.dentry))
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; 0;

        profile = __aa_current_profile();

        /* revalidate access, &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; task is unconfined, or the cached cred
         * doesn&apos;t match or &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the request is &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; more permissions than
         * was granted.
         *
         * Note: the test &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; !unconfined(fprofile) is to handle file
         *       delegation from unconfined tasks
         */
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!unconfined(profile) &amp;amp;&amp;amp; !unconfined(fprofile) &amp;amp;&amp;amp;
            ((fprofile != profile) || (mask &amp;amp; ~fcxt-&amp;gt;allow)))
                error = aa_file_perm(op, profile, file, mask);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; error;
}


&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; apparmor_file_permission(struct file *file, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; mask)
{
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; common_file_perm(OP_FPERM, file, mask);
}

&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; iterate_dir(struct file *file, struct dir_context *ctx)
{               
        struct inode *inode = file_inode(file);
        bool shared = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; res = -ENOTDIR;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (file-&amp;gt;f_op-&amp;gt;iterate_shared)
                shared = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
        &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!file-&amp;gt;f_op-&amp;gt;iterate)
                &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; out;

        res = security_file_permission(file, MAY_READ);
        :
        :
}

osd_ios_general_scan(struct osd_thread_info *info, struct osd_device *dev,
                     struct dentry *dentry, filldir_t filldir)
{
        struct file                  *filp  = &amp;amp;info-&amp;gt;oti_file;
        struct inode                 *inode = dentry-&amp;gt;d_inode;
        &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct file_operations *fops  = inode-&amp;gt;i_fop;

        filp-&amp;gt;f_pos = 0;
        filp-&amp;gt;f_path.dentry = dentry;
        filp-&amp;gt;f_flags |= O_NOATIME;
        filp-&amp;gt;f_mode = FMODE_64BITHASH | FMODE_NONOTIFY;
        filp-&amp;gt;f_mapping = inode-&amp;gt;i_mapping;
        filp-&amp;gt;f_op = fops;
        filp-&amp;gt;private_data = NULL;
        set_file_inode(filp, inode);
        rc = osd_security_file_alloc(filp);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc)
                RETURN(rc);        &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; {
                buf.oifb_items = 0;
                rc = iterate_dir(filp, &amp;amp;buf.ctx);
        } &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; (rc &amp;gt;= 0 &amp;amp;&amp;amp; buf.oifb_items &amp;gt; 0 &amp;amp;&amp;amp;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="261082" author="adilger" created="Sat, 11 Jan 2020 03:52:54 +0000"  >&lt;p&gt;Sigh. I didn&apos;t commit my comment until now...&lt;/p&gt;</comment>
                            <comment id="261501" author="arshad512" created="Sun, 19 Jan 2020 09:12:07 +0000"  >&lt;p&gt;Seen on Master. &lt;a href=&quot;https://testing.whamcloud.com/test_sets/aedd7978-3a88-11ea-80b4-52540065bddc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://testing.whamcloud.com/test_sets/aedd7978-3a88-11ea-80b4-52540065bddc&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="261694" author="gerrit" created="Thu, 23 Jan 2020 05:32:09 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/37184/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/37184/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13119&quot; title=&quot;lustre-initialization crashed in common_file_perm() on SLES12&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13119&quot;&gt;&lt;del&gt;LU-13119&lt;/del&gt;&lt;/a&gt; osd-ldiskfs: set f_cred for app armour&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 33082e057d214793c70085a33f1d82b3915db3a9&lt;/p&gt;</comment>
                            <comment id="261719" author="pjones" created="Thu, 23 Jan 2020 13:43:03 +0000"  >&lt;p&gt;Landed for 2.14&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="54424">LU-11832</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|i00rr3:</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>