lkml.org 
[lkml]   [2005]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateThu, 04 Aug 2005 14:22:15 -0700
FromGeorge Anzinger <>
Subject[PATCH] Re: 2.6.12: itimer_real timers don't survive execve() any more
Gerd Knorr wrote:
> Hi,
>
> Somewhere between 2.6.11 and 2.6.12 the regression in $subject
> was added to the linux kernel. Testcase below.

Yep. The itimer changes got a bit carried away. Here is a fix.

--
George Anzinger george@mvista.com
HRT (High-res-timers): http://sourceforge.net/projects/high-res-timers/
Source: MontaVista Software, Inc. George Anzinger <george@mvista.com>
Type: Defect Fix
Description:

The changes to itimer of late (after 2.6.11) cause itimers not
to survive the exec* calls. Standard says they should.

Signed-off-by: George Anzinger<george@mvista.com>

exit.c | 1 +
posix-timers.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.13-rc/kernel/exit.c
===================================================================
--- linux-2.6.13-rc.orig/kernel/exit.c
+++ linux-2.6.13-rc/kernel/exit.c
@@ -794,6 +794,7 @@ fastcall NORET_TYPE void do_exit(long co
}

tsk->flags |= PF_EXITING;
+ del_timer_sync(&tsk->signal->real_timer);

/*
* Make sure we don't try to process any timer firings
Index: linux-2.6.13-rc/kernel/posix-timers.c
===================================================================
--- linux-2.6.13-rc.orig/kernel/posix-timers.c
+++ linux-2.6.13-rc/kernel/posix-timers.c
@@ -1183,10 +1183,10 @@ void exit_itimers(struct signal_struct *
struct k_itimer *tmr;

while (!list_empty(&sig->posix_timers)) {
- tmr = list_entry(sig->posix_timers.next, struct k_itimer, list);
+ tmr = list_entry(sig->posix_timers.next,
+ struct k_itimer, list);
itimer_delete(tmr);
}
- del_timer_sync(&sig->real_timer);
}

/*
\
 
 \ /
  Last update: 2005-08-04 23:40    [from the cache]
©2003-2010