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] [day] [month] [year] [list]
Message-ID: <530b9c4a-b9f0-431b-96c6-6387885ad28d@suse.cz>
Date: Tue, 5 Nov 2024 10:37:09 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Tejun Heo <tj@...nel.org>, Boqun Feng <boqun.feng@...il.com>
Cc: Hillf Danton <hdanton@...a.com>,
 Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
 "Paul E. McKenney" <paulmck@...nel.org>, Marco Elver <elver@...gle.com>,
 linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org
Subject: Re: [BUG] -next lockdep invalid wait context

On 11/4/24 19:08, Tejun Heo wrote:
> Hello,
> 
> On Fri, Nov 01, 2024 at 05:45:01PM -0700, Boqun Feng wrote:
> ...
>> Because it's a different bug.
>> 
>> 	schedule():
>> 	  __schedule():
>> 	    rq_lock(); // <- rq lock is a raw spin lock, so no sleep inside
>> 	    switch_mm_irqs_off():
>> 	      trace_tlb_flush():
>> 	        bpf_trace_run2():
>> 		  stack_map_get_build_id_offset():
>> 		    mmap_read_trylock(): // this is actually ok, because
>> 		    			 // trylock() on rwsem won't
>> 					 // sleep.
>> 		      __mmap_lock_trace_acquire_returned():
>> 		        get_mm_memcg_path():
>> 			  cgroup_path():
>> 			    kernfs_path_from_node():
>> 			      read_lock_irqsave(); // on RT, read_lock()
>> 			      			   // is a rwsem IIUC,
>> 						   // so might sleep.
>> 						   // hence the issue.
>> 
>> Maybe kernfs can use RCU instead of read_lock here? I don't know...
> 
> Yeah, we should be able to make kn->name RCU protected and drop the usage of
> the rename lock in read paths.

For the purposes of the get_mm_memcg_path() usage for tracepoints, it would
be also sufficient to have a trylock variant. If the lock cannot be
acquired, the trace event will omit the memcg detail, which is documented as
a possibility already.

> Thanks.
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ