]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 May 2018 21:48:36 +0000 (17:48 -0400)
commit79cdf17d8d9a8939b9b72af4361f35d797f79cdf
tree4f62bb31883657aee3d03961e715a5938df04519
parente5417cdeb1d8516a9f6c1c07db2a419be7f2774a
sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg

In Commit cc255a3631c7 ("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: cc255a3631c7 ("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>
net/sctp/ulpevent.c