Received: by 10.192.165.148 with SMTP id m20csp790534imm; Fri, 27 Apr 2018 07:34:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp1kVzgclg48McAM9BNmtABVbmA6b2A5xUAyWKsheTvjcaCiOrGtwltrmMaJ6Rrd3dOtb0c X-Received: by 2002:a63:5fd1:: with SMTP id t200-v6mr2419205pgb.246.1524839648435; Fri, 27 Apr 2018 07:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524839648; cv=none; d=google.com; s=arc-20160816; b=fwb8VoNig28gXDMlkSPN/Dkurv1F3mjHePQ+lmjnPD/+sTQ72aFlIXqqB8GnKlG+EI YmTL6x8xHoQSD6x9pOYjnfoUkgsRLYn1hK7B+553Vb6RC0uFHosx1vQQtPHjjyLxHaAV z89ly415ExLLEv7eVI3+yY1rM09FqjL7m0iQFEZIQx/xlKZWlaCTBH7KBJjfnK77NuTP K3NVLrzdnZILDrKjUS8FbHTPSGu6N+9Vw2PDpg2+NRe4ADihuEtf0zJBSVpBLN4M6vOs OeullJvY2FQFeoQZldB1lhHGZz5i08dxVGzL6eWwuOZ1++5w0yPWMqwzbshgXGoBrcOO D1NQ== 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=M4N+2g/TXezdpdcv4/bn4OggYvT6p5UtnjK72TxzRsA=; b=Ui+7j59wqgoKPXqaITW2xYylf7Nu/elFNpYVhhfVx3+4ZOLnZnPNbO3diIQTaqaGgW cIncIEihwtuOYhQE7Q2utxjT6/hPlHPWSsxIBtup0KFnUH41yW1Y/U+ApVaUOz0pPcho hk9whsMEYgOEnKt0Ba+AxeUfKvvjEWQCtLpDvpzMeRaFQEmEotvoNp0gsP341A/3LDz4 NyIAwb10V6n5YetblQTD9gxvhgcPg/8bI6lus1TdtcD/LjS6pAwnk+Y2ZtmJ14RebXFg /mLhVTXVR8CplCn9V6cOE87USKl8LyaI4CfJIDh57EGjf18bWZODdxR2X8Gm7ScfKOzB YLAA== 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 p8-v6si1334881plk.441.2018.04.27.07.33.54; Fri, 27 Apr 2018 07:34:08 -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 S934922AbeD0Ocv (ORCPT + 99 others); Fri, 27 Apr 2018 10:32:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:55488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934823AbeD0OKV (ORCPT ); Fri, 27 Apr 2018 10:10:21 -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 3483721895; Fri, 27 Apr 2018 14:10:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3483721895 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.16 25/81] strparser: Do not call mod_delayed_work with a timeout of LONG_MAX Date: Fri, 27 Apr 2018 15:58:27 +0200 Message-Id: <20180427135744.623761258@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@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.16-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); }