Received: by 10.192.165.148 with SMTP id m20csp811348imm; Fri, 27 Apr 2018 07:54:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpZiCMiYLhs5G3VJoOu0Y8ES/YxDfyEKiZtdd5cL4qw8ZXnubZ84Cvmd7LzYvfSzrBRzOul X-Received: by 2002:a17:902:205:: with SMTP id 5-v6mr2509827plc.301.1524840897008; Fri, 27 Apr 2018 07:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524840896; cv=none; d=google.com; s=arc-20160816; b=ys9DS0A5htGETdykF9fBTHhtgessmr6X8bueWoeMqKW46Y+XV7e9FbV/kVAgxn02mY prSLk/X6pm5wOAQviBtepp+PA7YufyrTMxM83EFyX8XDpLlxEi7opXG1KnYKiKsX0pZF XJi8ji+gtEDSRMtYp1ouqiugiy1o9K2OmoECQtlECLa76dK1Yjta7QN7hKzx1HhjhDND lkCX0oYyCkWWQGYeIFtiSJNjzqAW/LKGHl6hqJyYD/S1Ooft2/avfIRdvIZZgb8VNo4P AYxicckOg1GGJElEIw0l/oE8Mrs7xrECSJWONX9sRT98veFL7At1h2l5tsPduY35PGhE hvQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=KbDKNOcIJFTw1bGGf1e0U26OK9ghhTVoNPE2E2qBXiA=; b=yb0p3ISDtCmaH6FJQ34pgXNHtxa7sz9QZ7EtVUKImawDvgVBlqDzG1tLqKRjUR9I94 ccekNHWltnOoAjG3yEb30ntP2o79SjUv3NTwUQO4uXKcA8Oat7SJxWX7ffBiDd3vP1Xz YpsqhsTVpdBSyrhYMxYJBthWIr4eqmds2gNhhBCWVBaN+mBsiZJ48eigeqDQ9LbpvZmq xOnf2gx2bSY8iDOm9yXqbrFtC/AXhHEOLm6mv52zZOEbgAttb2Zykz8I6Y6yoZlo5LTm 7kGb8ilr8H0uRKzFPqC7R118tCDwUpB0dnILMCvPnqQUH3gRE/viJeqisFgI6ywL8rqP ofRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si1418496pll.10.2018.04.27.07.54.43; Fri, 27 Apr 2018 07:54:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934317AbeD0Oxd (ORCPT + 99 others); Fri, 27 Apr 2018 10:53:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:52904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934220AbeD0OG5 (ORCPT ); Fri, 27 Apr 2018 10:06:57 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFD1C218BC; Fri, 27 Apr 2018 14:06:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFD1C218BC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tejun Heo , Doron Roberts-Kedes , "David S. Miller" Subject: [PATCH 4.14 29/80] strparser: Do not call mod_delayed_work with a timeout of LONG_MAX Date: Fri, 27 Apr 2018 15:58:22 +0200 Message-Id: <20180427135734.449660017@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135732.928644313@linuxfoundation.org> References: <20180427135732.928644313@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Doron Roberts-Kedes [ Upstream commit 7c5aba211dd61f41d737a2c51729eb9fdcd3edf4 ] 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: 43a0c6751a322847 ("strparser: Stream parser for messages") Reviewed-by: Tejun Heo Signed-off-by: Doron Roberts-Kedes Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/strparser/strparser.c +++ b/net/strparser/strparser.c @@ -67,7 +67,7 @@ static void strp_abort_strp(struct strpa static void strp_start_timer(struct strparser *strp, long timeo) { - if (timeo) + if (timeo && timeo != LONG_MAX) mod_delayed_work(strp_wq, &strp->msg_timer_work, timeo); }