<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:30:31 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-3048] lfs getstripe heap corruption with MOUNT_2=y </title>
                <link>https://jira.whamcloud.com/browse/LU-3048</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;To reproduce:&lt;/p&gt;
&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;# MOUNT_2=y llmount.sh 
...
# cd /mnt/lustre
# lfs setstripe -c2 LOLWUT
# lfs getstripe LOLWUT
# lfs getstripe LOLWUT
LOLWUT
lmm_stripe_count:   2
lmm_stripe_size:    1048576
lmm_layout_gen:     0
lmm_stripe_offset:  0
	obdidx		 objid		 objid		 group
	     0	             1	          0x1	             0
	     1	             1	          0x1	             0

*** glibc detected *** lfs: free(): invalid next size (normal): 
...
# MALLOC_CHECK_=1 lfs getstripe LOLWUT
LOLWUT
lmm_stripe_count:   2
lmm_stripe_size:    1048576
lmm_layout_gen:     0
lmm_stripe_offset:  0
	obdidx		 objid		 objid		 group
	     0	             1	          0x1	             0
	     1	             1	          0x1	             0

*** glibc detected *** lfs: free(): invalid pointer: 0x0000000001d1f1a0 ***
*** glibc detected *** lfs: free(): invalid pointer: 0x0000000001d1f270 ***
# ls /proc/fs/lustre/llite/*/max_easize
/proc/fs/lustre/llite/lustre-ffff88015536fc00/max_easize
/proc/fs/lustre/llite/lustre-ffff880173af2800/max_easize
# cat /proc/fs/lustre/llite/*/max_easize
48
128
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;get_mds_md_size() may be reading the max_easize from the file corresponding to /mnt/lustre2, in which it&apos;s allocating a 48 byte lum to recieve the stripe info.  Since this uses IOC_MDC_GETFILESTRIPE the kernel cannot infer the size of the userspace buffer, but it write 128 bytes of stripe info.    Hence the kernel in copy_to_user() is corruption the heap.&lt;/p&gt;

&lt;p&gt;liblustreapi could be fixed to locate the correct max_easize file.  But this still leaves us with a TOCTTOU issue as the max_easize can change at any time from userspace&apos;s POV.&lt;/p&gt;</description>
                <environment></environment>
        <key id="18138">LU-3048</key>
            <summary>lfs getstripe heap corruption with MOUNT_2=y </summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</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>
                            <label>lfs</label>
                            <label>liblustreapi</label>
                    </labels>
                <created>Wed, 27 Mar 2013 21:12:04 +0000</created>
                <updated>Tue, 23 Apr 2013 14:01:55 +0000</updated>
                            <resolved>Tue, 23 Apr 2013 14:01:55 +0000</resolved>
                                    <version>Lustre 2.4.0</version>
                                    <fixVersion>Lustre 2.4.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                            <comments>
                            <comment id="55436" author="jhammond" created="Wed, 3 Apr 2013 21:24:08 +0000"  >&lt;p&gt;Please see &lt;a href=&quot;http://review.whamcloud.com/5934&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5934&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="56813" author="jhammond" created="Tue, 23 Apr 2013 14:01:55 +0000"  >&lt;p&gt;Patch landed for 2.4.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="18136">LU-3046</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|hzvmiv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7442</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>