lkml.org 
[lkml]   [2014]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] sys, seccomp: add PR_SECCOMP_EXT and SECCOMP_EXT_ACT_TSYNC
On 01/14, Oleg Nesterov wrote:
>
> On 01/14, Oleg Nesterov wrote:
> >
> > > + get_seccomp_filter(caller);
> > > + /*
> > > + * Drop the task reference to the shared ancestor since
> > > + * current's path will hold a reference. (This also
> > > + * allows a put before the assignment.)
> > > + */
> > > + put_seccomp_filter(thread);
> > > + thread->seccomp.filter = caller->seccomp.filter;
> >
> > As I said, I do not understand this patch yet, but this looks suspicious.
> >
> > Why we can't race with this thread doing clone(CLONE_THREAD) ? We do
> > not the the new thread yet, but its ->seccomp can be already copied
> > by copy_process(), no?
>
> And it seems that this can obviously race with seccomp_attach_filter()
> called by this "thread".

Heh. I just noticed that this patch is not first in series, and I wasn't
cc'ed. I found this one on marc.info,

http://marc.info/?l=linux-kernel&m=138964557211277

this explains task_lock(). But this can't fix the race with copy_process,
and the patch itself doesn't look right... if nothing else, we can't do
copy_from_user() under task_lock().

Oleg.



\
 
 \ /
  Last update: 2014-01-14 22:01    [W:0.611 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site