<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:54:01 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-12600] Lustre tgt_brw_write() bug</title>
                <link>https://jira.whamcloud.com/browse/LU-12600</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In the latest version of lustre file system, ptlrpc module has a buffer overflow bug due to the lack of validation for specific fields of packets sent by client. We can overwrite up to 0xffffffff bytes of buffer, and it may cause rce problems.&lt;/p&gt;

&lt;p&gt;The kenrel panic:&lt;/p&gt;

&lt;p&gt;&#160;&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;
[277607.350937] BUG: unable to handle kernel paging request at ffff8a0fbf200000
[277607.389337] Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 3288b3c 04/01/2014
[277607.392123] task: ffff8a0fd5fd1040 ti: ffff8a0f2f630000 task.ti: ffff8a0f2f630000
[277607.394819] RIP: 0010:[&amp;lt;ffffffffb6586dc6&amp;gt;]  [&amp;lt;ffffffffb6586dc6&amp;gt;] memcpy+0x6/0x110
[277607.397521] RSP: 0018:ffff8a0f2f633b48  EFLAGS: 00010213
[277607.399983] RAX: ffff8a0fbe293000 RBX: ffff8a0fe52c0000 RCX: ffffffffff092fff
[277607.402641] RDX: ffffffffffffffff RSI: ffff8a0fe66738a8 RDI: ffff8a0fbf200000
[277607.405232] RBP: ffff8a0f2f633cb8 R08: 0000000000000000 R09: 00000000000001e8
[277607.407776] R10: 0000000000000000 R11: 0000000000000008 R12: 0000000000000000
[277607.410304] R13: 0000000000000012 R14: ffff8a0fedf4fde8 R15: ffff8a0fe52c0000
[277607.412787] FS:  0000000000000000(0000) GS:ffff8a0fffc00000(0000) knlGS:0000000000000000
[277607.415350] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[277607.417665] CR2: ffff8a0fbf200000 CR3: 0000000429b88000 CR4: 00000000003606f0
[277607.420114] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[277607.422527] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[277607.424915] Call Trace:
[277607.426900]  [&amp;lt;ffffffffc089531e&amp;gt;] ? tgt_brw_write+0xe8e/0x1cf0 [ptlrpc]
[277607.429200]  [&amp;lt;ffffffffc0462395&amp;gt;] ? cfs_trace_unlock_tcd+0x35/0x90 [libcfs]
[277607.431507]  [&amp;lt;ffffffffc0468af8&amp;gt;] ? libcfs_debug_vmsg2+0x6d8/0xb30 [libcfs]
[277607.433782]  [&amp;lt;ffffffffb6966e92&amp;gt;] ? mutex_lock+0x12/0x2f
[277607.435953]  [&amp;lt;ffffffffc08982ca&amp;gt;] tgt_request_handle+0x91a/0x15c0 [ptlrpc]
[277607.438177]  [&amp;lt;ffffffffc0468fa7&amp;gt;] ? libcfs_debug_msg+0x57/0x80 [libcfs]
[277607.440404]  [&amp;lt;ffffffffc083b88e&amp;gt;] ptlrpc_server_handle_request+0x24e/0xab0 [ptlrpc]
[277607.442661]  [&amp;lt;ffffffffb62cbadb&amp;gt;] ? __wake_up_common+0x5b/0x90
[277607.444751]  [&amp;lt;ffffffffc083f384&amp;gt;] ptlrpc_main+0xbb4/0x20f0 [ptlrpc]
[277607.446846]  [&amp;lt;ffffffffb62d08c0&amp;gt;] ? finish_task_switch+0x50/0x1c0
[277607.448897]  [&amp;lt;ffffffffc083e7d0&amp;gt;] ? ptlrpc_register_service+0xfa0/0xfa0 [ptlrpc]
[277607.451028]  [&amp;lt;ffffffffb62c1c71&amp;gt;] kthread+0xd1/0xe0
[277607.452918]  [&amp;lt;ffffffffb62c1ba0&amp;gt;] ? insert_kthread_work+0x40/0x40
[277607.454884]  [&amp;lt;ffffffffb6975c1d&amp;gt;] ret_from_fork_nospec_begin+0x7/0x21
[277607.456855]  [&amp;lt;ffffffffb62c1ba0&amp;gt;] ? insert_kthread_work+0x40/0x40
[277607.458760] Code: ca b6 31 c0 e8 4c 2d d1 ff 0f ae e8 0f 31 48 c1 e2 20 89 c0 48 09 c2 48 31 d3 e9 7b ff ff ff 90 90 90 90 90 90 48 89 f8 48 89 d1 &amp;lt;f3&amp;gt; a4 c3 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 20 4c 8b 06 4c 8b 
[277607.464121] RIP  [&amp;lt;ffffffffb6586dc6&amp;gt;] memcpy+0x6/0x110
[277607.465949]  RSP &amp;lt;ffff8a0f2f633b48&amp;gt;
[277607.467566] CR2: ffff8a0fbf200000
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

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

&lt;p&gt;In function tgt_brw_write(), the varible comes from req_capsule_get_size() don&apos;t be checked and it is passed to the tgt_shortio2pages() function. But in tgt_shortio2pages(), when executing the memcpy function, do &apos;?:&apos; check, len is int type, when len is negative, it can pass &apos;len&amp;lt;size&apos; check, and the third parameter of memcpy is unsigned int, -1 will be parsed into 0xffffffff, causing a buffer overflow.&lt;/p&gt;

&lt;p&gt;&#160;&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;if&lt;/span&gt; (body-&amp;gt;oa.o_flags &amp;amp; OBD_FL_SHORT_IO) { 
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; short_io_size; 
    unsigned &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *short_io_buf;
    short_io_size = req_capsule_get_size(&amp;amp;req-&amp;gt;rq_pill, &amp;amp;RMF_SHORT_IO, RCL_CLIENT); 
    short_io_buf = req_capsule_client_get(&amp;amp;req-&amp;gt;rq_pill, &amp;amp;RMF_SHORT_IO); CDEBUG(D_INFO, &lt;span class=&quot;code-quote&quot;&gt;&quot;Client use &lt;span class=&quot;code-object&quot;&gt;short&lt;/span&gt; io &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; data transfer,&quot;&lt;/span&gt; &#160; &#160; &#160; &#160;&lt;span class=&quot;code-quote&quot;&gt;&quot; size = %d\n&quot;&lt;/span&gt;, short_io_size);
   &lt;span class=&quot;code-comment&quot;&gt;/* Copy &lt;span class=&quot;code-object&quot;&gt;short&lt;/span&gt; io buf to pages */&lt;/span&gt; 
   rc = tgt_shortio2pages(local_nb, npages, short_io_buf, short_io_size); desc = NULL;
}

&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (i = 0; i &amp;lt; npages; i++) { 
    off = local[i].lnb_page_offset &amp;amp; ~PAGE_MASK; len = local[i].lnb_len;
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (len == 0) &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
     CDEBUG(D_PAGE, &lt;span class=&quot;code-quote&quot;&gt;&quot;index %d offset = %d len = %d left = %d\n&quot;&lt;/span&gt;, i, off, len, size); ptr = ll_kmap_atomic(local[i].lnb_page, KM_USER0); 
     &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (ptr == NULL) &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; -EINVAL; 
     memcpy(ptr + off, buf, len &amp;lt; size ? len : size); 
     ll_kunmap_atomic(ptr, KM_USER0); 
     buf += len; 
     size -= len; 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The backtrace:&lt;/p&gt;

&lt;p&gt;&#160;&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;
 ptlrpc_main -&amp;gt; ptlrpc_main -&amp;gt; ptlrpc_server_handle_request -&amp;gt; tgt_request_handle -&amp;gt; tgt_brw_write -&amp;gt; tgt_shortio2pages
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="56508">LU-12600</key>
            <summary>Lustre tgt_brw_write() 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="pfarrell">Patrick Farrell</assignee>
                                    <reporter username="yunye.ry">Alibaba Cloud</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Jul 2019 09:15:28 +0000</created>
                <updated>Mon, 11 Jul 2022 23:56:41 +0000</updated>
                            <resolved>Thu, 15 Aug 2019 13:23:42 +0000</resolved>
                                    <version>Lustre 2.13.0</version>
                                    <fixVersion>Lustre 2.13.0</fixVersion>
                    <fixVersion>Lustre 2.12.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="252288" author="gerrit" created="Tue, 30 Jul 2019 18:12:26 +0000"  >&lt;p&gt;Patrick Farrell (pfarrell@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35653&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35653&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12600&quot; title=&quot;Lustre tgt_brw_write() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12600&quot;&gt;&lt;del&gt;LU-12600&lt;/del&gt;&lt;/a&gt; tgt: shortio size should be unsigned&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: e46a460f0a4fc9540b4bf6751726be4afb2b52b4&lt;/p&gt;</comment>
                            <comment id="253047" author="gerrit" created="Thu, 15 Aug 2019 07:51:19 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35653/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35653/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12600&quot; title=&quot;Lustre tgt_brw_write() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12600&quot;&gt;&lt;del&gt;LU-12600&lt;/del&gt;&lt;/a&gt; tgt: shortio size should be unsigned&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 4c3864cf97711d73b12905fea720570cf814d179&lt;/p&gt;</comment>
                            <comment id="253092" author="pjones" created="Thu, 15 Aug 2019 13:23:42 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="253455" author="gerrit" created="Thu, 22 Aug 2019 20:33:33 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35867&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35867&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12600&quot; title=&quot;Lustre tgt_brw_write() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12600&quot;&gt;&lt;del&gt;LU-12600&lt;/del&gt;&lt;/a&gt; tgt: shortio size should be unsigned&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a7d58610790715b6cf3db5f9db0b54c0ca05082e&lt;/p&gt;</comment>
                            <comment id="254580" author="gerrit" created="Thu, 12 Sep 2019 03:48:23 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35867/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35867/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12600&quot; title=&quot;Lustre tgt_brw_write() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12600&quot;&gt;&lt;del&gt;LU-12600&lt;/del&gt;&lt;/a&gt; tgt: shortio size should be unsigned&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 7c8d76862717400c7498757ae6e491805cd701de&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="56509">LU-12601</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="56513">LU-12605</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="58604">LU-13413</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|i00ka7:</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>