Commit 1d88ba1e authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: not allow transport timeout value less than HZ/5 for hb_timer

syzbot reported a rcu_sched self-detected stall on CPU which is caused
by too small value set on rto_min with SCTP_RTOINFO sockopt. With this
value, hb_timer will get stuck there, as in its timer handler it starts
this timer again with this value, then goes to the timer handler again.

This problem is there since very beginning, and thanks to Eric for the
reproducer shared from a syzbot mail.

This patch fixes it by not allowing sctp_transport_timeout to return a
smaller value than HZ/5 for hb_timer, which is based on TCP's min rto.

Note that it doesn't fix this issue by limiting rto_min, as some users
are still using small rto and no proper value was found for it yet.

Suggested-by: default avatarMarcelo Ricardo Leitner <>
Signed-off-by: default avatarXin Long <>
Acked-by: default avatarNeil Horman <>
Signed-off-by: default avatarDavid S. Miller <>
parent 819dd92b
......@@ -637,7 +637,7 @@ unsigned long sctp_transport_timeout(struct sctp_transport *trans)
trans->state != SCTP_PF)
timeout += trans->hbinterval;
return timeout;
return max_t(unsigned long, timeout, HZ / 5);
/* Reset transport variables to their initial values */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment