lkml.org 
[lkml]   [2009]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/3] extend get/setrlimit to support setting rlimits external to a process (v7)
On 11/09, Jiri Slaby wrote:
>
> + ppid = find_get_pid(pid);
> + if (!ppid)
> + goto out;
> +
> + tsk = get_pid_task(ppid, PIDTYPE_PID);
> +
> + if (!tsk)
> + goto out_put_pid;
> +
> + if (resource >= RLIM_NLIMITS)
> + goto out_put_all;
> +
> + retval = -EBUSY;
> + if (!lock_task_sighand(tsk, &flags))
>
> X task_lock below cannot nest inside sighand (according to Oleg)

Yes, this is deadlockable.

Also, I don't understand why wthis code get's both pid and task_struct().

And the "if (resource >= RLIM_NLIMITS)" check is racy afaics, see
http://marc.info/?l=linux-kernel&m=125200862124872

Oleg.



\
 
 \ /
  Last update: 2009-11-09 17:51    [W:0.136 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site