Skip to content

Commit 8a367e7

Browse files
n7nixdavem330
authored andcommitted
ax25: Fix segfault after sock connection timeout
The ax.25 socket connection timed out & the sock struct has been previously taken down ie. sock struct is now a NULL pointer. Checking the sock_flag causes the segfault. Check if the socket struct pointer is NULL before checking sock_flag. This segfault is seen in timed out netrom connections. Please submit to -stable. Signed-off-by: Basil Gunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f1f7714 commit 8a367e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ax25/ax25_subr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
264264
{
265265
ax25_clear_queues(ax25);
266266

267-
if (!sock_flag(ax25->sk, SOCK_DESTROY))
267+
if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY))
268268
ax25_stop_heartbeat(ax25);
269269
ax25_stop_t1timer(ax25);
270270
ax25_stop_t2timer(ax25);

0 commit comments

Comments
 (0)