Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1572601 > unrolled thread

[PATCH 4.4 11/20] ax25: Fix segfault after sock connection timeout

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-02-02 19:40 +0100
Last post2017-02-02 19:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.4 11/20] ax25: Fix segfault after sock connection timeout Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-02 19:40 +0100

#1572601 — [PATCH 4.4 11/20] ax25: Fix segfault after sock connection timeout

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-02-02 19:40 +0100
Subject[PATCH 4.4 11/20] ax25: Fix segfault after sock connection timeout
Message-ID<t6usz-7Bs-51@gated-at.bofh.it>
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Basil Gunn <basil@pacabunga.com>


[ Upstream commit 8a367e74c0120ef68c8c70d5a025648c96626dff ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ax25/ax25_subr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ax25/ax25_subr.c
+++ b/net/ax25/ax25_subr.c
@@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int
 {
 	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);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web