public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
From: Shigeru Yoshida <syoshida@redhat.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/ntfs3: Fix error handling in ntfs_new_inode()
Date: Mon, 16 Jan 2023 17:33:11 +0900	[thread overview]
Message-ID: <Y8ULxwOtdKWu/CzX@kernel-devel> (raw)
In-Reply-To: <2f653f1c-161c-57d2-b3c7-f21ded261938@paragon-software.com>

Hi,

On Fri, Jan 13, 2023 at 01:44:48PM +0400, Konstantin Komarov wrote:
> On 04.01.2023 16:39, Shigeru Yoshida wrote:
> > When memory allocation for mi->mrec fails, ntfs_new_inode() calls
> > iput().  iput() calls ni_write_inode() indirectly, it references
> > uninitialized mi->mrec, and this causes the kernel crash.  This patch
> > fixes the issue by making the inode bad before calling iput().
> > 
> > Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
> > ---
> >   fs/ntfs3/fsntfs.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
> > index 567563771bf8..7b93f2aeb6f6 100644
> > --- a/fs/ntfs3/fsntfs.c
> > +++ b/fs/ntfs3/fsntfs.c
> > @@ -1683,6 +1683,7 @@ struct ntfs_inode *ntfs_new_inode(struct ntfs_sb_info *sbi, CLST rno, bool dir)
> >   out:
> >   	if (err) {
> > +		_ntfs_bad_inode(inode);
> >   		iput(inode);
> >   		ni = ERR_PTR(err);
> >   	}
> 
> Hello.
> 
> This bug have been already fixed by Ye Bin (https://lore.kernel.org/lkml/20221117091912.3436127-1-yebin@huaweicloud.com/).

I've missed the fix you mentioned.
Thank you so much for your reply!

Shigeru

> 
>  * Thanks for your work.
> 


      reply	other threads:[~2023-01-16  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 12:39 [PATCH] fs/ntfs3: Fix error handling in ntfs_new_inode() Shigeru Yoshida
2023-01-13  9:44 ` Konstantin Komarov
2023-01-16  8:33   ` Shigeru Yoshida [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8ULxwOtdKWu/CzX@kernel-devel \
    --to=syoshida@redhat.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox