]> git.baikalelectronics.ru Git - kernel.git/commit
net/x25: fix nonblocking connect
authorMartin Schiller <ms@dev.tdt.de>
Thu, 9 Jan 2020 06:31:14 +0000 (07:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Jan 2020 02:39:33 +0000 (18:39 -0800)
commit0fcad451dea8cbe8e1fa4f3ba3e990641628da80
treefe4194f409a60212ac0b10cc6a18b19dc14e730f
parent63af80a8cd261a39aac04f3a588e3d506090d1b2
net/x25: fix nonblocking connect

This patch fixes 2 issues in x25_connect():

1. It makes absolutely no sense to reset the neighbour and the
connection state after a (successful) nonblocking call of x25_connect.
This prevents any connection from being established, since the response
(call accept) cannot be processed.

2. Any further calls to x25_connect() while a call is pending should
simply return, instead of creating new Call Request (on different
logical channels).

This patch should also fix the "KASAN: null-ptr-deref Write in
x25_connect" and "BUG: unable to handle kernel NULL pointer dereference
in x25_connect" bugs reported by syzbot.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Reported-by: syzbot+429c200ffc8772bfe070@syzkaller.appspotmail.com
Reported-by: syzbot+eec0c87f31a7c3b66f7b@syzkaller.appspotmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
net/x25/af_x25.c