Skip to content

Commit

Permalink
ax25: Fix segfault after sock connection timeout
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
n7nix authored and davem330 committed Jan 16, 2017
1 parent f1f7714 commit 8a367e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ax25/ax25_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
{
ax25_clear_queues(ax25);

if (!sock_flag(ax25->sk, SOCK_DESTROY))
if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY))
ax25_stop_heartbeat(ax25);
ax25_stop_t1timer(ax25);
ax25_stop_t2timer(ax25);
Expand Down

0 comments on commit 8a367e7

Please sign in to comment.