OSDN Git Service

sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg
authorXin Long <lucien.xin@gmail.com>
Thu, 10 May 2018 09:34:13 +0000 (17:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 May 2018 08:26:58 +0000 (10:26 +0200)
commit1f2b77e868d9ff002a312fd93ee20e636f80614d
tree5cb3f6c80c2276e40c8cbbaa23ced0deaa11da0f
parentf9a670e10d274274fda7fd74220dfd1048dd332e
sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg

[ Upstream commit 6910e25de2257e2c82c7a2d126e3463cd8e50810 ]

In Commit 1f45f78f8e51 ("sctp: allow GSO frags to access the chunk too"),
it held the chunk in sctp_ulpevent_make_rcvmsg to access it safely later
in recvmsg. However, it also added sctp_chunk_put in fail_mark err path,
which is only triggered before holding the chunk.

syzbot reported a use-after-free crash happened on this err path, where
it shouldn't call sctp_chunk_put.

This patch simply removes this call.

Fixes: 1f45f78f8e51 ("sctp: allow GSO frags to access the chunk too")
Reported-by: syzbot+141d898c5f24489db4aa@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>
net/sctp/ulpevent.c