lkml.org 
[lkml]   [2018]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 26/41] sctp: not allow transport timeout value less than HZ/5 for hb_timer
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Xin Long <lucien.xin@gmail.com>

    [ Upstream commit 1d88ba1ebb2763aa86172cd7ca05dedbeccc0d35 ]

    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.

    Reported-by: syzbot+3dcd59a1f907245f891f@syzkaller.appspotmail.com
    Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Acked-by: Neil Horman <nhorman@tuxdriver.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    net/sctp/transport.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/net/sctp/transport.c
    +++ b/net/sctp/transport.c
    @@ -637,7 +637,7 @@ unsigned long sctp_transport_timeout(str
    trans->state != SCTP_PF)
    timeout += trans->hbinterval;

    - return timeout;
    + return max_t(unsigned long, timeout, HZ / 5);
    }

    /* Reset transport variables to their initial values */

    \
     
     \ /
      Last update: 2018-06-09 17:36    [W:4.142 / U:0.632 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site