<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:54:02 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-12601] Lustre tgt_brw_write() bug</title>
                <link>https://jira.whamcloud.com/browse/LU-12601</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;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;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;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,&#160;&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;&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, &#160; &#160; &#160; &#160;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;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="56509">LU-12601</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="1" iconUrl="https://jira.whamcloud.com/images/icons/priorities/blocker.svg">Blocker</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="3">Duplicate</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="yunye.ry">Alibaba Cloud</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Jul 2019 09:20:33 +0000</created>
                <updated>Thu, 1 Aug 2019 17:51:35 +0000</updated>
                            <resolved>Tue, 30 Jul 2019 18:08:44 +0000</resolved>
                                    <version>Lustre 2.13.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="252286" author="adilger" created="Tue, 30 Jul 2019 18:08:31 +0000"  >&lt;p&gt;This looks exactly the same as &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;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="56508">LU-12600</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|i00kaf:</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>