<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:20:45 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-8811] mdc_close() may return a freed request in *request</title>
                <link>https://jira.whamcloud.com/browse/LU-8811</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In &lt;tt&gt;mdc_close()&lt;/tt&gt; if &lt;tt&gt;ptlrpc_request_pack()&lt;/tt&gt; fails then a freed request is returned in &lt;tt&gt;*request&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-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; mdc_close(struct obd_export *exp, struct md_op_data *op_data,
                     struct md_open_data *mod, struct ptlrpc_request **request)
{
...
        *request = NULL;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (OBD_FAIL_CHECK(OBD_FAIL_MDC_CLOSE))
                req = NULL;
        &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
                req = ptlrpc_request_alloc(class_exp2cliimp(exp), req_fmt);
...
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_CLOSE);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc) {
                ptlrpc_request_free(req);
                GOTO(out, rc);
        }
...
out:
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (mod) {
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc != 0)
                        mod-&amp;gt;mod_close_req = NULL;
                /* Since now, mod is accessed through open_req only,       
                 * thus close req does not keep a reference on mod anymore. */
                obd_mod_put(mod);
        }
        *request = req;

        RETURN(rc &amp;lt; 0 ? rc : saved_rc);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This will result in a use after free in &lt;tt&gt;ll_close_inode_openhandle()&lt;/tt&gt; or &lt;tt&gt;ll_open_cleanup()&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;This was introduced by&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;commit 62713a8530349a75b7202c9bfc6be121409a0203
Author: Alexander Boyko &amp;lt;alexander.boyko@seagate.com&amp;gt;
Date:   Thu Dec 3 09:57:36 2015 +0300

    LU-5282 mdc: fix panic at mdc_free_open()
    
    Assertion was happened for open request when rq_replay is set
    to 1.
        ASSERTION(mod-&amp;gt;mod_open_req-&amp;gt;rq_replay == 0)
    But this situation is not fatal for client, and could happened
    when mdc_close() failed.
    The fix allow to free such requests. If mdc_close fail, MDS doesn`t
    receive close request from client. And in a worst case client would
    be evicted.
    
    The test recreates issue when mdc_close failed and
    client asserts:
       ASSERTION( mod-&amp;gt;mod_open_req-&amp;gt;rq_replay == 0 ) failed
    
    Signed-off-by: Alexander Boyko &amp;lt;alexander.boyko@seagate.com&amp;gt;
    Seagate-bug-id: MRP-3156
    Change-Id: I5f98901f633355849fc107149eadc9cf171819af
    Reviewed-on: http://review.whamcloud.com/17495
    Reviewed-by: Alex Zhuravlev &amp;lt;alexey.zhuravlev@intel.com&amp;gt;
    Tested-by: Jenkins
    Tested-by: Maloo &amp;lt;hpdd-maloo@intel.com&amp;gt;
    Reviewed-by: Andreas Dilger &amp;lt;andreas.dilger@intel.com&amp;gt;
    Reviewed-by: Oleg Drokin &amp;lt;oleg.drokin@intel.com&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="41406">LU-8811</key>
            <summary>mdc_close() may return a freed request in *request</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>
                            <label>mdc</label>
                    </labels>
                <created>Tue, 8 Nov 2016 15:20:57 +0000</created>
                <updated>Fri, 21 Jul 2017 10:59:17 +0000</updated>
                            <resolved>Sat, 17 Dec 2016 15:20:36 +0000</resolved>
                                    <version>Lustre 2.9.0</version>
                                    <fixVersion>Lustre 2.10.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="174092" author="gerrit" created="Thu, 17 Nov 2016 17:42:01 +0000"  >&lt;p&gt;John L. Hammond (john.hammond@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/23843&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/23843&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8811&quot; title=&quot;mdc_close() may return a freed request in *request&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8811&quot;&gt;&lt;del&gt;LU-8811&lt;/del&gt;&lt;/a&gt; mdc: avoid returning freed request&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: d0f9be5c9bfddebce501428ef50a5040c2821c2f&lt;/p&gt;</comment>
                            <comment id="178227" author="gerrit" created="Sat, 17 Dec 2016 05:48:54 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/23843/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/23843/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8811&quot; title=&quot;mdc_close() may return a freed request in *request&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8811&quot;&gt;&lt;del&gt;LU-8811&lt;/del&gt;&lt;/a&gt; mdc: avoid returning freed request&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: d641bbe4fc1a81102456b16535309e90e1c10b53&lt;/p&gt;</comment>
                            <comment id="178283" author="pjones" created="Sat, 17 Dec 2016 15:20:36 +0000"  >&lt;p&gt;Landed for 2.10&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="39642">LU-8582</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </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|hzyuw7:</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>