Messages in this thread | | | Date | Mon, 9 Nov 2009 17:40:53 +0100 | From | Oleg Nesterov <> | Subject | Re: [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.
| |