<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:51:49 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-5476] Buffer overflow in ll_fid2path</title>
                <link>https://jira.whamcloud.com/browse/LU-5476</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Reported by Dan Carpenter against upstream client:&lt;/p&gt;

&lt;p&gt;The patch d7e09d0397e8: &quot;staging: add Lustre file system client&lt;br/&gt;
support&quot; from May 2, 2013, leads to the following static checker&lt;br/&gt;
warning:&lt;/p&gt;

&lt;p&gt;	drivers/staging/lustre/lustre/llite/file.c:1730 ll_fid2path()&lt;br/&gt;
	error: memcpy() &apos;gfout&apos; too small&lt;/p&gt;

&lt;p&gt;drivers/staging/lustre/lustre/llite/file.c&lt;br/&gt;
 1719          if (copy_from_user(gfin, arg, sizeof(*gfin))) &lt;/p&gt;
{
 1720                  OBD_FREE_PTR(gfin);
 1721                  return -EFAULT;
 1722          }
&lt;p&gt; 1723  &lt;br/&gt;
 1724          outsize = sizeof(*gfout) + gfin-&amp;gt;gf_pathlen;&lt;/p&gt;

&lt;p&gt;outsize is an int.&lt;br/&gt;
gfin-&amp;gt;gf_pathlen is a u32 which comes from the user.&lt;br/&gt;
The addition can overflow so outsize is less than sizeof(*gfout).&lt;/p&gt;

&lt;p&gt; 1725          OBD_ALLOC(gfout, outsize);&lt;br/&gt;
 1726          if (gfout == NULL) &lt;/p&gt;
{
 1727                  OBD_FREE_PTR(gfin);
 1728                  return -ENOMEM;
 1729          }
&lt;p&gt; 1730          memcpy(gfout, gfin, sizeof(*gfout));&lt;/p&gt;

&lt;p&gt;It would lead to memory corruption here.  Probably we should add&lt;br/&gt;
something like:&lt;/p&gt;

&lt;p&gt;	if (gfin-&amp;gt;gf_pathlen &amp;gt; PATH_MAX)&lt;br/&gt;
		return -EINVAL;&lt;/p&gt;

&lt;p&gt;Is that the right limit here?&lt;/p&gt;

&lt;p&gt; 1731          OBD_FREE_PTR(gfin);&lt;br/&gt;
 1732  &lt;br/&gt;
 1733          /* Call mdc_iocontrol */&lt;br/&gt;
 1734          rc = obd_iocontrol(OBD_IOC_FID2PATH, exp, outsize, gfout, NULL);&lt;/p&gt;</description>
                <environment></environment>
        <key id="25974">LU-5476</key>
            <summary>Buffer overflow in ll_fid2path</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="wc-triage">WC Triage</assignee>
                                    <reporter username="green">Oleg Drokin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Aug 2014 12:27:48 +0000</created>
                <updated>Fri, 15 Aug 2014 17:27:16 +0000</updated>
                            <resolved>Fri, 15 Aug 2014 17:27:16 +0000</resolved>
                                    <version>Lustre 2.5.0</version>
                    <version>Lustre 2.6.0</version>
                    <version>Lustre 2.4.2</version>
                    <version>Lustre 2.7.0</version>
                                    <fixVersion>Lustre 2.7.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="91374" author="green" created="Tue, 12 Aug 2014 13:41:34 +0000"  >&lt;p&gt;Patch in &lt;a href=&quot;http://review.whamcloud.com/11412&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/11412&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="91547" author="paf" created="Wed, 13 Aug 2014 18:22:35 +0000"  >&lt;p&gt;Since you&apos;re looking at fid2path problems, could you possibly take a look at &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-4239&quot; title=&quot;lfs fid2path ioctl err -75: Value too large for defined data type (75)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-4239&quot;&gt;&lt;del&gt;LU-4239&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://review.whamcloud.com/10717&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/10717&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="91750" author="jlevi" created="Fri, 15 Aug 2014 17:27:16 +0000"  >&lt;p&gt;Patch landed to Master.&lt;/p&gt;</comment>
                    </comments>
                    <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|hzwtiv:</customfieldvalue>

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