<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:51:19 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-5417] lod_load_striping_locked() fails to detect errors from lod_get_lmv_ea()</title>
                <link>https://jira.whamcloud.com/browse/LU-5417</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In lod_load_striping_locked() if lod_get_lmv_ea() fails then we fail to detect this due to a signed to unsigned comparison bug.&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;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISDIR(lu_object_attr(lod2lu_obj(lo)))) {
                rc = lod_get_lmv_ea(env, lo);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc &amp;lt; sizeof(struct lmv_mds_md_v1))
                        GOTO(out, rc = rc &amp;gt; 0 ? -EINVAL : rc);
                buf-&amp;gt;lb_buf = info-&amp;gt;lti_ea_store;
                buf-&amp;gt;lb_len = info-&amp;gt;lti_ea_store_size;
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc == sizeof(struct lmv_mds_md_v1)) {
                                ...
                }

                /*
                 * there is LOV EA (striping information) in &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; object
                 * let&apos;s parse it and create in-core objects &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the stripes
                 */
                rc = lod_parse_dir_striping(env, lo, buf);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This causes a subsequent NULL pointer dereference in lod_parse_dir_striping():&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;[ 1402.003864] BUG: unable to handle kernel NULL pointer dereference at 000000000000000c
[ 1402.004401] IP: [&amp;lt;ffffffffa0d181a1&amp;gt;] lod_parse_dir_striping+0x101/0x730 [lod]
[ 1402.004401] PGD 1e4e32067 PUD 1f2b69067 PMD 0
[ 1402.004401] Oops: 0000 [#1] SMP
...
[ 1402.004401] Pid: 6183, comm: mdt01_001 Not tainted 2.6.32-431.5.1.el6.lustre.x86_64 #1 Bochs Bochs
[ 1402.004401] RIP: 0010:[&amp;lt;ffffffffa0d181a1&amp;gt;]  [&amp;lt;ffffffffa0d181a1&amp;gt;] lod_parse_dir_striping+0x101/0x730 [lod]
[ 1402.004401] RSP: 0018:ffff8801f318d9c0  EFLAGS: 00010286
[ 1402.004401] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000
[ 1402.004401] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8802168d4418
[ 1402.004401] RBP: ffff8801f318da30 R08: 0000000000000000 R09: 0000000000000001
[ 1402.004401] R10: 0000000000000001 R11: 0000000000000000 R12: ffff8801f2b50000
[ 1402.004401] R13: ffff8801f3197a68 R14: ffff8801f30c6b38 R15: ffff8801f3197a78
[ 1402.004401] FS:  0000000000000000(0000) GS:ffff88002fe00000(0000) knlGS:00000000000000\
00
[ 1402.004401] CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
[ 1402.004401] CR2: 000000000000000c CR3: 00000001e4d68000 CR4: 00000000000006e0
[ 1402.004401] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1402.004401] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1402.004401] Process mdt01_001 (pid: 6183, threadinfo ffff8801f318c000, task ffff8801f318a3c0)
[ 1402.004401] Stack:
[ 1402.004401]  fffffffffffffff2 00000000fffffffe ffff8801f318d9f0 ffff8801f3197a98
[ 1402.004401] &amp;lt;d&amp;gt; ffff8801f30c6b38 ffff8801f2b3bb58 ffff8801f318da30 ffffffffa0d0c314
[ 1402.004401] &amp;lt;d&amp;gt; ffffffffa0afb6ef ffff8801f2b3bb58 00000000fffffff2 ffff8801f3197a68
[ 1402.004401] Call Trace:
[ 1402.004401]  [&amp;lt;ffffffffa0d0c314&amp;gt;] ? lod_get_ea+0x514/0x520 [lod]
[ 1402.004401]  [&amp;lt;ffffffffa0afb6ef&amp;gt;] ? osd_object_write_lock+0x9f/0x130 [osd_ldiskfs]
[ 1402.004401]  [&amp;lt;ffffffffa0d0c674&amp;gt;] lod_load_striping_locked+0x354/0x5d0 [lod]
[ 1402.004401]  [&amp;lt;ffffffffa0d0c959&amp;gt;] lod_load_striping+0x69/0x190 [lod]
[ 1402.004401]  [&amp;lt;ffffffffa0d2066e&amp;gt;] lod_declare_attr_set+0x26e/0x760 [lod]
[ 1402.004401]  [&amp;lt;ffffffffa0be8378&amp;gt;] mdd_unlink+0x448/0xe80 [mdd]
[ 1402.004401]  [&amp;lt;ffffffffa0c5050a&amp;gt;] ? mdt_reint_unlink+0x9ca/0x10b0 [mdt]
[ 1402.004401]  [&amp;lt;ffffffffa02cf001&amp;gt;] ? libcfs_debug_msg+0x41/0x50 [libcfs]
[ 1402.004401]  [&amp;lt;ffffffffa0c47628&amp;gt;] mdo_unlink+0x18/0x50 [mdt]
[ 1402.004401]  [&amp;lt;ffffffffa0c50544&amp;gt;] mdt_reint_unlink+0xa04/0x10b0 [mdt]
[ 1402.004401]  [&amp;lt;ffffffffa0c473c1&amp;gt;] mdt_reint_rec+0x41/0xe0 [mdt]
[ 1402.004401]  [&amp;lt;ffffffffa0c2cc63&amp;gt;] mdt_reint_internal+0x4c3/0x7c0 [mdt]
[ 1402.004401]  [&amp;lt;ffffffffa0c2d4eb&amp;gt;] mdt_reint+0x6b/0x120 [mdt]
[ 1402.004401]  [&amp;lt;ffffffffa06f1445&amp;gt;] tgt_request_handle+0x245/0xad0 [ptlrpc]
[ 1402.004401]  [&amp;lt;ffffffffa06a1e01&amp;gt;] ptlrpc_main+0xce1/0x1960 [ptlrpc]
[ 1402.004401]  [&amp;lt;ffffffffa06a1120&amp;gt;] ? ptlrpc_main+0x0/0x1960 [ptlrpc]
[ 1402.004401]  [&amp;lt;ffffffff8109eab6&amp;gt;] kthread+0x96/0xa0
[ 1402.004401]  [&amp;lt;ffffffff8100c30a&amp;gt;] child_rip+0xa/0x20
[ 1402.004401]  [&amp;lt;ffffffff81554710&amp;gt;] ? _spin_unlock_irq+0x30/0x40
[ 1402.004401]  [&amp;lt;ffffffff8100bb10&amp;gt;] ? restore_args+0x0/0x30
[ 1402.004401]  [&amp;lt;ffffffff8109ea20&amp;gt;] ? kthread+0x0/0xa0
[ 1402.004401]  [&amp;lt;ffffffff8100c300&amp;gt;] ? child_rip+0x0/0x20
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This issue was found through DT API fault injection.&lt;/p&gt;</description>
                <environment></environment>
        <key id="25753">LU-5417</key>
            <summary>lod_load_striping_locked() fails to detect errors from lod_get_lmv_ea()</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="dmiter">Dmitry Eremin</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>fault</label>
                            <label>lod</label>
                    </labels>
                <created>Fri, 25 Jul 2014 16:34:55 +0000</created>
                <updated>Sat, 30 May 2015 04:15:43 +0000</updated>
                            <resolved>Wed, 3 Sep 2014 09:07:34 +0000</resolved>
                                    <version>Lustre 2.7.0</version>
                                    <fixVersion>Lustre 2.7.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="90074" author="green" created="Fri, 25 Jul 2014 17:51:25 +0000"  >&lt;p&gt;So this might be a broder class of problems that we need to do a separate audit of this.&lt;br/&gt;
 Idid some grepping around and there&apos;s plenty of &quot;if (rc &amp;lt; sizeof ....)&quot; kind of code. Closer look shows that most of cases are ok because there&apos;s usually a preceeding &quot;if (rc &amp;lt; 0)&quot; before that statement.&lt;br/&gt;
But theern there&apos;s e.g. lod_xattr_get that while correct, is correct for non obvious reasons.&lt;/p&gt;

&lt;p&gt;I wonder if we should run some static tool for signed/unsigned comparison and ensure all matches are checked for correctness/fixed/made more obvious?&lt;/p&gt;</comment>
                            <comment id="90076" author="adilger" created="Fri, 25 Jul 2014 17:52:52 +0000"  >&lt;p&gt;Ouch, it took me a few looks to even see what the problem is, but Oleg confirmed that rc is &quot;promoted&quot; to unsigned int to match sizeof() and does the comparison as an unsigned value. &lt;/p&gt;</comment>
                            <comment id="90078" author="pjones" created="Fri, 25 Jul 2014 18:18:59 +0000"  >&lt;p&gt;Dmitry&lt;/p&gt;

&lt;p&gt;Could you please look into this one?&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="90215" author="dmiter" created="Mon, 28 Jul 2014 18:07:16 +0000"  >&lt;p&gt;Uff. I observed few other places with such weird code. For example, in tgt_handle_lfsck_query() we have the following:&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;reply-&amp;gt;lr_status = tgt_lfsck_query(tsi-&amp;gt;tsi_env, tsi-&amp;gt;tsi_tgt-&amp;gt;lut_bottom, request);
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (reply-&amp;gt;lr_status &amp;lt; 0)
	rc = reply-&amp;gt;lr_status;
RETURN(rc);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The &lt;tt&gt;reply-&amp;gt;lr_status&lt;/tt&gt; is &lt;tt&gt;unsigned int&lt;/tt&gt;. Therefore &lt;tt&gt;if&lt;/tt&gt; is always false. So, we need a more careful look through such kind of code.&lt;/p&gt;</comment>
                            <comment id="90247" author="jhammond" created="Mon, 28 Jul 2014 22:46:15 +0000"  >&lt;p&gt;You could do&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;make EXTRA_POST_CFLAGS=&apos;-Wsign-compare -Wno-error 2&amp;gt;&amp;amp;1 1&amp;gt; /dev/&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; | grep warning | sort | uniq
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There are only 1059 comparisons to check!&lt;/p&gt;</comment>
                            <comment id="90516" author="dmiter" created="Thu, 31 Jul 2014 06:55:09 +0000"  >&lt;p&gt;Originally I got 1084 warnings for current master. After my patch &lt;a href=&quot;http://review.whamcloud.com/11281/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/11281/&lt;/a&gt; it&apos;s reduced to 1017. And &lt;tt&gt;lod&lt;/tt&gt; now have only 3 warnings:&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;lustre-release/lustre/lod/lod_qos.c:1169: warning: comparison between signed and unsigned integer expressions
lustre-release/lustre/lod/lod_qos.c:182: warning: comparison between signed and unsigned integer expressions
lustre-release/lustre/lod/lod_qos.c:711: warning: comparison between signed and unsigned integer expressions
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="90713" author="dmiter" created="Mon, 4 Aug 2014 16:41:38 +0000"  >&lt;p&gt;After series of &lt;a href=&quot;http://review.whamcloud.com/#/q/message:LU-5417,n,z&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;pathes&lt;/a&gt; all warnings from lustre/lod/* goes away and total amount of warnings become 1004.&lt;/p&gt;</comment>
                            <comment id="108208" author="gerrit" created="Fri, 27 Feb 2015 07:43:56 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/13903&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13903&lt;/a&gt;&lt;br/&gt;
Subject: Revert &quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5417&quot; title=&quot;lod_load_striping_locked() fails to detect errors from lod_get_lmv_ea()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5417&quot;&gt;&lt;del&gt;LU-5417&lt;/del&gt;&lt;/a&gt; lfs: fix comparison between signed and unsigned&quot;&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 91bfc8b2f8c37ea8d3fbdb059e3c51a8164ca8a6&lt;/p&gt;</comment>
                            <comment id="108257" author="gerrit" created="Fri, 27 Feb 2015 18:12:21 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/13903/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13903/&lt;/a&gt;&lt;br/&gt;
Subject: Revert &quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5417&quot; title=&quot;lod_load_striping_locked() fails to detect errors from lod_get_lmv_ea()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5417&quot;&gt;&lt;del&gt;LU-5417&lt;/del&gt;&lt;/a&gt; lfs: fix comparison between signed and unsigned&quot;&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: bbadfbefd9e0323172ad0a37b4268e68bf0968b7&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="29697">LU-6506</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|hzwsc7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>15066</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>