From: Daejun Park <daejun7.park@samsung.com>
To: Chao Yu <chao@kernel.org>,
"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Dongjin Kim <dongjin_.kim@samsung.com>,
Seokhwan Kim <sukka.kim@samsung.com>,
Yonggil Song <yonggil.song@samsung.com>,
Eunhee Rho <eunhee83.rho@samsung.com>,
Jaeyoon Choi <j_yoon.choi@samsung.com>,
Nayeon Kim <nayeoni.kim@samsung.com>,
Siwoo Jung <siu.jung@samsung.com>,
Daejun Park <daejun7.park@samsung.com>
Subject: RE:(2) [PATCH] f2fs: fix convert inline inode on readonly mode
Date: Wed, 12 Jun 2024 13:50:01 +0900 [thread overview]
Message-ID: <20240612045001epcms2p2338ee24b2e1f107a72f274f2a88b93e7@epcms2p2> (raw)
In-Reply-To: <dfdf7dac-90e2-4ee7-8258-ffca0c777d9e@kernel.org>
> On 2024/6/12 10:20, Daejun Park wrote:
> > syzbot reported a bug in f2fs_vm_page_mkwrite() which checks for
> > f2fs_has_inline_data(inode).
> > The bug was caused by f2fs_convert_inline_inode() not returning an
> > error when called on a read-only filesystem, but returning with the
> > inline attribute as set.
> > This patch fixes the problem by ensuring that f2fs_convert_inline_inode()
> > returns -EROFS on readonly.
> >
> > Fixes: ec2ddf499402 ("f2fs: don't allow any writes on readonly mount")
> > Reported-by: syzbot+f195123a45ad487ca66c@syzkaller.appspotmail.com
> > Closes: https://protect2.fireeye.com/v1/url?k=4fe36b34-10785251-4fe2e07b-000babff32e3-e4235a49bbe14a93&q=1&e=b7eda9c4-8db2-474e-801d-f3eb85d38066&u=https%3A%2F%2Fsyzkaller.appspot.com%2Fbug%3Fextid%3Df195123a45ad487ca66c
> > Signed-off-by: Daejun Park <daejun7.park@samsung.com>
>
> Hi Daejun,
>
> I guess below patch has fixed this issue, so we need to tag the report
> as duplicated?
>
> https://lore.kernel.org/linux-f2fs-devel/20240603010745.2246488-1-chao@kernel.org/T/#u
>
> Thanks,
Hi Chao,
I didn't check that patch, please simply ignore it, thank you :)
Thanks,
Daejun
> > ---
> > fs/f2fs/inline.c 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
> > index 7638d0d7b7ee..ae1d8f2d82c9 100644
> > --- a/fs/f2fs/inline.c
> > +++ b/fs/f2fs/inline.c
> > @@ -203,10 +203,12 @@ int f2fs_convert_inline_inode(struct inode *inode)
> > struct page *ipage, *page;
> > int err = 0;
> >
> > - if (!f2fs_has_inline_data(inode)
> > - f2fs_hw_is_readonly(sbi) f2fs_readonly(sbi->sb))
> > + if (!f2fs_has_inline_data(inode))
> > return 0;
> >
> > + if (unlikely(f2fs_hw_is_readonly(sbi) f2fs_readonly(sbi->sb)))
> > + return -EROFS;
> > +
> > err = f2fs_dquot_initialize(inode);
> > if (err)
> > return err;
> > --
> > 2.25.1
> >
prev parent reply other threads:[~2024-06-12 4:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240612022012epcms2p77300b5130d18b0397c9fc2877704949d@epcms2p7>
2024-06-12 2:20 ` Daejun Park
2024-06-12 3:39 ` Chao Yu
[not found] ` <CGME20240612022012epcms2p77300b5130d18b0397c9fc2877704949d@epcms2p2>
2024-06-12 4:50 ` Daejun Park [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=20240612045001epcms2p2338ee24b2e1f107a72f274f2a88b93e7@epcms2p2 \
--to=daejun7.park@samsung.com \
--cc=chao@kernel.org \
--cc=dongjin_.kim@samsung.com \
--cc=eunhee83.rho@samsung.com \
--cc=j_yoon.choi@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=nayeoni.kim@samsung.com \
--cc=siu.jung@samsung.com \
--cc=sukka.kim@samsung.com \
--cc=yonggil.song@samsung.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®