Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 1/1] ax25: Fix segfault after sock connection timeout
@ 2017-01-14 20:18 Basil Gunn
  2017-01-16 19:40 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Basil Gunn @ 2017-01-14 20:18 UTC (permalink / raw)
  To: Joerg Reuter, Ralf Baechle, David S. Miller, linux-hams, netdev,
	linux-kernel
  Cc: stable, Jeremy McDermond, f6bvp

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 <basil@pacabunga.com>
---

diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c
index 4855d18..038b109 100644
--- a/net/ax25/ax25_subr.c
+++ b/net/ax25/ax25_subr.c
@@ -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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] ax25: Fix segfault after sock connection timeout
  2017-01-14 20:18 [PATCH 1/1] ax25: Fix segfault after sock connection timeout Basil Gunn
@ 2017-01-16 19:40 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-01-16 19:40 UTC (permalink / raw)
  To: basil
  Cc: jreuter, ralf, linux-hams, netdev, linux-kernel, stable, mcdermj,
	f6bvp

From: Basil Gunn <basil@pacabunga.com>
Date: Sat, 14 Jan 2017 12:18:55 -0800

> 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 <basil@pacabunga.com>

This is consistent with the ax25->sk NULL check later in this function.

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-16 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-14 20:18 [PATCH 1/1] ax25: Fix segfault after sock connection timeout Basil Gunn
2017-01-16 19:40 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox