]> git.itanic.dy.fi Git - linux-stable/commit
posix-timers: fix RLIMIT_CPU && fork()
authorOleg Nesterov <oleg@redhat.com>
Thu, 9 Apr 2009 18:20:10 +0000 (18:20 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:36:59 +0000 (10:36 -0700)
commit3fe90c4dc50b1c4030d73d196a5d812ea906a4c9
tree3198feae732d19700f05cbffcfb0df7e8a46e8b8
parent39cd13c96cfc4d9d5992e93625fe6d6cb4fe3991
posix-timers: fix RLIMIT_CPU && fork()

upstream commit: 6279a751fe096a21dc7704e918d570d3ff06e769

See http://bugzilla.kernel.org/show_bug.cgi?id=12911

copy_signal() copies signal->rlim, but RLIMIT_CPU is "lost". Because
posix_cpu_timers_init_group() sets cputime_expires.prof_exp = 0 and thus
fastpath_timer_check() returns false unless we have other expired cpu timers.

Change copy_signal() to set cputime_expires.prof_exp if we have RLIMIT_CPU.
Also, set cputimer.running = 1 in that case. This is not strictly necessary,
but imho makes sense.

Reported-by: Peter Lojkin <ia6432@inbox.ru>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Peter Lojkin <ia6432@inbox.ru>
Cc: Roland McGrath <roland@redhat.com>
Cc: stable@kernel.org
LKML-Reference: <20090327000607.GA10104@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
kernel/fork.c