<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:57:01 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-6078] Posix copytool file bounds checking is flawed</title>
                <link>https://jira.whamcloud.com/browse/LU-6078</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Original text/report from J.Nemeth (SGI) :&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;The ct_copy_data() routine has the following code:

	rc = lseek(src_fd, hai-&amp;gt;hai_extent.offset, SEEK_SET);
	if (rc &amp;lt; 0) {
		CT_ERROR(errno,
			 &quot;cannot seek for read to &quot;LPU64&quot; (len %jd) in &apos;%s&apos;&quot;,
			 hai-&amp;gt;hai_extent.offset, (intmax_t)src_st.st_size, src);
		rc = -errno;
		goto out;
	}

This appears to be checking to ensure that the hai_extent.offset value is not outside the bounds of the file. However, this call will never fail, because it is not illegal to seek outside the bounds of the file: an attempt to write at an offset beyond the file bounds will extend the file (potentially leaving a &quot;hole&quot; in the data), and an attempt to read at that location will cause an EOD error. But the lseek() won&apos;t fail.

This occurs after fstat() has already been called on the open src file, so the file size is already known. This should simply check the offset against the file size.

Similarly, the following occurs shortly afterward:

	length = min(hai-&amp;gt;hai_extent.length, src_st.st_size);

This seems simply wrong -- it should be:

        length = min(hai-&amp;gt;hai_extent.length, src_st.st_size
                                                                   - hai-&amp;gt;hai_extent.offset);

I don&apos;t know if the coordinator ever issues a request for part of a source file, but these error checks are wrong, and should be removed, or corrected.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>All</environment>
        <key id="28036">LU-6078</key>
            <summary>Posix copytool file bounds checking is flawed</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="bfaccini">Bruno Faccini</assignee>
                                    <reporter username="bfaccini">Bruno Faccini</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Jan 2015 12:22:06 +0000</created>
                <updated>Thu, 14 Jun 2018 21:41:38 +0000</updated>
                            <resolved>Tue, 24 Mar 2015 12:13:50 +0000</resolved>
                                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="102471" author="gerrit" created="Fri, 2 Jan 2015 12:40:53 +0000"  >&lt;p&gt;Faccini Bruno (bruno.faccini@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/13226&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13226&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6078&quot; title=&quot;Posix copytool file bounds checking is flawed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6078&quot;&gt;&lt;del&gt;LU-6078&lt;/del&gt;&lt;/a&gt; utils: fix copytool file bounds checking&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: d72c4eebaf64440724f618087a3924af790b9060&lt;/p&gt;</comment>
                            <comment id="109960" author="gerrit" created="Wed, 18 Mar 2015 11:10:13 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/13226/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13226/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6078&quot; title=&quot;Posix copytool file bounds checking is flawed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6078&quot;&gt;&lt;del&gt;LU-6078&lt;/del&gt;&lt;/a&gt; utils: fix copytool file bounds checking&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: f26cdd1c6e1d0570f2debc13b4165a0c710f6fe5&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </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|hzx35b:</customfieldvalue>

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