netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Crash due to mutex genl_lock called from RCU context
@ 2016-11-26  2:15 subashab
  2016-11-26  4:11 ` Eric Dumazet
  0 siblings, 1 reply; 12+ messages in thread
From: subashab @ 2016-11-26  2:15 UTC (permalink / raw)
  To: tgraf, netdev; +Cc: eric.dumazet

We are seeing a crash due to gen_lock mutex being acquired in RCU 
context.
Crash is seen on a 4.4 based kernel ARM64 device. This occurred in a
regression rack, so unfortunately I don't have steps for a reproducer.

It looks like freeing socket in RCU was brought in through commit
21e4902aea80ef35afc00ee8d2abdea4f519b7f7 ("netlink: Lockless lookup with
RCU grace period in socket release").
I am not very familiar with generic netlink sockets so I am not sure
if there is any other way to fix this apart from reverting this patch.

Any pointers to debug this would be appreciated.

Here is the call stack -

BUG: sleeping function called from invalid context 
kernel/locking/mutex.c:98
in_atomic(): 1, irqs_disabled(): 0, pid: 16400, name: busybox
[<ffffff80080cad20>] ___might_sleep+0x134/0x144
[<ffffff80080cadac>] __might_sleep+0x7c/0x8c
[<ffffff8008ef09a8>] mutex_lock+0x2c/0x4c
[<ffffff8008d307f0>] genl_lock+0x1c/0x24
[<ffffff8008d30848>] genl_lock_done+0x2c/0x50
[<ffffff8008d2ccac>] netlink_sock_destruct+0x30/0x94
[<ffffff8008cdef44>] sk_destruct+0x2c/0x150
[<ffffff8008cdf104>] __sk_free+0x9c/0xc4
[<ffffff8008cdf16c>] sk_free+0x40/0x4c
[<ffffff8008d2c7fc>] deferred_put_nlk_sk+0x40/0x4c
[<ffffff800810b104>] rcu_process_callbacks+0x4d4/0x644
[<ffffff80080a6598>] __do_softirq+0x1b8/0x3c4
[<ffffff80080a6a60>] irq_exit+0x80/0xd4
[<ffffff800808e554>] handle_IPI+0x1c0/0x364
[<ffffff80080817f8>] gic_handle_irq+0x154/0x1a4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-11-30  0:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-26  2:15 Crash due to mutex genl_lock called from RCU context subashab
2016-11-26  4:11 ` Eric Dumazet
2016-11-26  4:54   ` Eric Dumazet
2016-11-26  5:59     ` subashab
2016-11-27  2:08     ` Cong Wang
2016-11-27  2:26       ` Eric Dumazet
2016-11-27  6:28         ` Cong Wang
2016-11-27 16:23           ` Eric Dumazet
2016-11-28  6:53             ` Cong Wang
2016-11-28 11:22               ` Herbert Xu
2016-11-29  4:33                 ` Cong Wang
2016-11-30  0:49                 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).