lkml.org 
[lkml]   [2012]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + syscalls-x86-add-__nr_kcmp-syscall-v8.patch added to -mm tree
On Wed, Feb 15, 2012 at 03:36:06PM +0100, Oleg Nesterov wrote:
>
> task->files can be NULL, we can race with exit_files().

So I need to call get_files_struct. Thanks Oleg!

>
> > + fdt = files_fdtable(task->files);
> > + if (idx < fdt->max_fds)
> > + file = fdt->fd[idx];
>
> You can probably rely on rcu instead of ->file_lock, but this is minor.
>

I think so. I'll be updating the patch anyway (on top of current
one) so I'll address this comment too. Thanks!

> > +
> > + /*
> > + * One should have enough rights to inspect task details.
> > + */
> > + if (!ptrace_may_access(task1, PTRACE_MODE_READ) ||
> > + !ptrace_may_access(task2, PTRACE_MODE_READ)) {
> > + ret = -EACCES;
>
> Well, probably this is fine... but may be you can add a comment.
> The task can change its credentials right after ptrace_may_access()
> succeeds. This _looks_ wrong, perhaps it makes sense to add the
> "we do not care" note.
>

Wait, how it's differ from other ptrace_may_access calls all over
the kernel? I suppose I'm missing something obvious?

Cyrill


\
 
 \ /
  Last update: 2012-02-15 16:13    [W:0.283 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site