[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250208113525.2055-1-hdanton@sina.com>
Date: Sat, 8 Feb 2025 19:35:23 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+8863ad36d31449b4dc17@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [hams?] possible deadlock in nr_remove_neigh (2)
On Fri, 07 Feb 2025 21:02:23 -0800
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 7ee983c850b4 Merge tag 'drm-fixes-2025-02-08' of https://g..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17148bdf980000
#syz test
--- x/net/netrom/nr_route.c
+++ y/net/netrom/nr_route.c
@@ -100,6 +100,7 @@ static int __must_check nr_add_node(ax25
{
struct nr_node *nr_node;
struct nr_neigh *nr_neigh;
+ struct nr_neigh *victim = NULL;
int i, found;
struct net_device *odev;
@@ -245,8 +246,9 @@ static int __must_check nr_add_node(ax25
nr_node->routes[2].neighbour->count--;
nr_neigh_put(nr_node->routes[2].neighbour);
- if (nr_node->routes[2].neighbour->count == 0 && !nr_node->routes[2].neighbour->locked)
- nr_remove_neigh(nr_node->routes[2].neighbour);
+ if (nr_node->routes[2].neighbour->count == 0 &&
+ !nr_node->routes[2].neighbour->locked)
+ victim = nr_node->routes[2].neighbour;
nr_node->routes[2].quality = quality;
nr_node->routes[2].obs_count = obs_count;
@@ -281,6 +283,8 @@ static int __must_check nr_add_node(ax25
nr_neigh_put(nr_neigh);
nr_node_unlock(nr_node);
+ if (victim)
+ nr_remove_neigh(victim);
nr_node_put(nr_node);
return 0;
}
--
Powered by blists - more mailing lists