netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] netrom: fix deadlock and refcount leak in nr_rt_device_down
@ 2025-12-04  9:09 Junjie Cao
  2025-12-04  9:09 ` [PATCH 1/2] netrom: fix possible deadlock " Junjie Cao
  2025-12-04  9:09 ` [PATCH 2/2] netrom: fix reference count leak " Junjie Cao
  0 siblings, 2 replies; 4+ messages in thread
From: Junjie Cao @ 2025-12-04  9:09 UTC (permalink / raw)
  To: pabeni, davem, edumazet, kuba, syzbot+14afda08dc3484d5db82
  Cc: horms, linux-hams, netdev, linux-kernel, syzkaller-bugs, stable,
	junjie.cao

Hi,

syzbot reported a circular locking dependency in the NET/ROM routing
code involving nr_neigh_list_lock, nr_node_list_lock and
nr_node->node_lock when nr_rt_device_down() interacts with the
ioctl path. This series fixes that deadlock and also addresses a
long-standing reference count leak found while auditing the same
code.

Patch 1/2 refactors nr_rt_device_down() to avoid nested locking
between nr_neigh_list_lock and nr_node_list_lock by doing two
separate passes over nodes and neighbours, and adjusts nr_rt_free()
to follow the same lock ordering.

Patch 2/2 fixes a per-route reference count leak by dropping
nr_neigh->count and calling nr_neigh_put() when removing routes
from nr_rt_device_down(), mirroring the behaviour of
nr_dec_obs()/nr_del_node().

[1] https://syzkaller.appspot.com/bug?extid=14afda08dc3484d5db82

Thanks,
Junjie

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

end of thread, other threads:[~2026-01-02 20:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04  9:09 [PATCH v2 0/2] netrom: fix deadlock and refcount leak in nr_rt_device_down Junjie Cao
2025-12-04  9:09 ` [PATCH 1/2] netrom: fix possible deadlock " Junjie Cao
2026-01-02 20:46   ` Jakub Kicinski
2025-12-04  9:09 ` [PATCH 2/2] netrom: fix reference count leak " Junjie Cao

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).