Re: [PATCH] binder: make sure fd closes complete

From: Greg KH
Date: Thu Sep 02 2021 - 12:11:12 EST


On Thu, Sep 02, 2021 at 08:35:35AM -0700, Todd Kjos wrote:
> On Tue, Aug 31, 2021 at 12:24 AM Martijn Coenen <maco@xxxxxxxxxxx> wrote:
> >
> > On Mon, Aug 30, 2021 at 9:51 PM 'Todd Kjos' via kernel-team
> > <kernel-team@xxxxxxxxxxx> wrote:
> > >
> > > During BC_FREE_BUFFER processing, the BINDER_TYPE_FDA object
> > > cleanup may close 1 or more fds. The close operations are
> > > completed using the task work mechanism -- which means the thread
> > > needs to return to userspace or the file object may never be
> > > dereferenced -- which can lead to hung processes.
> > >
> > > Force the binder thread back to userspace if an fd is closed during
> > > BC_FREE_BUFFER handling.
> > >
> > > Signed-off-by: Todd Kjos <tkjos@xxxxxxxxxx>
> > Reviewed-by: Martijn Coenen <maco@xxxxxxxxxxx>
>
> Please also add to stable releases 5.4 and later.

I'll try to remember to tag this as-such after 5.15-rc1 is out and I can
apply it to my tree. But in the future, it's best if you add the cc:
stable to the patch yourself so I don't have to do it "by hand" after
the fact.

thanks,

greg k-h