Skip to content

Commit 4dce9af

Browse files
lxingregkh
authored andcommitted
sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg
[ Upstream commit 6910e25 ] In Commit 1f45f78 ("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: 1f45f78 ("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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d3d4d69 commit 4dce9af

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

net/sctp/ulpevent.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
717717
return event;
718718

719719
fail_mark:
720-
sctp_chunk_put(chunk);
721720
kfree_skb(skb);
722721
fail:
723722
return NULL;

0 commit comments

Comments
 (0)