]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
sctp: remove sched init from sctp_stream_init
authorXin Long <lucien.xin@gmail.com>
Fri, 8 Mar 2019 07:49:16 +0000 (15:49 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Mar 2019 19:08:24 +0000 (14:08 -0500)
commit30b6a902135f68c2a619102e6f4d7c47fd8fe4bf
tree13442d77376fd95e98b56cbe69298a73f8bb48a2
parenta435ef6b88c987c50ae63be4d885a632b9b5040f
sctp: remove sched init from sctp_stream_init

BugLink: https://bugs.launchpad.net/bugs/1821074
[ Upstream commit 2e990dfd13974d9eae493006f42ffb48707970ef ]

syzbot reported a NULL-ptr deref caused by that sched->init() in
sctp_stream_init() set stream->rr_next = NULL.

  kasan: GPF could be caused by NULL-ptr deref or user memory access
  RIP: 0010:sctp_sched_rr_dequeue+0xd3/0x170 net/sctp/stream_sched_rr.c:141
  Call Trace:
    sctp_outq_dequeue_data net/sctp/outqueue.c:90 [inline]
    sctp_outq_flush_data net/sctp/outqueue.c:1079 [inline]
    sctp_outq_flush+0xba2/0x2790 net/sctp/outqueue.c:1205

All sched info is saved in sout->ext now, in sctp_stream_init()
sctp_stream_alloc_out() will not change it, there's no need to
call sched->init() again, since sctp_outq_init() has already
done it.

Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")
Reported-by: syzbot+4c9934f20522c0efd657@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
net/sctp/stream.c