Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1559069
| From | Basil Gunn <basil@pacabunga.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/1] ax25: Fix segfault after sock connection timeout |
| Date | 2017-01-14 21:30 +0100 |
| Message-ID | <sZD7z-1Yp-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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);
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 1/1] ax25: Fix segfault after sock connection timeout Basil Gunn <basil@pacabunga.com> - 2017-01-14 21:30 +0100
csiph-web