Skip to content

Commit 9cf8575

Browse files
f6bvpgregkh
authored andcommitted
rose: check NULL rose_loopback_neigh->loopback
[ Upstream commit 3c53cd6 ] Commit 3b3fd06 added NULL check for `rose_loopback_neigh->dev` in rose_loopback_timer() but omitted to check rose_loopback_neigh->loopback. It thus prevents *all* rose connect. The reason is that a special rose_neigh loopback has a NULL device. /proc/net/rose_neigh illustrates it via rose_neigh_show() function : [...] seq_printf(seq, "%05d %-9s %-4s %3d %3d %3s %3s %3lu %3lu", rose_neigh->number, (rose_neigh->loopback) ? "RSLOOP-0" : ax2asc(buf, &rose_neigh->callsign), rose_neigh->dev ? rose_neigh->dev->name : "???", rose_neigh->count, /proc/net/rose_neigh displays special rose_loopback_neigh->loopback as callsign RSLOOP-0: addr callsign dev count use mode restart t0 tf digipeaters 00001 RSLOOP-0 ??? 1 2 DCE yes 0 0 By checking rose_loopback_neigh->loopback, rose_rx_call_request() is called even in case rose_loopback_neigh->dev is NULL. This repairs rose connections. Verification with rose client application FPAC: FPAC-Node v 4.1.3 (built Aug 5 2022) for LINUX (help = h) F6BVP-4 (Commands = ?) : u Users - AX.25 Level 2 sessions : Port Callsign Callsign AX.25 state ROSE state NetRom status axudp F6BVP-5 -> F6BVP-9 Connected Connected --------- Fixes: 3b3fd06 ("rose: Fix Null pointer dereference in rose_send_frame()") Signed-off-by: Bernard Pidoux <[email protected]> Suggested-by: Francois Romieu <[email protected]> Cc: Thomas DL9SAU Osterried <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e1ae035 commit 9cf8575

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/rose/rose_loopback.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ static void rose_loopback_timer(struct timer_list *unused)
9696
}
9797

9898
if (frametype == ROSE_CALL_REQUEST) {
99-
if (!rose_loopback_neigh->dev) {
99+
if (!rose_loopback_neigh->dev &&
100+
!rose_loopback_neigh->loopback) {
100101
kfree_skb(skb);
101102
continue;
102103
}

0 commit comments

Comments
 (0)