From: Frederic Weisbecker Date: Sun, 15 Mar 2009 21:10:37 +0000 (+0100) Subject: tracing/syscalls: protect thread flag toggling from races X-Git-Tag: v2.6.30-rc1~2^2~31^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5be71b61f17b0e3bc8ad0b1a1b7b53ab7d574ebb;p=pandora-kernel.git tracing/syscalls: protect thread flag toggling from races Impact: fix syscall tracer enable/disable race The current thread flag toggling is racy as shown in the following scenario: - task A is the last user of syscall tracing, it releases the TIF_SYSCALL_FTRACE on each tasks - at the same time task B start syscall tracing. refcount == 0 so it sets up TIF_SYSCALL_FTRACE on each tasks. The effect of the mixup is unpredictable. So this fix adds a mutex on {start,stop}_syscall_tracing(). Reported-by: Andrew Morton Reported-by: Ingo Molnar LKML-Reference: <1237151439-6755-3-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed