<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:21:38 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-15827] BUG: KASAN: slab-out-of-bounds in osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]</title>
                <link>https://jira.whamcloud.com/browse/LU-15827</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;ol&gt;
	&lt;li&gt;There is a slab out of bounds write with encryption on master.
&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;Apr 26 08:27:15 l kernel: BUG: KASAN: slab-out-of-bounds in osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: Write of size 1 at addr ffff888005123400 by task mdt_rdpg00_001/518707
Apr 26 08:27:15 l kernel: 
Apr 26 08:27:15 l kernel: CPU: 1 PID: 518707 Comm: mdt_rdpg00_001 Kdump: loaded Tainted: G        W  OE    --------- -  - 4.18.0-348.7.1.el8.x86_64+debug #1
Apr 26 08:27:15 l kernel: Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
Apr 26 08:27:15 l kernel: Call Trace:
Apr 26 08:27:15 l kernel: dump_stack+0x8e/0xd0
Apr 26 08:27:15 l kernel: ? osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: print_address_description.constprop.5+0x1e/0x230
Apr 26 08:27:15 l kernel: ? kmsg_dump_rewind_nolock+0xd9/0xd9
Apr 26 08:27:15 l kernel: ? osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: ? osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: ? osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: __kasan_report.cold.7+0x37/0x86
Apr 26 08:27:15 l kernel: ? ldiskfs_htree_fill_tree+0x6c1/0x880 [ldiskfs]
Apr 26 08:27:15 l kernel: ? osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: kasan_report+0x37/0x50
Apr 26 08:27:15 l kernel: osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: ? kfree+0xdd/0x570
Apr 26 08:27:15 l kernel: ? osd_declare_xattr_del+0x520/0x520 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: ? free_rb_tree_fname+0x67/0xb0 [ldiskfs]
Apr 26 08:27:15 l kernel: ? free_rb_tree_fname+0x67/0xb0 [ldiskfs]
Apr 26 08:27:15 l kernel: call_filldir+0x277/0x7a0 [ldiskfs]
Apr 26 08:27:15 l kernel: ldiskfs_readdir+0x19f7/0x2a40 [ldiskfs]
Apr 26 08:27:15 l kernel: ? __ldiskfs_check_dir_entry+0x5e0/0x5e0 [ldiskfs]
Apr 26 08:27:15 l kernel: ? down_read_killable+0x1d0/0x780
Apr 26 08:27:15 l kernel: ? fsnotify_first_mark+0x150/0x150
Apr 26 08:27:15 l kernel: ? down_read+0x770/0x770
Apr 26 08:27:15 l kernel: iterate_dir+0x3b0/0x610
Apr 26 08:27:15 l kernel: ? ldiskfs_htree_lock+0x151/0x3a0 [ldiskfs]
Apr 26 08:27:15 l kernel: osd_ldiskfs_it_fill+0x2f8/0x830 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: ? osd_it_ea_fini+0x250/0x250 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: ? osd_declare_xattr_del+0x520/0x520 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: ? osd_dirent_check_repair+0x52a0/0x52a0 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: osd_it_ea_next+0x34b/0x3f0 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: mdd_dir_page_build+0x318/0xef0 [mdd]
Apr 26 08:27:15 l kernel: dt_index_walk+0x4b4/0xcd0 [obdclass]
Apr 26 08:27:15 l kernel: ? dt_xattr_del+0x2e0/0x2e0 [mdd]
Apr 26 08:27:15 l kernel: mdd_readpage+0x7e4/0x10d0 [mdd]
Apr 26 08:27:15 l kernel: mdt_readpage+0xdd7/0x1bc0 [mdt]
Apr 26 08:27:15 l kernel: tgt_request_handle+0x1d84/0x43c0 [ptlrpc]
Apr 26 08:27:15 l kernel: ? tgt_brw_read+0x5400/0x5400 [ptlrpc]
Apr 26 08:27:15 l kernel: ptlrpc_server_handle_request+0xa5e/0x1fe0 [ptlrpc]
Apr 26 08:27:15 l kernel: ptlrpc_main+0x1a6e/0x2e00 [ptlrpc]
Apr 26 08:27:15 l kernel: ? __kthread_parkme+0xc4/0x190
Apr 26 08:27:15 l kernel: ? ptlrpc_register_service+0x2de0/0x2de0 [ptlrpc]
Apr 26 08:27:15 l kernel: kthread+0x344/0x410
Apr 26 08:27:15 l kernel: ? kthread_insert_work_sanity_check+0xd0/0xd0
Apr 26 08:27:15 l kernel: ret_from_fork+0x24/0x50
Apr 26 08:27:15 l kernel: 
Apr 26 08:27:15 l kernel: Allocated by task 518707:
Apr 26 08:27:15 l kernel: kasan_save_stack+0x19/0x80
Apr 26 08:27:15 l kernel: __kasan_kmalloc.constprop.9+0xc1/0xd0
Apr 26 08:27:15 l kernel: kmem_cache_alloc_trace+0x142/0x320
Apr 26 08:27:15 l kernel: osd_key_init+0x101/0x9b0 [osd_ldiskfs]
Apr 26 08:27:15 l kernel: keys_fill+0x1c1/0x5c0 [obdclass]
Apr 26 08:27:15 l kernel: lu_context_init+0x279/0x440 [obdclass]
Apr 26 08:27:15 l kernel: ptlrpc_main+0x9c3/0x2e00 [ptlrpc]
Apr 26 08:27:15 l kernel: kthread+0x344/0x410
Apr 26 08:27:15 l kernel: ret_from_fork+0x24/0x50
Apr 26 08:27:15 l kernel: 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In &lt;tt&gt;osd_ldiskfs_filldir()&lt;/tt&gt; we check that the buffer has enough space for namelen bytes but we do not account for the possibility that it does not have enough space for presented_len.&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; ((void *)ent - it-&amp;gt;oie_buf + sizeof(*ent) + namelen &amp;gt;
            OSD_IT_EA_BUFSIZE)
                RETURN(1);
....
                &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; presented_len = critical_chars(name, namelen);

                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (presented_len == namelen)
                        memcpy(ent-&amp;gt;oied_name, name, namelen);
		&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
                        namelen = critical_encode(name, namelen,
                                                  ent-&amp;gt;oied_name);

                ent-&amp;gt;oied_name[namelen] = &lt;span class=&quot;code-quote&quot;&gt;&apos;\0&apos;&lt;/span&gt;; &lt;span class=&quot;code-comment&quot;&gt;/* osd_ldiskfs_filldir+0x16c2 */&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It also seems like the original check is wrong. It seems to be missing a +1 for the trailing NUL.&lt;/p&gt;</description>
                <environment></environment>
        <key id="70026">LU-15827</key>
            <summary>BUG: KASAN: slab-out-of-bounds in osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</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="jhammond">John Hammond</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Apr 2022 18:54:27 +0000</created>
                <updated>Fri, 13 May 2022 17:20:32 +0000</updated>
                            <resolved>Mon, 9 May 2022 20:47:55 +0000</resolved>
                                                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="333925" author="jhammond" created="Thu, 5 May 2022 17:38:00 +0000"  >&lt;p&gt;I have a fix for this. Will push shortly.&lt;/p&gt;</comment>
                            <comment id="333954" author="gerrit" created="Thu, 5 May 2022 19:25:54 +0000"  >&lt;p&gt;&quot;John L. Hammond &amp;lt;jhammond@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/47224&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/47224&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15827&quot; title=&quot;BUG: KASAN: slab-out-of-bounds in osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15827&quot;&gt;&lt;del&gt;LU-15827&lt;/del&gt;&lt;/a&gt; osd: respect filldir buffer limits&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: d966fca04ecf085c69cb52d806432e410a290aca&lt;/p&gt;</comment>
                            <comment id="334202" author="gerrit" created="Mon, 9 May 2022 20:30:26 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/47224/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/47224/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15827&quot; title=&quot;BUG: KASAN: slab-out-of-bounds in osd_ldiskfs_filldir+0x16c2/0x1860 [osd_ldiskfs]&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15827&quot;&gt;&lt;del&gt;LU-15827&lt;/del&gt;&lt;/a&gt; osd: respect filldir buffer limits&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 5879647624c834d4a579f425a0fc8d408235e275&lt;/p&gt;</comment>
                            <comment id="334203" author="pjones" created="Mon, 9 May 2022 20:47:55 +0000"  >&lt;p&gt;Landed for 2.15&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="59726">LU-13717</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|i02o9j:</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>