- pacct-none-delayed-process-accounting-accumulation-fix.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     fix acct_collect() siglock bug

has been removed from the -mm tree.  Its filename is

     pacct-none-delayed-process-accounting-accumulation-fix.patch

This patch was dropped because it was folded into pacct-none-delayed-process-accounting-accumulation.patch

------------------------------------------------------
Subject: fix acct_collect() siglock bug
From: Ingo Molnar <mingo@xxxxxxx>


the lock validator noticed the following bug:

 =========================================================
 [ INFO: possible irq lock inversion dependency detected ]
 ---------------------------------------------------------
 swapper/0 just changed the state of lock:
  (tasklist_lock){..-?}, at: [<c01247c8>] send_group_sig_info+0xe/0x2f
 but this lock took another, soft-irq-unsafe lock in the past:
  (&sighand->siglock){--..}

 and interrupts could create inverse lock ordering between them.
 ...
  -> (init_sighand.siglock){....} ops: 18 {
 ...
       hardirq-on-W at:
                       [<c0130577>] lock_acquire+0x56/0x73
                       [<c03ec59c>] _spin_lock+0x24/0x32
                       [<c01374bd>] acct_collect+0x81/0x115
                       [<c011b4fa>] do_exit+0x19a/0x7b3
                       [<c01273ce>] ____call_usermodehelper+0xdf/0xe1
                       [<c01007f1>] kernel_thread_helper+0x5/0xb

it turns out that acct_collect() takes current->sighand->siglock with
interrupts enabled - a big no-no.  Fix it by disabling interrupts.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Cc: KaiGai Kohei <kaigai@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 kernel/acct.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN kernel/acct.c~pacct-none-delayed-process-accounting-accumulation-fix kernel/acct.c
--- a/kernel/acct.c~pacct-none-delayed-process-accounting-accumulation-fix
+++ a/kernel/acct.c
@@ -549,7 +549,7 @@ void acct_collect(long exitcode, int gro
 		up_read(&current->mm->mmap_sem);
 	}
 
-	spin_lock(&current->sighand->siglock);
+	spin_lock_irq(&current->sighand->siglock);
 	if (group_dead)
 		pacct->ac_mem = vsize / 1024;
 	if (thread_group_leader(current)) {
@@ -567,7 +567,7 @@ void acct_collect(long exitcode, int gro
 	pacct->ac_stime = cputime_add(pacct->ac_stime, current->stime);
 	pacct->ac_minflt += current->min_flt;
 	pacct->ac_majflt += current->maj_flt;
-	spin_unlock(&current->sighand->siglock);
+	spin_unlock_irq(&current->sighand->siglock);
 }
 
 /**
_

Patches currently in -mm which might be from mingo@xxxxxxx are

origin.patch
define-__raw_get_cpu_var-and-use-it.patch
ide-cd-end-of-media-error-fix.patch
lock-validator-introduce-warn_on_oncecond.patch
emu10k1-mark-midi_spinlock-as-used.patch
epoll-use-unlocked-wqueue-operations.patch
pacct-none-delayed-process-accounting-accumulation.patch
pacct-none-delayed-process-accounting-accumulation-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux