lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Mar 2022 20:25:51 +0800
From:   Gao Xiang <hsiangkao@...ux.alibaba.com>
To:     Dongliang Mu <mudongliangabcd@...il.com>
Cc:     Huang Jianan <jnhuang95@...il.com>,
        Dongliang Mu <dzm91@...t.edu.cn>, Gao Xiang <xiang@...nel.org>,
        Chao Yu <chao@...nel.org>,
        syzkaller <syzkaller@...glegroups.com>,
        linux-erofs@...ts.ozlabs.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fs: erofs: remember if kobject_init_and_add was done

Hi Dongliang,

On Tue, Mar 15, 2022 at 07:59:26PM +0800, Dongliang Mu wrote:
> On Tue, Mar 15, 2022 at 7:05 PM Huang Jianan <jnhuang95@...il.com> wrote:
> >
> > 在 2022/3/15 18:55, Gao Xiang 写道:
> > > On Tue, Mar 15, 2022 at 06:43:01PM +0800, Huang Jianan wrote:
> > >> 在 2022/3/15 15:51, Dongliang Mu 写道:
> > >>> From: Dongliang Mu <mudongliangabcd@...il.com>
> > >>>
> > >>> Syzkaller hit 'WARNING: kobject bug in erofs_unregister_sysfs'. This bug
> > >>> is triggered by injecting fault in kobject_init_and_add of
> > >>> erofs_unregister_sysfs.
> > >>>
> > >>> Fix this by remembering if kobject_init_and_add is successful.
> > >>>
> > >>> Note that I've tested the patch and the crash does not occur any more.
> > >>>
> > >>> Reported-by: syzkaller <syzkaller@...glegroups.com>
> > >>> Signed-off-by: Dongliang Mu <mudongliangabcd@...il.com>
> > >>> ---
> > >>>    fs/erofs/internal.h | 1 +
> > >>>    fs/erofs/sysfs.c    | 9 ++++++---
> > >>>    2 files changed, 7 insertions(+), 3 deletions(-)
> > >>>
> > >>> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> > >>> index 5aa2cf2c2f80..9e20665e3f68 100644
> > >>> --- a/fs/erofs/internal.h
> > >>> +++ b/fs/erofs/internal.h
> > >>> @@ -144,6 +144,7 @@ struct erofs_sb_info {
> > >>>     u32 feature_incompat;
> > >>>     /* sysfs support */
> > >>> +   bool s_sysfs_inited;
> > >> Hi Dongliang,
> > >>
> > >> How about using sbi->s_kobj.state_in_sysfs to avoid adding a extra member in
> > >> sbi ?
> > > Ok, I have no tendency of these (I'm fine with either ways).
> > > I've seen some usage like:
> > >
> > > static inline int device_is_registered(struct device *dev)
> > > {
> > >          return dev->kobj.state_in_sysfs;
> > > }
> > >
> > > But I'm still not sure if we need to rely on such internal
> > > interface.. More thoughts?
> >
> > Yeah... It seems that it is better to use some of the interfaces
> > provided by kobject,
> > otherwise we should still maintain this state in sbi.
> >
> 
> I am fine with either way. Let me know if you reach to an agreement.

If you have time, would you mind sending another patch by using
state_in_sysfs? I'd like to know Chao's perference later, and
apply one of them...

Thanks,
Gao Xiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ