Skip to content

Commit

Permalink
sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_…
Browse files Browse the repository at this point in the history
…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: 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>
  • Loading branch information
Xin Long authored and David S. Miller committed May 10, 2018
1 parent a577d86 commit 6910e25
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/sctp/ulpevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,6 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
return event;

fail_mark:
sctp_chunk_put(chunk);
kfree_skb(skb);
fail:
return NULL;
Expand Down

0 comments on commit 6910e25

Please sign in to comment.