<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:53:56 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-12590] Lustre lustre_msg_hdr_size_v2() bug</title>
                <link>https://jira.whamcloud.com/browse/LU-12590</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In the latest version of lustre file system, ptlrpc module has a out of read bug due to the lack of validation for specific fields of packets sent by client.&lt;/p&gt;

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

&lt;p&gt;The kenrel panic:&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;CPU: 0 PID: 3002 Comm: ll_mgs_0002
Kdump: loaded
Tainted: G OE ------------ 3.10.0-957.10.1.el7_lustre.x86_64 #1
Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 99a222b 04/01/2014
task: ffff986c19a85140 ti: ffff986c22a88000 task.ti: ffff986c22a88000
RIP: 0010:[&amp;lt;ffffffffc077a480&amp;gt;] [&amp;lt;ffffffffc077a480&amp;gt;] __lustre_unpack_msg+0x100/0x430 [ptlrpc]
RSP: 0018:ffff986c22a8bda0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff986c2ed0e000 RCX: 00000000786c35f8 
RDX: 00000000000000e0 RSI: 00000000044bc7f8 RDI: ffff986c2ed0e000 
RBP: ffff986c22a8bdb8 R08: 00000000044bc7f8 R09: 0000000000000008 
R10: 00000000ffffff10 R11: 0000000000000005 R12: ffff986c2ed0e000
R13: ffff986c19bf77c0 R14: ffff986c2aa24700 R15: ffff986c19ea9000
FS: 0000000000000000(0000) GS:ffff986c3fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff986c40000000 CR3: 000000042277c000 CR4: 00000000003606f0 
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 
Call Trace:
[&amp;lt;ffffffffc07ad7d3&amp;gt;] sptlrpc_svc_unwrap_request+0x73/0x600 [ptlrpc] 
[&amp;lt;ffffffffc078e236&amp;gt;] ptlrpc_main+0xa66/0x20f0 [ptlrpc]
[&amp;lt;ffffffff9e2c1c71&amp;gt;] kthread+0xd1/0xe0 
[&amp;lt;ffffffff9e975c1d&amp;gt;] ret_from_fork_nospec_begin+0x7/0x21
Code: 
RIP [&amp;lt;ffffffffc077a480&amp;gt;] __lustre_unpack_msg+0x100/0x430 [ptlrpc]
RSP &amp;lt;ffff986c22a8bda0&amp;gt;
CR2: ffff986c40000000
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;In the &apos;sptlrpc_svc_unwrap_request&apos; function of ptlrpc module, lustre_msg_hdr_size_v2() parses lustre_msg sent by client, but does not check the value, which results in out-of-bounds read.&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; inline __u32 lustre_msg_hdr_size_v2(__u32 count)

{
 &#160; &#160; &#160; &#160; &#160;&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; cfs_size_round(offsetof(struct lustre_msg_v2, lm_buflens[count]));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;We can trigger this bug by sending a malformed lustre packet and modifying the lm_bufcount field.&lt;/p&gt;

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

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

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

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>Red hat 7</environment>
        <key id="56495">LU-12590</key>
            <summary>Lustre lustre_msg_hdr_size_v2() bug</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="emoly.liu">Emoly Liu</assignee>
                                    <reporter username="yunye.ry">Alibaba Cloud</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Jul 2019 07:26:07 +0000</created>
                <updated>Wed, 18 Sep 2019 12:46:31 +0000</updated>
                            <resolved>Sat, 7 Sep 2019 05:07:35 +0000</resolved>
                                                    <fixVersion>Lustre 2.13.0</fixVersion>
                    <fixVersion>Lustre 2.12.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="252080" author="pjones" created="Fri, 26 Jul 2019 17:42:43 +0000"  >&lt;p&gt;Emoly&lt;/p&gt;

&lt;p&gt;Could you please assist with this one?&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="252081" author="adilger" created="Fri, 26 Jul 2019 18:04:49 +0000"  >&lt;p&gt;The most simple fix would be to check the &lt;tt&gt;count&lt;/tt&gt; files in &lt;tt&gt;lustre_msg_hdr_size_v2()&lt;/tt&gt;, but it is likely that we would need to add similar checks all over the code. Instead, it makes sense to do a higher-level validation of the RPC format in &lt;tt&gt;__lustre_unpack_msg()&lt;/tt&gt; (&lt;tt&gt;lm_bufcount&lt;/tt&gt;, etc.) before any of these fields are used. &lt;/p&gt;</comment>
                            <comment id="252400" author="adilger" created="Thu, 1 Aug 2019 17:44:26 +0000"  >&lt;p&gt;Please add &quot;&lt;tt&gt;Reported-by: Alibaba Cloud &amp;lt;yunye.ry@alibaba-inc.com&amp;gt;&lt;/tt&gt;&quot; to the patch commit message.&lt;/p&gt;</comment>
                            <comment id="252987" author="gerrit" created="Tue, 13 Aug 2019 09:52:47 +0000"  >&lt;p&gt;Emoly Liu (emoly@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35783&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35783&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12590&quot; title=&quot;Lustre lustre_msg_hdr_size_v2() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12590&quot;&gt;&lt;del&gt;LU-12590&lt;/del&gt;&lt;/a&gt; ptlrpc: check lm_bufcount for lustre_msg_hdr_size_v2()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: fd0533b2f934ffc644f818ece41fc9349ea447fb&lt;/p&gt;</comment>
                            <comment id="253694" author="adilger" created="Tue, 27 Aug 2019 16:48:48 +0000"  >&lt;p&gt;Alibaba Cloud, are you willing to share your testing tool?  That would save us development effort. &lt;/p&gt;

&lt;p&gt;Otherwise, my thought is to add a fail_loc that causes an outgoing RPC message buffer to be randomly corrupted in some small way like a fuzzer tool. This would mean changing eg. one byte in the header or body of the message at some frequency below 100%, otherwise it may be that the client would just be evicted if all of its messages are broken. &lt;/p&gt;</comment>
                            <comment id="254306" author="gerrit" created="Sat, 7 Sep 2019 01:34:07 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35783/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35783/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12590&quot; title=&quot;Lustre lustre_msg_hdr_size_v2() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12590&quot;&gt;&lt;del&gt;LU-12590&lt;/del&gt;&lt;/a&gt; ptlrpc: check lm_bufcount and lm_buflen&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 268edb13d769994c4841864034d72f0bd7b36e12&lt;/p&gt;</comment>
                            <comment id="254330" author="pjones" created="Sat, 7 Sep 2019 05:07:35 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="254403" author="gerrit" created="Mon, 9 Sep 2019 18:09:09 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36119&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36119&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12590&quot; title=&quot;Lustre lustre_msg_hdr_size_v2() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12590&quot;&gt;&lt;del&gt;LU-12590&lt;/del&gt;&lt;/a&gt; ptlrpc: check lm_bufcount and lm_buflen&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 4a346abc8cf45088e4b27dda0ce5100039b60eea&lt;/p&gt;</comment>
                            <comment id="254946" author="gerrit" created="Wed, 18 Sep 2019 04:24:08 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36119/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36119/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12590&quot; title=&quot;Lustre lustre_msg_hdr_size_v2() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12590&quot;&gt;&lt;del&gt;LU-12590&lt;/del&gt;&lt;/a&gt; ptlrpc: check lm_bufcount and lm_buflen&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 2257e1ed7ce6a449fdc52ca7a492b8320289e9db&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="56513">LU-12605</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|i00k7b:</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="10021"><![CDATA[2]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>