<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:55:51 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-12811] lustre_swab_fiemap needs to check fm_mapped_extents</title>
                <link>https://jira.whamcloud.com/browse/LU-12811</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;It looks like lustre_swab_fiemap can go beyond request buffer as it uses extent count number from network without any checking at face value&lt;/p&gt;

&lt;p&gt;similar problem exist at lustre_swab_lmv_mds_md_v1 for lmm1-&amp;gt;lmv_stripe_count&lt;/p&gt;

&lt;p&gt;lustre_swab_object_update for ou-&amp;gt;ou_params_count&lt;/p&gt;</description>
                <environment></environment>
        <key id="57014">LU-12811</key>
            <summary>lustre_swab_fiemap needs to check fm_mapped_extents</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="green">Oleg Drokin</reporter>
                        <labels>
                            <label>LTS12</label>
                    </labels>
                <created>Fri, 27 Sep 2019 09:38:34 +0000</created>
                <updated>Fri, 22 May 2020 08:10:47 +0000</updated>
                            <resolved>Fri, 15 May 2020 04:46:47 +0000</resolved>
                                    <version>Lustre 2.13.0</version>
                    <version>Lustre 2.12.3</version>
                                    <fixVersion>Lustre 2.14.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="255537" author="pjones" created="Sat, 28 Sep 2019 04:27:14 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=green&quot; class=&quot;user-hover&quot; rel=&quot;green&quot;&gt;green&lt;/a&gt; can this be considered a duplicate of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11997&quot; title=&quot;Crash in lustre_swab_fiemap&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11997&quot;&gt;&lt;del&gt;LU-11997&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="255720" author="green" created="Tue, 1 Oct 2019 15:44:00 +0000"  >&lt;p&gt;no.&lt;/p&gt;</comment>
                            <comment id="256060" author="green" created="Tue, 8 Oct 2019 14:05:25 +0000"  >&lt;p&gt;The biggest obstacle to us doing the correct testing here is that we do not pass in the buffer size to swabbing functions. This is ok for fixed-size buffers, but once we start having variable-sized ones, we are in a bit of trouble.&lt;/p&gt;

&lt;p&gt;Naturally changing all swab functions to take a size argument will be a huge patch and is not necessary necessary.&lt;/p&gt;

&lt;p&gt;Now actually looking at the code, we do have variable arrays support denoted by RMF_F_STRUCT_ARRAY flag.&lt;/p&gt;

&lt;p&gt;So I wonder if we can actually make this work with a field that consists of a static header and then the array. Potentially we need to create a new field type to describe this and it would only be used where needed that way we don&apos;t need to update every swab function with the length argument.&lt;/p&gt;</comment>
                            <comment id="256280" author="gerrit" created="Sat, 12 Oct 2019 02:58:37 +0000"  >&lt;p&gt;Emoly Liu (emoly@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36435&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36435&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12811&quot; title=&quot;lustre_swab_fiemap needs to check fm_mapped_extents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12811&quot;&gt;&lt;del&gt;LU-12811&lt;/del&gt;&lt;/a&gt; ptlrpc: add some validation checks&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a931b21beb6895c9b70b76bb5fc6a3cd069f3b5e&lt;/p&gt;</comment>
                            <comment id="256548" author="adilger" created="Thu, 17 Oct 2019 08:47:57 +0000"  >&lt;p&gt;One option for passing the length to the swabbing function without having to change all of the swabbers at once would be to add a separate &lt;tt&gt;rmf_swab_len&lt;/tt&gt; function pointer to &lt;tt&gt;req_msg_field&lt;/tt&gt;:&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-object&quot;&gt;int&lt;/span&gt;        (*rmf_swab_len)(void *, len);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and assign this with a new &lt;tt&gt;DEFINE_MSGFL()&lt;/tt&gt; macro, similar to &lt;tt&gt;DEFINE_MSGF()&lt;/tt&gt;. &lt;/p&gt;

&lt;p&gt;Then, in &lt;tt&gt;swabber&amp;#95;dumper&amp;#95;helper()&lt;/tt&gt; if the &lt;tt&gt;-&amp;gt;rmf_swab_len()&lt;/tt&gt; function is available, that should be used in preference to &lt;tt&gt;&amp;#45;&amp;gt;rmf_swabber()&lt;/tt&gt; and can pass the buffer length (&quot;len&quot; in that function) to &lt;tt&gt;lustre&amp;#95;swab&amp;#95;fiemap()&lt;/tt&gt; (and the other similar functions) with an extra &quot;u32 len&quot; argument.&lt;/p&gt;

&lt;p&gt;That allows proper verification of the fields and avoids potential overflow.  Unfortunately, there is no way to return an error from those functions (void functions all the way up), so the best we can do is limit the swabbing to the fields that fit within the buffer length and then return &lt;tt&gt;-EOVERFLOW&lt;/tt&gt;.  While the error itself will be ignored by the caller, we may as well make the new function prototype return the error as the starting point to fixing the rest of the code to handle errors better in the future.&lt;/p&gt;

&lt;p&gt;Also, the &quot;&lt;tt&gt;LASSERT((len % field&amp;#45;&amp;gt;rmf&amp;#95;size) == 0)&lt;/tt&gt;&quot; in &lt;tt&gt;swabber_dumper_helper()&lt;/tt&gt; should be removed, but I&apos;m not sure what to do in case of an error at that point, since there is the same inability to return an error to the caller and there are too many callers to &lt;tt&gt;req&amp;#95;capsule.*&amp;#95;get()&lt;/tt&gt; to change easily.  One option would be to also change the &lt;tt&gt;swabber_dumper_helper()&lt;/tt&gt; to print a CERROR() (so at least we know about the problem) and then return &lt;tt&gt;-EPROTO&lt;/tt&gt; to the caller (which will also be ignored, but again improving the code for the future).&lt;/p&gt;</comment>
                            <comment id="258768" author="gerrit" created="Mon, 25 Nov 2019 08:22:36 +0000"  >&lt;p&gt;Emoly Liu (emoly@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36848&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36848&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12811&quot; title=&quot;lustre_swab_fiemap needs to check fm_mapped_extents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12811&quot;&gt;&lt;del&gt;LU-12811&lt;/del&gt;&lt;/a&gt; ptlrpc: do some cleanups in swabber_dumper_helper()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 937edd3c3324bc8ce659572a9e1f55c16636f5b4&lt;/p&gt;</comment>
                            <comment id="258829" author="gerrit" created="Tue, 26 Nov 2019 15:05:42 +0000"  >&lt;p&gt;Emoly Liu (emoly@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36867&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36867&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12811&quot; title=&quot;lustre_swab_fiemap needs to check fm_mapped_extents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12811&quot;&gt;&lt;del&gt;LU-12811&lt;/del&gt;&lt;/a&gt; ptlrpc: pass len to lustre_swab_object_update_reply()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 82be9af83291efe265171c1779b16493f6e6e180&lt;/p&gt;</comment>
                            <comment id="263955" author="gerrit" created="Tue, 25 Feb 2020 05:50:21 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36435/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36435/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12811&quot; title=&quot;lustre_swab_fiemap needs to check fm_mapped_extents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12811&quot;&gt;&lt;del&gt;LU-12811&lt;/del&gt;&lt;/a&gt; ptlrpc: pass buffer size to the swabbing functions&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 6099136315e8f71c52ea720c7622a7c05b8e3640&lt;/p&gt;</comment>
                            <comment id="265051" author="gerrit" created="Wed, 11 Mar 2020 02:10:09 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36867/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36867/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12811&quot; title=&quot;lustre_swab_fiemap needs to check fm_mapped_extents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12811&quot;&gt;&lt;del&gt;LU-12811&lt;/del&gt;&lt;/a&gt; ptlrpc: pass buflen to lustre_swab_object_update_*()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: c2a6f1a2afee6c416a3e7659b863bcc6246761f0&lt;/p&gt;</comment>
                            <comment id="265396" author="gerrit" created="Tue, 17 Mar 2020 03:39:42 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36848/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36848/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12811&quot; title=&quot;lustre_swab_fiemap needs to check fm_mapped_extents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12811&quot;&gt;&lt;del&gt;LU-12811&lt;/del&gt;&lt;/a&gt; ptlrpc: do some cleanups in swabber_dumper_helper()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 4b1ba33d7ab5f122e02b1cf8da4285b2ba798613&lt;/p&gt;</comment>
                            <comment id="270278" author="adilger" created="Fri, 15 May 2020 04:46:47 +0000"  >&lt;p&gt;It looks like all of these patches are landed.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="59295">LU-13592</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56868">LU-12742</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|i00nef:</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>