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]
Message-ID: <20190130211739.GC25919@kroah.com>
Date:   Wed, 30 Jan 2019 22:17:39 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Christian Brauner <christian@...uner.io>
Cc:     devel@...verdev.osuosl.org, tkjos@...roid.com,
        linux-kernel@...r.kernel.org, arve@...roid.com,
        joel@...lfernandes.org, maco@...roid.com, tkjos@...gle.com
Subject: Re: [PATCH 2/2] binderfs: remove separate device_initcall()

On Wed, Jan 30, 2019 at 06:01:02PM +0100, Christian Brauner wrote:
> On Wed, Jan 30, 2019 at 03:24:12PM +0100, Greg KH wrote:
> > On Wed, Jan 23, 2019 at 12:41:16PM +0100, Christian Brauner wrote:
> > > binderfs should not have a separate device_initcall(). When a kernel is
> > > compiled with CONFIG_ANDROID_BINDERFS register the filesystem alongside
> > > CONFIG_ANDROID_IPC. This use-case is especially sensible when users specify
> > > CONFIG_ANDROID_IPC=y, CONFIG_ANDROID_BINDERFS=y and
> > > ANDROID_BINDER_DEVICES="".
> > > When CONFIG_ANDROID_BINDERFS=n then this always succeeds so there's no
> > > regression potential for legacy workloads.
> > > 
> > > Signed-off-by: Christian Brauner <christian@...uner.io>
> > > ---
> > >  drivers/android/binder.c          | 4 ++++
> > >  drivers/android/binder_internal.h | 9 +++++++++
> > >  drivers/android/binderfs.c        | 4 +---
> > >  3 files changed, 14 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> > > index cdfc87629efb..751d76173f81 100644
> > > --- a/drivers/android/binder.c
> > > +++ b/drivers/android/binder.c
> > > @@ -5915,6 +5915,10 @@ static int __init binder_init(void)
> > >  			goto err_init_binder_device_failed;
> > >  	}
> > >  
> > > +	ret = init_binderfs();
> > > +	if (ret)
> > > +		goto err_init_binder_device_failed;
> > > +
> > >  	return ret;
> > >  
> > >  err_init_binder_device_failed:
> > > diff --git a/drivers/android/binder_internal.h b/drivers/android/binder_internal.h
> > > index 7fb97f503ef2..045b3e42d98b 100644
> > > --- a/drivers/android/binder_internal.h
> > > +++ b/drivers/android/binder_internal.h
> > > @@ -46,4 +46,13 @@ static inline bool is_binderfs_device(const struct inode *inode)
> > >  }
> > >  #endif
> > >  
> > > +#ifdef CONFIG_ANDROID_BINDERFS
> > > +extern int __init init_binderfs(void);
> > > +#else
> > > +static inline int __init init_binderfs(void)
> > > +{
> > > +	return 0;
> > > +}
> > > +#endif
> > > +
> > >  #endif /* _LINUX_BINDER_INTERNAL_H */
> > > diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c
> > > index 7a550104a722..e773f45d19d9 100644
> > > --- a/drivers/android/binderfs.c
> > > +++ b/drivers/android/binderfs.c
> > > @@ -550,7 +550,7 @@ static struct file_system_type binder_fs_type = {
> > >  	.fs_flags	= FS_USERNS_MOUNT,
> > >  };
> > >  
> > > -static int __init init_binderfs(void)
> > > +int __init init_binderfs(void)
> > >  {
> > >  	int ret;
> > >  
> > > @@ -568,5 +568,3 @@ static int __init init_binderfs(void)
> > >  
> > >  	return ret;
> > >  }
> > > -
> > > -device_initcall(init_binderfs);
> > 
> > I get a build warning when applying this patch :(
> 
> Hm, I can't reproduce that build error with this patch applied to what
> you currently have in char-misc-linus. :(
> Any chance you can give me the config that produced this warning?
> I tried with CONFIG_BINDERFS=y and CONFIG_BINDERFS=n.

$ make M=drivers/android
  CC      drivers/android/binderfs.o
  CC      drivers/android/binder.o
drivers/android/binder.c: In function ‘binder_init’:
drivers/android/binder.c:5933:2: warning: ‘device_names’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  kfree(device_names);
  ^~~~~~~~~~~~~~~~~~~

$ gcc --version
gcc (GCC) 8.2.1 20181127

And gcc is right about this warning, that could happen with your change :(

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ