]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netrom: fix double-free in nr_route_frame()
authorJeongjun Park <aha310510@gmail.com>
Mon, 19 Jan 2026 06:33:59 +0000 (15:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:40 +0000 (10:27 +0100)
commitbd8955337e3764f912f49b360e176d8aaecf7016
treed13a22dcbd916c6c4290b18628bbe410af1dd307
parent43f233eb6e7b9d88536881a9bc43726d0e34800d
netrom: fix double-free in nr_route_frame()

commit ba1096c315283ee3292765f6aea4cca15816c4f7 upstream.

In nr_route_frame(), old_skb is immediately freed without checking if
nr_neigh->ax25 pointer is NULL. Therefore, if nr_neigh->ax25 is NULL,
the caller function will free old_skb again, causing a double-free bug.

Therefore, to prevent this, we need to modify it to check whether
nr_neigh->ax25 is NULL before freeing old_skb.

Cc: <stable@vger.kernel.org>
Reported-by: syzbot+999115c3bf275797dc27@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/69694d6f.050a0220.58bed.0029.GAE@google.com/
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Link: https://patch.msgid.link/20260119063359.10604-1-aha310510@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netrom/nr_route.c