<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:54:04 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-12605] Lustre target_handle_connect() bug</title>
                <link>https://jira.whamcloud.com/browse/LU-12605</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.&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;
[  607.979453] Call Trace:
[  607.981190]  [&amp;lt;ffffffffc0a76199&amp;gt;] ? +0xd19/0x2960 [ptlrpc]
[  607.983385]  [&amp;lt;ffffffffc0b1f02a&amp;gt;] tgt_request_handle+0x67a/0x15c0 [ptlrpc]
[  607.985484]  [&amp;lt;ffffffffc0710fa7&amp;gt;] ? libcfs_debug_msg+0x57/0x80 [libcfs]
[  607.987581]  [&amp;lt;ffffffffc0ac288e&amp;gt;] ptlrpc_server_handle_request+0x24e/0xab0 [ptlrpc]
[  607.989741]  [&amp;lt;ffffffffabacbadb&amp;gt;] ? __wake_up_common+0x5b/0x90
[  607.991741]  [&amp;lt;ffffffffc0ac6384&amp;gt;] ptlrpc_main+0xbb4/0x20f0 [ptlrpc]
[  607.993731]  [&amp;lt;ffffffffabad08c0&amp;gt;] ? finish_task_switch+0x50/0x1c0
[  607.995760]  [&amp;lt;ffffffffc0ac57d0&amp;gt;] ? ptlrpc_register_service+0xfa0/0xfa0 [ptlrpc]
[  607.997834]  [&amp;lt;ffffffffabac1c71&amp;gt;] kthread+0xd1/0xe0
[  607.999655]  [&amp;lt;ffffffffabac1ba0&amp;gt;] ? insert_kthread_work+0x40/0x40
[  608.001584]  [&amp;lt;ffffffffac175c1d&amp;gt;] ret_from_fork_nospec_begin+0x7/0x21
[  608.003533]  [&amp;lt;ffffffffabac1ba0&amp;gt;] ? insert_kthread_work+0x40/0x40
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The function target_handle_connect() don&apos;t check the value of size when client connect to server. If size is -1, the min function will return -1. But 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;
size = req_capsule_get_size(&amp;amp;req-&amp;gt;rq_pill, &amp;amp;RMF_CONNECT_DATA,
                                    RCL_CLIENT);
memcpy(tmpdata, data, min(tmpsize, size));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="56513">LU-12605</key>
            <summary>Lustre target_handle_connect() 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>Mon, 29 Jul 2019 10:51:13 +0000</created>
                <updated>Thu, 12 Sep 2019 17:16:12 +0000</updated>
                            <resolved>Tue, 27 Aug 2019 02:52:05 +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>5</watches>
                                                                            <comments>
                            <comment id="252343" author="pjones" created="Wed, 31 Jul 2019 17:42:09 +0000"  >&lt;p&gt;S&#233;bastien&lt;/p&gt;

&lt;p&gt;Could you please investigate&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="252344" author="adilger" created="Wed, 31 Jul 2019 17:49:06 +0000"  >&lt;p&gt;&lt;tt&gt;lustre_unpack_msg_v2()&lt;/tt&gt; is what is touching the message buffer first, and is the right place to do sanity checking of the message buffers. While &lt;tt&gt;lustre_msg_buf_v2()&lt;/tt&gt; is used in a lot of places to access various buffers internally, we don&apos;t necessarily want to do validity checking for every access throughout the code. Having a high-level scrub once at message receipt makes the most sense, and then the internal accessors can assume it is valid.&lt;/p&gt;

&lt;p&gt;Checks that should be added:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;validate that the number of buffers is not too large (there a limit of 32 buffers per message based on &lt;tt&gt;sizeof(req-&amp;gt;rq_req_swab_mask)*8&lt;/tt&gt;, but there is no check of &lt;tt&gt;lm_bufcount&lt;/tt&gt; before it is used.&lt;/li&gt;
	&lt;li&gt;validate that individual buffer lengths and the total message lengths are not insane (i.e. integers &amp;lt; &lt;tt&gt;INT_MAX/MAX_BUFFER_COUNT&lt;/tt&gt; so that they are not treated as negative &lt;tt&gt;int&lt;/tt&gt; values)&lt;/li&gt;
	&lt;li&gt;validate that the individual buffer lengths are less than the total message length to avoid overflow when added&lt;/li&gt;
	&lt;li&gt;validate that the provided lengths are not larger than the total message size&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="252347" author="pjones" created="Wed, 31 Jul 2019 17:53:38 +0000"  >&lt;p&gt;Emoly&lt;/p&gt;

&lt;p&gt;Actually can you please work on this one&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="252407" author="adilger" created="Thu, 1 Aug 2019 18:01:53 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=yunye.ry&quot; class=&quot;user-hover&quot; rel=&quot;yunye.ry&quot;&gt;yunye.ry&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;please register for an account on Gerrit &lt;a href=&quot;https://review.whamcloud.com/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/&lt;/a&gt; so that you can be added as a reviewer for the patches that are being developed for the various issues that you have filed.&#160; Then you can verify that they are fixing the reported problems by adding your +1 to the patch (assuming it is correct).&#160; This will result in a &quot;&lt;tt&gt;Reviewed-by: Your Name &amp;lt;your_email&amp;gt;&lt;/tt&gt;&quot; label on the final patch, and Alibaba will also be listed in the Lustre contribution statistics in &lt;a href=&quot;http://wiki.lustre.org/images/a/a1/LUG2019-Community-Release-Update-Jones.pdf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Lustre presentations&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="252451" author="yunye.ry" created="Fri, 2 Aug 2019 12:08:04 +0000"  >&lt;p&gt;Ok, I will do it, thank you&lt;/p&gt;</comment>
                            <comment id="252453" author="yunye.ry" created="Fri, 2 Aug 2019 12:49:22 +0000"  >&lt;p&gt;Hi Andreas,&lt;br/&gt;
        I tried to register in the &lt;a href=&quot;https://review.whamcloud.com/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/&lt;/a&gt;  but failed.  The register site ( &lt;a href=&quot;https://review.whamcloud.com/login/%23%2Fregister%2Fq%2Fstatus%3Aopen&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/login/%23%2Fregister%2Fq%2Fstatus%3Aopen&lt;/a&gt;) shows that I can log in with my whamcloud account, but it seems failed. The wrong message is &apos;Invalid authentication&apos;. Do I have to register for an OpenID account? Thank you.&lt;/p&gt;</comment>
                            <comment id="252454" author="pjones" created="Fri, 2 Aug 2019 12:51:40 +0000"  >&lt;p&gt;Yes - as you are not part of the Whamcloud team you will need an account based on an OpenID identity. These kinds of questions are probably best handled via direct email rather than in JIRA (where anyone can read them)&lt;/p&gt;</comment>
                            <comment id="252655" author="gerrit" created="Wed, 7 Aug 2019 07:52:07 +0000"  >&lt;p&gt;Emoly Liu (emoly@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35711&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35711&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12605&quot; title=&quot;Lustre target_handle_connect() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12605&quot;&gt;&lt;del&gt;LU-12605&lt;/del&gt;&lt;/a&gt; tgt: check data size in target_handle_connect()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: ba4979f6b25e64576e7906ec6cd559f3499adba7&lt;/p&gt;</comment>
                            <comment id="253645" author="gerrit" created="Tue, 27 Aug 2019 02:20:59 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35711/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35711/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12605&quot; title=&quot;Lustre target_handle_connect() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12605&quot;&gt;&lt;del&gt;LU-12605&lt;/del&gt;&lt;/a&gt; tgt: check client data size in target_handle_connect()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 149f005a3199eee13fe6396671613a0f620ee0cc&lt;/p&gt;</comment>
                            <comment id="253655" author="pjones" created="Tue, 27 Aug 2019 02:52:05 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="253692" author="gerrit" created="Tue, 27 Aug 2019 16:38:49 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35935&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35935&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12605&quot; title=&quot;Lustre target_handle_connect() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12605&quot;&gt;&lt;del&gt;LU-12605&lt;/del&gt;&lt;/a&gt; tgt: check client data size in target_handle_connect()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: c43893e5a876a180b321df714a61630ad4b7c03f&lt;/p&gt;</comment>
                            <comment id="254579" author="gerrit" created="Thu, 12 Sep 2019 03:48:18 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35935/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35935/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12605&quot; title=&quot;Lustre target_handle_connect() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12605&quot;&gt;&lt;del&gt;LU-12605&lt;/del&gt;&lt;/a&gt; tgt: check client data size in target_handle_connect()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: d70c45a124aa2580115111aa8a77648f073dc799&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="56495">LU-12590</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56508">LU-12600</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56510">LU-12602</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56511">LU-12603</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56512">LU-12604</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56527">LU-12612</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56528">LU-12613</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56530">LU-12615</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|i00kbb:</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>