* [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; 3+ 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] 3+ 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
[not found] ` <1a4ee351-031c-932e-0332-779ce33e90e6@trinnet.net>
0 siblings, 1 reply; 3+ 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] 3+ messages in thread
* Re: [ROSE] rose dereferenced pointer kernel panic
[not found] ` <21e6f319-f0cf-276e-a374-d44c9bd8827e@free.fr>
@ 2019-01-02 11:52 ` Dmitry Vyukov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Vyukov @ 2019-01-02 11:52 UTC (permalink / raw)
To: Bernard Pidoux
Cc: David Ranch, ralf, David Miller, linux-hams, netdev, LKML,
syzkaller
On Wed, Jan 2, 2019 at 12:12 AM Bernard Pidoux <f6bvp@free.fr> wrote:
>
> Hi David,
>
> In my previous message I should have reported the following patch rather than the one I reported.
>
> The reason is that the bug is better explained here :
>
> https://marc.info/?l=linux-hams&m=154478673812818&w=2
>
> and I hope the new proposed patch is more convenient.
>
>
> Bernard
>
>
> Le 01/01/2019 à 23:39, Bernard Pidoux a écrit :
>
> Hi David,
>
> As you already know I am still looking for the simplest way to configure a kernel rose failure situation when rose_route_frame is called with a NULL pointer.
>
> Could you explain with full details how to have "TCP/IP over AX.25 fully configured" ?
>
> More specifically how can we configure rose device without NOARP ? This is not the case when performing Dmitry Vyukov :
>
> # ip link set dev rose0 address 11:22:33:44:55
> # ip link set dev rose0 up
>
> 73 de Bernard, f6bvp
>
>
> Le 08/12/2018 à 17:23, David Ranch a écrit :
>
> Hello Bernard, Everyone,
>
> Yes, I've seen a similar behavior with another program I have here that broadcasts on all live TCP/IP interfaces when it loads. That all depends if you have TCP/IP over AX.25 fully configured on your machine. If you do, this cp,,amd should key up your radio to send out an ARP:
>
> ping -b -c 1 <broadcast IP on your ROSE or AX.25 interface>
> --
> d710: fm KI6ZHD to QST ctl UI pid=CC(IP) len 84
> IP: len 84 44.4.10.39->44.4.10.127 ihl 20 ttl 64 DF prot ICMP
> ICMP: type Echo Request id 50814 seq 1
> P�.\
> �~.
> ................ !"#$%&'()*+,-./01234567
> --
>
> Btw, I've been aware of this ROSE panic issue for some time and I'm pretty sure I forwarded those details on to you but that was many years ago. Another way to reproduce a ROSE panic is, if I remember correctly, you remove the backing AX.25 interface's connection (say killing kisssattach for ax0) on a ROSE interface that has an IP, that will also panic the kernel every time.
>
> --David
> KI6ZHD
+mailing lists
Hi Bernard,
I've provided a bit more information on what I did here:
https://groups.google.com/d/msg/syzkaller/v-4B3zoBC-4/MVgYoeSQCgAJ
I really did not do anything fancy.
FWIW I had to do the following locally just to prevent rose from
crashing my machine all the time. I don't know if it's the right fix
or not, I just used this as stop-gap.
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 77e9f85a2c92..218308a3c02c 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -874,6 +874,8 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
skb->data[ROSE_CALL_REQ_ADDR_LEN_OFF] !=
ROSE_CALL_REQ_ADDR_LEN_VAL))
return res;
+ if (ax25 == NULL)
+ return res;
src_addr = (rose_address *)(skb->data + ROSE_CALL_REQ_SRC_ADDR_OFF);
dest_addr = (rose_address *)(skb->data + ROSE_CALL_REQ_DEST_ADDR_OFF);
rose_xmit calls rose_route_frame with ax25==NULL, then
rose_route_frame uses ax25 without any checks.
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-02 11:52 UTC | newest]
Thread overview: 3+ 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
[not found] ` <1a4ee351-031c-932e-0332-779ce33e90e6@trinnet.net>
[not found] ` <20170201080217.4d8443bb@brox.localnet>
[not found] ` <3e3f25fc-fc60-c01b-1139-245284200656@trinnet.net>
[not found] ` <39dad041-f224-735e-adb7-e0fb42771858@free.fr>
[not found] ` <25ee9245-3595-85f7-93b8-a18d6066a2e3@free.fr>
[not found] ` <07a1454e-99a2-8cec-d50a-006257687c2e@free.fr>
[not found] ` <12e0547b-cb2c-1ca0-abc0-d849d8a62139@trinnet.net>
[not found] ` <3d0e170e-3995-84d0-007e-3d2065296237@free.fr>
[not found] ` <9f9dba49-c2a5-41e8-9382-9154802e7fbf@trinnet.net>
[not found] ` <20170327163641.0f992e2d@brox.localnet>
[not found] ` <06ce7640-bbd6-dd5e-05d9-f1afcec680e5@free.fr>
[not found] ` <309904235.63498.1492029796017@ox-groupware.bfs.de>
[not found] ` <6bd2a0b4-12b0-0de0-7bc2-e911d3ab4446@free.fr>
[not found] ` <a4f993a0-b12a-f3e6-455c-16ea2da28737@trinnet.net>
[not found] ` <74b515a0-0de1-ebaf-a874-b55f2b682efe@free.fr>
[not found] ` <4188542e-1404-badc-cc8d-8bb07cb6d55a@free.fr>
[not found] ` <969c06f8-572b-db66-3ebb-1e02205461fa@trinnet.net>
[not found] ` <b20c7da4-66f5-0f6b-ac21-41ab075b9d69@free.fr>
[not found] ` <21e6f319-f0cf-276e-a374-d44c9bd8827e@free.fr>
2019-01-02 11:52 ` [ROSE] rose dereferenced pointer kernel panic Dmitry Vyukov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).