[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240612045001epcms2p2338ee24b2e1f107a72f274f2a88b93e7@epcms2p2>
Date: Wed, 12 Jun 2024 13:50:01 +0900
From: Daejun Park <daejun7.park@...sung.com>
To: Chao Yu <chao@...nel.org>, "jaegeuk@...nel.org" <jaegeuk@...nel.org>,
"linux-f2fs-devel@...ts.sourceforge.net"
<linux-f2fs-devel@...ts.sourceforge.net>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: Dongjin Kim <dongjin_.kim@...sung.com>, Seokhwan Kim
<sukka.kim@...sung.com>, Yonggil Song <yonggil.song@...sung.com>, Eunhee Rho
<eunhee83.rho@...sung.com>, Jaeyoon Choi <j_yoon.choi@...sung.com>, Nayeon
Kim <nayeoni.kim@...sung.com>, Siwoo Jung <siu.jung@...sung.com>, Daejun
Park <daejun7.park@...sung.com>
Subject: RE:(2) [PATCH] f2fs: fix convert inline inode on readonly mode
> 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@...kaller.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@...sung.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
> >
Powered by blists - more mailing lists