public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Race condition?
@ 2002-08-02 13:46 Kasper Dupont
  2002-08-02 14:48 ` Oliver Neukum
  2002-08-02 17:00 ` Dave Hansen
  0 siblings, 2 replies; 14+ messages in thread
From: Kasper Dupont @ 2002-08-02 13:46 UTC (permalink / raw)
  To: Linux-Kernel

Is there a race condition in this piece of code from do_fork in
linux/kernel/fork.c? I cannot see what prevents two processes
from calling this at the same time and both successfully fork
even though the user had only one process left.

        if (atomic_read(&p->user->processes) >= p->rlim[RLIMIT_NPROC].rlim_cur
                      && !capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE))
                goto bad_fork_free;

        atomic_inc(&p->user->__count);
        atomic_inc(&p->user->processes);

-- 
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:razrep@daimi.au.dk
or mailto:mcxumhvenwblvtl@skrammel.yaboo.dk

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <17aw0S-0U7gB7C@fmrl00.sul.t-online.com>]

end of thread, other threads:[~2002-08-03 11:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-02 13:46 [RFC] Race condition? Kasper Dupont
2002-08-02 14:48 ` Oliver Neukum
2002-08-02 17:13   ` Kasper Dupont
2002-08-02 18:51     ` Oliver Neukum
2002-08-02 17:37   ` Dave Hansen
2002-08-02 18:45     ` Oliver Neukum
2002-08-02 19:09       ` Dave Hansen
2002-08-02 17:00 ` Dave Hansen
2002-08-02 17:41   ` Oliver Neukum
2002-08-02 18:48     ` Dave Hansen
2002-08-02 18:56     ` Dave Hansen
2002-08-03  0:36   ` Keith Owens
     [not found] <17aw0S-0U7gB7C@fmrl00.sul.t-online.com>
2002-08-03 11:07 ` Keith Owens
2002-08-03 11:17   ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox