lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091106071711.GA20946@elte.hu>
Date:	Fri, 6 Nov 2009 08:17:11 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Tejun Heo <tj@...nel.org>
Cc:	Jiri Kosina <jkosina@...e.cz>,
	Peter Zijlstra <peterz@...radead.org>,
	Yinghai Lu <yhlu.kernel@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>, cl@...ux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: irq lock inversion


* Tejun Heo <tj@...nel.org> wrote:

> > From: Jiri Kosina <jkosina@...e.cz>
> > Subject: lockdep: avoid false positives about irq-safety
> > 
> > Commit 403a91b1 ("percpu: allow pcpu_alloc() to be called
> > with IRQs off") introduced this warning:
> > 
> > 	=========================================================
> > 	[ INFO: possible irq lock inversion dependency detected ]
> > 	2.6.32-rc5-tip-04815-g12f0f93-dirty #745
> > 	---------------------------------------------------------
> > 	hub 1-3:1.0: state 7 ports 2 chg 0000 evt 0004
> > 	ksoftirqd/65/199 just changed the state of lock:
> > 	 (pcpu_lock){..-...}, at: [<ffffffff81130e04>] free_percpu+0x38/0x104
> > 	but this lock took another, SOFTIRQ-unsafe lock in the past:
> > 	 (vmap_area_lock){+.+...}
> > 
> > 	and interrupts could create inverse lock ordering between them.
> > 
> > This warning is bogus -- sched_init() is being called very early with IRQs
> > disabled, and the irqsave/restore code paths in pcpu_alloc() are only for early
> > init. The path can never be called from irq context once the early init
> > finishes. Rationale for this is explained in changelog of the commit mentioned
> > above.
> > 
> > This problem can be encountered generally in any other early code running
> > with IRQs off and using irqsave/irqrestore.
> > 
> > Reported-by: Yinghai Lu <yhlu.kernel@...il.com>
> > Signed-off-by: Jiri Kosina <jkosina@...e.cz>
> 
> Looks good to me.  Ingo, what do you think?

Ugh, this explanation is _BOGUS_. As i said, taking a lock with irqs 
disabled does _NOT_ mark a lock as 'irq safe' - if it did, we'd have 
false positives left and right.

Read the lockdep message please, consider all the backtraces it prints, 
it says something different.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ