Skip to content

Commit 7c5aba2

Browse files
Doron Roberts-Kedesdavem330
authored andcommitted
strparser: Do not call mod_delayed_work with a timeout of LONG_MAX
struct sock's sk_rcvtimeo is initialized to LONG_MAX/MAX_SCHEDULE_TIMEOUT in sock_init_data. Calling mod_delayed_work with a timeout of LONG_MAX causes spurious execution of the work function. timer->expires is set equal to jiffies + LONG_MAX. When timer_base->clk falls behind the current value of jiffies, the delta between timer_base->clk and jiffies + LONG_MAX causes the expiration to be in the past. Returning early from strp_start_timer if timeo == LONG_MAX solves this problem. Found while testing net/tls_sw recv path. Fixes: 43a0c67 ("strparser: Stream parser for messages") Reviewed-by: Tejun Heo <tj@kernel.org> Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a957fa1 commit 7c5aba2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/strparser/strparser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void strp_abort_strp(struct strparser *strp, int err)
6767

6868
static void strp_start_timer(struct strparser *strp, long timeo)
6969
{
70-
if (timeo)
70+
if (timeo && timeo != LONG_MAX)
7171
mod_delayed_work(strp_wq, &strp->msg_timer_work, timeo);
7272
}
7373

0 commit comments

Comments
 (0)