Received: by 10.223.164.202 with SMTP id h10csp2148724wrb; Mon, 27 Nov 2017 12:37:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMaa2+6EHRq/VrRLV9z+b2wACFIfOcZZGAV2j3nvqbkaRhUjvDSzqrTDf/UTGY3PzAn/4T2a X-Received: by 10.159.244.131 with SMTP id y3mr40533518plr.244.1511815030518; Mon, 27 Nov 2017 12:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511815030; cv=none; d=google.com; s=arc-20160816; b=fdukSvV1Qxq/8dLqYgT1gXdjojKpJQUmVZyd1erpZRRsEzyftanI8EN1JIkx/XzdJm y6FR3SpLqB2BeZso7jMYghpEPeplnT/AsIk/iMhj/se4ncUoLtYTbFD8+DHsz16ZAnAd DOHUbZoTBADfRDihe66SmKdrzlBsIdYAWd8qdyT78GfTjl9+yjBB1nOH6pZpMNgsvRke oMFXJgfaCAcaHoxFL21jZfa/xFrmsycYnBAgIBEAnAc9JEYb2nq5LjlOHkYHFeQl61o8 TE00yJtZA04w9MVKvZj/M3yZq8PzlHpDQ/gzOEbgihlDUoie9I1N6J24OQbHJOwKUWke w6fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :user-agent:in-reply-to:references:subject:cc:to:from:message-id :date:arc-authentication-results; bh=YoLZtoSC89LLIGRBU3ByibJ5F5DlnKkgxoRbrXxYskA=; b=iAq7ajBVuxkAZLfoEkYg7bPENL5r3PsPbSO+SogDg9R1n1fRBOf9DLemYFpZl6dVS2 PNSDkOCmCq5f2XaA5MkCd0uWsALkLPS9erwbxikOUiDbLU45uOpxOp+kAQHrBUL8xTBt bt/p5B+d6bS4HxKNyYZj1NwMFia+4WBsZErLWf3toZPPA7jCqIc59n9Dtqh5XCKEE9br Wl3UkLx3eFDRxGrzVT58GxYGzTZULdMMCdDLn80+ihLzo1j64WAV4llGOfuBqAsZaCqC RIn9uyYfXoKiSdDhfeQTUg+HD1j/JPzeodGGVi83AkV7d85kY8F1QKVFHHZrOlwzOMCy Jn3A== 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 a12si23891933pfl.63.2017.11.27.12.36.58; Mon, 27 Nov 2017 12:37:10 -0800 (PST) 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 S1753454AbdK0UgI (ORCPT + 78 others); Mon, 27 Nov 2017 15:36:08 -0500 Received: from gateway36.websitewelcome.com ([192.185.195.25]:26191 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297AbdK0UgG (ORCPT ); Mon, 27 Nov 2017 15:36:06 -0500 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 1BD35401D309B for ; Mon, 27 Nov 2017 14:36:06 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id JQ8Mep7UVDL8rJQ8Mea31E; Mon, 27 Nov 2017 14:36:06 -0600 Received: from gator4166.hostgator.com ([108.167.133.22]:24558) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1eJQ8L-000ppm-Qg; Mon, 27 Nov 2017 14:36:05 -0600 Received: from 189.145.38.204 ([189.145.38.204]) by gator4166.hostgator.com (Horde Framework) with HTTPS; Mon, 27 Nov 2017 14:36:05 -0600 Date: Mon, 27 Nov 2017 14:36:05 -0600 Message-ID: <20171127143605.Horde.e1mO3GN28r_3LfsfiZdmeqJ@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: David Howells Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rxrpc: sendmsg: Fix variable overwrite in rxrpc_queue_packet References: <20171127180207.GA25428@embeddedor.com> <17004.1511808959@warthog.procyon.org.uk> In-Reply-To: <17004.1511808959@warthog.procyon.org.uk> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Source-L: Yes X-Exim-ID: 1eJQ8L-000ppm-Qg X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:24558 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 1 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, Quoting David Howells : > Gustavo A. R. Silva wrote: > >> Value assigned to variable resend_at is overwritten before it can be used. >> >> Fix this by removing the value overwrite as it seems that this is a >> leftover code. > > NAK. Your fix will actually cause the code to break. > > The resend_at value used for the timer must be based on the current time > (ie. jiffies in this case), so we can't simply remove that line as the > previously calculated resend_at value is a duration, not a time. > > What you need to do is to instead modify the line you wanted to remove to add > 'now' to the previously-computed value. > You mean something like the following? --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -233,7 +233,7 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call, if (resend_at < 1) resend_at = 1; - resend_at = now + rxrpc_resend_timeout; + resend_at += now; WRITE_ONCE(call->resend_at, resend_at); rxrpc_reduce_call_timer(call, resend_at, now, rxrpc_timer_set_for_send); Thanks -- Gustavo A. R. Silva From 1585246761033048233@xxx Mon Nov 27 18:58:41 +0000 2017 X-GM-THRID: 1585244557315777648 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread