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: <20210331092826.giypig5zirgy7cig@wittgenstein>
Date:   Wed, 31 Mar 2021 11:28:26 +0200
From:   Christian Brauner <christian.brauner@...ntu.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Xie Yongji <xieyongji@...edance.com>, hch@...radead.org,
        mst@...hat.com, jasowang@...hat.com, stefanha@...hat.com,
        sgarzare@...hat.com, parav@...dia.com,
        christian.brauner@...onical.com, rdunlap@...radead.org,
        willy@...radead.org, viro@...iv.linux.org.uk, axboe@...nel.dk,
        bcrl@...ck.org, corbet@....net, mika.penttila@...tfour.com,
        virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
        kvm@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v6 01/10] file: Export receive_fd() to modules

On Wed, Mar 31, 2021 at 12:26:24PM +0300, Dan Carpenter wrote:
> On Wed, Mar 31, 2021 at 11:15:45AM +0200, Christian Brauner wrote:
> > On Wed, Mar 31, 2021 at 04:05:10PM +0800, Xie Yongji wrote:
> > > Export receive_fd() so that some modules can use
> > > it to pass file descriptor between processes without
> > > missing any security stuffs.
> > > 
> > > Signed-off-by: Xie Yongji <xieyongji@...edance.com>
> > > ---
> > 
> > Yeah, as I said in the other mail I'd be comfortable with exposing just
> > this variant of the helper.
> > Maybe this should be a separate patch bundled together with Christoph's
> > patch to split parts of receive_fd() into a separate helper.
> > This would also allow us to simplify a few other codepaths in drivers as
> > well btw. I just took a hasty stab at two of them:
> > 
> > diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> > index c119736ca56a..3c716bf6d84b 100644
> > --- a/drivers/android/binder.c
> > +++ b/drivers/android/binder.c
> > @@ -3728,8 +3728,9 @@ static int binder_apply_fd_fixups(struct binder_proc *proc,
> >         int ret = 0;
> > 
> >         list_for_each_entry(fixup, &t->fd_fixups, fixup_entry) {
> > -               int fd = get_unused_fd_flags(O_CLOEXEC);
> > +               int fd = receive_fd(fixup->file, O_CLOEXEC);
>                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Assignment duplicated on the next line.

I didn't this for immediate inclusion that's why I said "hasty" but
thank you! :)

Christian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ