lkml.org 
[lkml]   [2013]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: spinlock contention of files->file_lock

* Al Viro <viro@ZenIV.linux.org.uk> wrote:

> On Wed, Oct 02, 2013 at 07:13:19AM +0200, Ingo Molnar wrote:
> >
> > * Al Viro <viro@ZenIV.linux.org.uk> wrote:
> >
> > > On Tue, Oct 01, 2013 at 02:41:58PM -0700, Eric Dumazet wrote:
> > > > Maybe I am missing something obvious ?
> > >
> > > Yes. do_execve_common() starts with unshare_files(); there can be
> > > no other thread capable of modifying that descriptor table.
> >
> > Btw., might the Android Binder:
> >
> > drivers/staging/android/binder.c: struct files_struct *files = proc->files;
> > ...
> > drivers/staging/android/binder.c: __fd_install(proc->files, fd, file);
> > ...
> > drivers/staging/android/binder.c: retval = __close_fd(proc->files, fd);
> >
> > violate that assumption?
>
> Not unless your thread has managed to call an ioctl between entering
> do_execve_common() and calling do_close_on_exec() ;-)

Indeed - while the binder interface appears to allow the insertion of fds
into other task's file tables, it refcounts its task->files access and
only ever receives it via get_files_struct(current), so it cannot possibly
interfere with a private file table resulting from unshare_files().

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-10-02 13:21    [W:0.098 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site