Skip to content

Commit 6910e25

Browse files
lxindavem330
authored andcommitted
sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg
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]>
1 parent a577d86 commit 6910e25

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
@@ -715,7 +715,6 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
715715
return event;
716716

717717
fail_mark:
718-
sctp_chunk_put(chunk);
719718
kfree_skb(skb);
720719
fail:
721720
return NULL;

0 commit comments

Comments
 (0)