<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:29:11 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-2900] Null pointer dereference in ll_fsync (llite/file.c) from mkdir in an NFS mounted Lustre fs</title>
                <link>https://jira.whamcloud.com/browse/LU-2900</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;When a Lustre file system is mounted via NFS and a mkdir operation is attempted, a null pointer dereference occurs in ll_fsync.&lt;/p&gt;

&lt;p&gt;With 2.x, Lustre added support for different VFS fsync APIs that do not include a dentry parameter. &lt;/p&gt;

&lt;p&gt;To make the logic the same in all cases, the old ll_fsync interface was changed to pull the inode from the f_dentry in the file parameter. &lt;/p&gt;

&lt;p&gt;In some cases when using the old ll_fsync interface, the caller does not set the file parameter resulting in a NULL dereference. The fix to this is to restore the old logic in those cases: when a dentry parameter is provided, get the inode from that parameter rather than the file parameter.&lt;/p&gt;

&lt;p&gt;Here&apos;s the current code in llite/file.c (same throughout 2.x):&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;#ifdef HAVE_FILE_FSYNC_4ARGS
&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_fsync(struct file *file, loff_t start, loff_t end, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; data)
#elif defined(HAVE_FILE_FSYNC_2ARGS)
&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_fsync(struct file *file, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; data)
#&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_fsync(struct file *file, struct dentry *dentry, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; data)
#endif
{
         struct inode *inode = file-&amp;gt;f_dentry-&amp;gt;d_inode;
         struct ll_inode_info *lli = ll_i2info(inode);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Here&apos;s the proposed fix:&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;/* 
 * When dentry is provided (the &lt;span class=&quot;code-quote&quot;&gt;&apos;&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;&apos;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt;), *file may be &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
 * and dentry must be used directly rather than pulled from *file
 * as is done otherwise.
 */
#ifdef HAVE_FILE_FSYNC_4ARGS
&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_fsync(struct file *file, loff_t start, loff_t end, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; data)
#elif defined(HAVE_FILE_FSYNC_2ARGS)
&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_fsync(struct file *file, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; data)
#&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_fsync(struct file *file, struct dentry *dentry, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; data)
#endif
{
#&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; defined(HAVE_FILE_FSYNC_4ARGS) || defined(HAVE_FILE_FSYNC_2ARGS)
        struct inode *inode = file-&amp;gt;f_dentry-&amp;gt;d_inode;
#&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
        struct inode *inode = dentry-&amp;gt;d_inode;
#endif
        struct ll_inode_info *lli = ll_i2info(inode);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;The fix has been tested at Cray, both under the general acceptance-small tests and specifically for the NFS issue.&lt;/p&gt;

&lt;p&gt;I&apos;ll be putting the patch in Gerrit shortly.&lt;/p&gt;</description>
                <environment>SLES11SP1 (Cray Linux Environment)</environment>
        <key id="17751">LU-2900</key>
            <summary>Null pointer dereference in ll_fsync (llite/file.c) from mkdir in an NFS mounted Lustre fs</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="bogl">Bob Glossman</assignee>
                                    <reporter username="paf">Patrick Farrell</reporter>
                        <labels>
                            <label>NFS</label>
                            <label>patch</label>
                    </labels>
                <created>Mon, 4 Mar 2013 11:36:19 +0000</created>
                <updated>Wed, 6 Nov 2013 17:30:28 +0000</updated>
                            <resolved>Wed, 3 Apr 2013 14:02:37 +0000</resolved>
                                    <version>Lustre 2.0.0</version>
                    <version>Lustre 2.2.0</version>
                    <version>Lustre 2.3.0</version>
                    <version>Lustre 2.4.0</version>
                    <version>Lustre 2.1.1</version>
                    <version>Lustre 2.1.2</version>
                    <version>Lustre 2.1.3</version>
                    <version>Lustre 2.1.4</version>
                                    <fixVersion>Lustre 2.4.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="53286" author="jlevi" created="Mon, 4 Mar 2013 15:08:07 +0000"  >&lt;p&gt;Bob,&lt;br/&gt;
There is no need for a 2.4 patch unless this is also happening with SLES11SP2.&lt;/p&gt;</comment>
                            <comment id="53288" author="bogl" created="Mon, 4 Mar 2013 15:15:58 +0000"  >&lt;p&gt;I don&apos;t think this will happen in SLES11SP2.  From the description and the proposed fix, this only occurs when neither HAVE_FILE_FSYNC_4ARGS or  HAVE_FILE_FSYNC_2ARGS is #define&apos;d.  In SLES11SP2 HAVE_FILE_FSYNC_4ARGS is #define&apos;d so the existing code should work fine.&lt;/p&gt;</comment>
                            <comment id="53291" author="paf" created="Mon, 4 Mar 2013 15:59:39 +0000"  >&lt;p&gt;Here&apos;s the Gerrit link:&lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/#change,5582&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#change,5582&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="53300" author="paf" created="Mon, 4 Mar 2013 18:13:03 +0000"  >&lt;p&gt;Bob correctly commented on the patch in Gerrit that the file* is not null - That&apos;s my error here.&lt;/p&gt;

&lt;p&gt;It is, in fact, the file-&amp;gt;f_dentry pointer that is sometimes null.  The file pointer is always present.  &lt;br/&gt;
The code the changes remains the same, but the comments have been changed to reflect this.&lt;/p&gt;

&lt;p&gt;My apologies for the error!&lt;/p&gt;

&lt;p&gt;Here is the new patch:&lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/5585&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5585&lt;/a&gt;&lt;/p&gt;
</comment>
                            <comment id="53302" author="bogl" created="Mon, 4 Mar 2013 19:07:10 +0000"  >&lt;p&gt;Just FYI you could have just amended your original commit &amp;amp; pushed it again.  It would have shown up as Patch Set 2 in the original gerrit change.  Somewhat simpler than abandoning one change and creating a whole new one.&lt;/p&gt;</comment>
                            <comment id="55384" author="paf" created="Wed, 3 Apr 2013 13:51:16 +0000"  >&lt;p&gt;I don&apos;t see how to close this - or if that&apos;s possible for me - but the patch has been accepted by Oleg and is in master, so this should be closed.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                            <comment id="55386" author="jlevi" created="Wed, 3 Apr 2013 14:02:37 +0000"  >&lt;p&gt;Patch landed to master.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="14073">LU-1334</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|hzvk4v:</customfieldvalue>

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