<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:54:08 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-12613] Lustre lustre_msg_string() bug</title>
                <link>https://jira.whamcloud.com/browse/LU-12613</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-access bug due to the lack of validation for specific fields of packets sent by client.&lt;/p&gt;

&lt;p&gt;The kernel 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;
[ 190.198913] BUG: unable to handle kernel paging request at ffff96e50a9811e0 [ 190.201204] IP: [&amp;lt;ffffffff9d37fd8d&amp;gt;] strnlen+0xd/0x40 [ 190.203235] PGD 218a52067 PUD 0 [ 190.205073] Oops: 0000 [#1] SMP [ 190.206896] Modules linked in: ofd(OE) ost(OE) osp(OE) mdd(OE) lod(OE) mdt(OE) lfsck(OE) mgs(OE) osd_ldiskfs(OE) lquota(OE) ldiskfs(OE) loop lustre(OE) obdecho(OE) mgc(OE) lov(OE) mdc(OE) osc(OE) lmv(OE) fid(OE) fld(OE) ptlrpc(OE) obdclass(OE) crc_t10dif crct10dif_generic ksocklnd(OE) lnet(OE) libcfs(OE) dm_flakey dm_mod nfit libnvdimm iosf_mbi crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd ppdev joydev pcspkr virtio_balloon parport_pc parport i2c_piix4 ip_tables ext4 mbcache jbd2 ata_generic pata_acpi virtio_net virtio_console virtio_blk cirrus drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm ata_piix drm libata crct10dif_pclmul crct10dif_common crc32c_intel serio_raw virtio_pci virtio_ring virtio drm_panel_orientation_quirks floppy [ 190.225100] CPU: 3 PID: 3029 Comm: mdt00_000 Kdump: loaded Tainted: G OE ------------ 3.10.0-957.10.1.el7_lustre.x86_64 #1 [ 190.229212] Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 3288b3c 04/01/2014 [ 190.231427] task: ffff96e41073b0c0 ti: ffff96e40ca78000 task.ti: ffff96e40ca78000 [ 190.233629] RIP: 0010:[&amp;lt;ffffffff9d37fd8d&amp;gt;] [&amp;lt;ffffffff9d37fd8d&amp;gt;] strnlen+0xd/0x40 [ 190.235840] RSP: 0018:ffff96e40ca7b948 EFLAGS: 00010202 [ 190.237836] RAX: 0000000000000006 RBX: ffff96e42ea47570 RCX: 0000000000000000 [ 190.240017] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff96e50a9811e0 [ 190.242169] RBP: ffff96e40ca7b948 R08: 0000000000000000 R09: 00000000dbf39c70 [ 190.244293] R10: 0000000000000002 R11: 0000000000000020 R12: 0000000000000001 [ 190.246405] R13: ffff96e50a9811e0 R14: 0000000000000006 R15: 0000000000000000 [ 190.248499] FS: 0000000000000000(0000) GS:ffff96e43fd80000(0000) knlGS:0000000000000000 [ 190.250671] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 190.252613] CR2: ffff96e50a9811e0 CR3: 0000000427bfa000 CR4: 00000000003606e0 [ 190.254692] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 190.256766] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 190.258818] Call Trace: [ 190.260502] [&amp;lt;ffffffffc09a6d72&amp;gt;] lustre_msg_string+0x52/0x280 [ptlrpc] [ 190.262506] [&amp;lt;ffffffffc05da395&amp;gt;] ? cfs_trace_unlock_tcd+0x35/0x90 [libcfs] [ 190.264588] [&amp;lt;ffffffffc09a6d20&amp;gt;] ? lustre_msg_bufcount+0x80/0x80 [ptlrpc] [ 190.266637] [&amp;lt;ffffffffc09cd47b&amp;gt;] __req_capsule_get+0x12b/0x740 [ptlrpc] [ 190.268633] [&amp;lt;ffffffffc09a5010&amp;gt;] ? lustre_msg_buf_v2+0x1b0/0x1b0 [ptlrpc] [ 190.270642] [&amp;lt;ffffffffc09cdaa5&amp;gt;] req_capsule_client_get+0x15/0x20 [ptlrpc] [ 190.272634] [&amp;lt;ffffffffc10510c3&amp;gt;] mdt_name_unpack+0x23/0xd0 [mdt] [ 190.274523] [&amp;lt;ffffffffc1052e96&amp;gt;] mdt_open_unpack+0x166/0x410 [mdt] [ 190.276410] [&amp;lt;ffffffffc10531eb&amp;gt;] mdt_reint_unpack+0xab/0x210 [mdt] [ 190.278284] [&amp;lt;ffffffffc103cd23&amp;gt;] mdt_reint_internal+0x43/0xb90 [mdt] [ 190.280151] [&amp;lt;ffffffffc10497b6&amp;gt;] ? mdt_intent_fixup_resent+0x36/0x220 [mdt] [ 190.282066] [&amp;lt;ffffffffc1049a22&amp;gt;] mdt_intent_open+0x82/0x3a0 [mdt] [ 190.283917] [&amp;lt;ffffffffc074cb49&amp;gt;] ? lprocfs_counter_add+0xf9/0x160 [obdclass] [ 190.285824] [&amp;lt;ffffffffc10479e4&amp;gt;] mdt_intent_policy+0x2d4/0xdd0 [mdt] [ 190.287657] [&amp;lt;ffffffffc10499a0&amp;gt;] ? mdt_intent_fixup_resent+0x220/0x220 [mdt] [ 190.289550] [&amp;lt;ffffffffc0958c66&amp;gt;] ldlm_lock_enqueue+0x356/0xa20 [ptlrpc] [ 190.291407] [&amp;lt;ffffffffc05e43d3&amp;gt;] ? cfs_hash_bd_add_locked+0x63/0x80 [libcfs] [ 190.293278] [&amp;lt;ffffffffc05e796e&amp;gt;] ? cfs_hash_add+0xbe/0x1a0 [libcfs] [ 190.295073] [&amp;lt;ffffffffc0981587&amp;gt;] ldlm_handle_enqueue0+0xa47/0x15a0 [ptlrpc] [ 190.296924] [&amp;lt;ffffffffc09a9520&amp;gt;] ? lustre_swab_ldlm_lock_desc+0x30/0x30 [ptlrpc] [ 190.298825] [&amp;lt;ffffffffc0a0a082&amp;gt;] tgt_enqueue+0x62/0x210 [ptlrpc] [ 190.300586] [&amp;lt;ffffffffc0a102ca&amp;gt;] tgt_request_handle+0x91a/0x15c0 [ptlrpc] [ 190.302399] [&amp;lt;ffffffffc05e0fa7&amp;gt;] ? libcfs_debug_msg+0x57/0x80 [libcfs] [ 190.304211] [&amp;lt;ffffffffc09b388e&amp;gt;] ptlrpc_server_handle_request+0x24e/0xab0 [ptlrpc] [ 190.306082] [&amp;lt;ffffffff9d0cbadb&amp;gt;] ? __wake_up_common+0x5b/0x90 [ 190.307775] [&amp;lt;ffffffffc09b7384&amp;gt;] ptlrpc_main+0xbb4/0x20f0 [ptlrpc] [ 190.309463] [&amp;lt;ffffffff9d0d08c0&amp;gt;] ? finish_task_switch+0x50/0x1c0 [ 190.311131] [&amp;lt;ffffffffc09b67d0&amp;gt;] ? ptlrpc_register_service+0xfa0/0xfa0 [ptlrpc] [ 190.312860] [&amp;lt;ffffffff9d0c1c71&amp;gt;] kthread+0xd1/0xe0 [ 190.314340] [&amp;lt;ffffffff9d0c1ba0&amp;gt;] ? insert_kthread_work+0x40/0x40 [ 190.315899] [&amp;lt;ffffffff9d775c1d&amp;gt;] ret_from_fork_nospec_begin+0x7/0x21 [ 190.317470] [&amp;lt;ffffffff9d0c1ba0&amp;gt;] ? insert_kthread_work+0x40/0x40 [ 190.318974] Code: c0 01 80 38 00 75 f7 48 29 f8 5d c3 31 c0 5d c3 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 55 48 85 f6 48 8d 4e ff 48 89 e5 74 2a &amp;lt;80&amp;gt; 3f 00 74 25 48 89 f8 31 d2 eb 10 0f 1f 80 00 00 00 00 48 83 [ 190.323574] RIP [&amp;lt;ffffffff9d37fd8d&amp;gt;] strnlen+0xd/0x40 [ 190.325038] RSP &amp;lt;ffff96e40ca7b948&amp;gt; [ 190.326320] CR2: ffff96e50a9811e0&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; In function lustre_msg_string(), there is no check about the value of blen derived from lustre_msg_buflen_v2(), and cause a out-of-access bug in strnlen.&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;case&lt;/span&gt; LUSTRE_MSG_MAGIC_V2:&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 
      str = lustre_msg_buf_v2(m, index, 0);&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 
      blen = lustre_msg_buflen_v2(m, index);&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 
         &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;&#160; &#160; &#160; &#160; 
      &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 
        LASSERTF(0, &lt;span class=&quot;code-quote&quot;&gt;&quot;incorrect message magic: %08x\n&quot;&lt;/span&gt;, m-&amp;gt;lm_magic);&#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; ...
&#160; &#160; &#160; &#160;slen = strnlen(str, blen);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="56528">LU-12613</key>
            <summary>Lustre lustre_msg_string() 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>Tue, 30 Jul 2019 11:17:09 +0000</created>
                <updated>Thu, 16 Mar 2023 15:28:43 +0000</updated>
                            <resolved>Mon, 16 Sep 2019 23:39:23 +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="252346" author="pjones" created="Wed, 31 Jul 2019 17:51:55 +0000"  >&lt;p&gt;Emoly&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="253664" author="gerrit" created="Tue, 27 Aug 2019 03:33:03 +0000"  >&lt;p&gt;Emoly Liu (emoly@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35932&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35932&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12613&quot; title=&quot;Lustre lustre_msg_string() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12613&quot;&gt;&lt;del&gt;LU-12613&lt;/del&gt;&lt;/a&gt; ptlrpc: check buffer length in lustre_msg_string()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 6cf6a525733f9651512c94ac7d31fdcac8b7f075&lt;/p&gt;</comment>
                            <comment id="254767" author="gerrit" created="Mon, 16 Sep 2019 23:00:45 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35932/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35932/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12613&quot; title=&quot;Lustre lustre_msg_string() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12613&quot;&gt;&lt;del&gt;LU-12613&lt;/del&gt;&lt;/a&gt; ptlrpc: check buffer length in lustre_msg_string()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 728c58d60faef288eb7d05d8809fa2b1a55ade89&lt;/p&gt;</comment>
                            <comment id="254837" author="pjones" created="Mon, 16 Sep 2019 23:39:23 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="254884" author="gerrit" created="Tue, 17 Sep 2019 14:52:20 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36209&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36209&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12613&quot; title=&quot;Lustre lustre_msg_string() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12613&quot;&gt;&lt;del&gt;LU-12613&lt;/del&gt;&lt;/a&gt; ptlrpc: check buffer length in lustre_msg_string()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: b91cc4864c4b1f48ded4b996e8636a26b5b5ff56&lt;/p&gt;</comment>
                            <comment id="255234" author="gerrit" created="Mon, 23 Sep 2019 08:43:05 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36209/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36209/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12613&quot; title=&quot;Lustre lustre_msg_string() bug&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12613&quot;&gt;&lt;del&gt;LU-12613&lt;/del&gt;&lt;/a&gt; ptlrpc: check buffer length in lustre_msg_string()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: cf87ca84eaf7c8bf1855802a71130ac0ed251cc9&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>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="75016">LU-16634</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|i00ken:</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>