sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg
authorXin Long <[email protected]>
Thu, 10 May 2018 09:34:13 +0000 (17:34 +0800)
committerDavid S. Miller <[email protected]>
Thu, 10 May 2018 21:48:36 +0000 (17:48 -0400)
commit6910e25de2257e2c82c7a2d126e3463cd8e50810
tree4f62bb31883657aee3d03961e715a5938df04519
parenta577d868b768a3baf16cdd4841ab8cfb165521d6
sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg

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: [email protected]
Signed-off-by: Xin Long <[email protected]>
Acked-by: Neil Horman <[email protected]>
Acked-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/sctp/ulpevent.c