From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Shigeru Yoshida <syoshida@redhat.com>
Cc: <ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs/ntfs3: Fix error handling in ntfs_new_inode()
Date: Fri, 13 Jan 2023 13:44:48 +0400 [thread overview]
Message-ID: <2f653f1c-161c-57d2-b3c7-f21ded261938@paragon-software.com> (raw)
In-Reply-To: <20230104123902.978084-1-syoshida@redhat.com>
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/).
* Thanks for your work.
next prev parent reply other threads:[~2023-01-13 9:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 12:39 Shigeru Yoshida
2023-01-13 9:44 ` Konstantin Komarov [this message]
2023-01-16 8:33 ` Shigeru Yoshida
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=2f653f1c-161c-57d2-b3c7-f21ded261938@paragon-software.com \
--to=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
--cc=syoshida@redhat.com \
/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
all inboxes | Powered by JetHome®