Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp438946lqp; Mon, 10 Jun 2024 08:32:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBHEalBhWwqJ2BuaHvJJRSi6cs/XqFUwQRQxRmWb2C3h3OR24KWBw0orh8KaZZ5/bpo9keCHaS5bHsqZS46P0Lx/401DwlwjWK4/YVcA== X-Google-Smtp-Source: AGHT+IEUR/gbX5zH207gUQi4aaUpYDxAh/D2jTD5/oJVnl2I9xsGVped7R7qXxyTmcvKkXSKfpS+ X-Received: by 2002:a05:6a00:1808:b0:704:317f:6388 with SMTP id d2e1a72fcca58-704317f98c2mr5616859b3a.31.1718033567536; Mon, 10 Jun 2024 08:32:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718033567; cv=pass; d=google.com; s=arc-20160816; b=YPniQOBwNEwxzxQxk20UUQeypMdZK7LA7v4q7H7GVhmM4G67RoC4oE9FzM+Qb78mbl kTY1d042RbzcPR7C8Q0+5AfJdkQYxb8tuVbo9Q8JUuyF7A0AxBup2MWL0YWmN+z0bFqo 4YP/rAK8TjYChrYf77kL9a16X1/oyPiSo+3TXwi2cS9wYgBAyze8QOFJDLWRXSlFuWMY +Jv/LBdpQgtbZ/5esTG8uPka8i11B0FJ9/yB62hwS/I/NuyMfC1fpMsxRdS0wpINtQTl CMfusjgY+Zf4xquVyrPPXm7OPR2npIHm8z9vU+bW+XgHacQafV9fhzTrNPagY/pf55Dp zTKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=/SaPCGStf3eM3SmnrXLNpJANQ5NA1Y/lEx22p563U5M=; fh=2j3Oez36CcBCTN07T+aWyl4GTfllqM7ESiJI46GjxM8=; b=xNZ37OKvvpERyN3cX8IXxX/T0d1dn6vgcG0NhVHFJOiW/2tVuuEEA4h89EjtEuYTXa XJZE6itmMuy5LUQMLBkCk81nioSA603pitoYy2tOA2wP8Idsmn8pFSDBKOGh/92yFE+b GCfcFSMVs2c+rlfhXyvVrERWkEmiUr5DCnOHxz94kgCABzs7JI7BlxdirusMPsCrbLIg 53aQe5jM/EPfHSwW1ZyZMB6m53KIIyc4a1IajU/SaECVbgBV4SqLxxbZpN76id2Hg4VR qpqk6Mgvv/FTpo0hL+fweBQ24s8qumsJrHEEWomgFHQFhDrmPGrlPkSv3M8dCT/pEAy7 2v0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IMkZiDEd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208482-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208482-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de2895a19fsi4627043a12.589.2024.06.10.08.32.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 08:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208482-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IMkZiDEd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208482-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208482-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D91D0287C11 for ; Mon, 10 Jun 2024 15:28:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BB37147C71; Mon, 10 Jun 2024 15:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IMkZiDEd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 536BC13DDCE; Mon, 10 Jun 2024 15:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718033196; cv=none; b=Ev9iQ/XO+8wjuUgWVI/FZkeUZyXFWbcj9kaR9kzaX5XYXLZ+QqM/b3sFq9tPTF58vFZdylwI9NjtCq5y8/Mju0B77yj2DhmPRjiZG/vjFWaU7DxR1P28QI8xB1QgyQVlwM/pZvjbSiqS44IYqPWcSKKXx4DwbXX0eZG+Zs/Teuk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718033196; c=relaxed/simple; bh=+P//XT9LpP0LIIRJBKW993XarkxuDVFv2zbFBsCkT3Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EVQq8Ttlrae6gOyAPO6HDvGgnWV5KrrPcoN+nWcgHyd0JAT8NkxDV7jOUj4rUSBe4IXnRBz8tDYZLcmEE4V4B3IzNvIFj5ArVZrefrKXPmMOixnmyQjJ4Ay8QIQbSBJvneOJRjI75v4Mk9n0yDh6TzlY5sCobi7nma9RKhjWiog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IMkZiDEd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B7D2C2BBFC; Mon, 10 Jun 2024 15:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718033195; bh=+P//XT9LpP0LIIRJBKW993XarkxuDVFv2zbFBsCkT3Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IMkZiDEd9X+iU0t29dUnCUCFNrscsW0jgsnZumoTV91muoYrYy+pCe20PH8op+qF7 wwd9wLPnuqQcNrqTZiJ8b7Hy08j/nBPXqzHz5tay7KUZ2rSo8mCF/Ai/0eeGysrQV9 p/J2MKg2o4vXLOE9FRSafvwfHV86qRnUV3dZmIj4dlKM3OFVgAnRScqyUhlDNyUsKx xOWcsFYDgY1SOEBTJTxB0P4fer/6KHp4AGGQNW2eqmpD5cM0SRDVdFHaRStBMk+r8/ aRrZkBoEc8Tk8v+qT1ezE1T5CMUpTjP5PmTqRqq44Vn5skzh0ho1bqVP0XVbV/CJky 6F8yCZ4u86EIg== Message-ID: Date: Mon, 10 Jun 2024 09:26:34 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v2] net/ipv6: Fix the RT cache flush via sysctl using a previous delay Content-Language: en-US To: Petr Pavlu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Kui-Feng Lee , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240607112828.30285-1-petr.pavlu@suse.com> From: David Ahern In-Reply-To: <20240607112828.30285-1-petr.pavlu@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/7/24 5:28 AM, Petr Pavlu wrote: > The net.ipv6.route.flush system parameter takes a value which specifies > a delay used during the flush operation for aging exception routes. The > written value is however not used in the currently requested flush and > instead utilized only in the next one. > > A problem is that ipv6_sysctl_rtcache_flush() first reads the old value > of net->ipv6.sysctl.flush_delay into a local delay variable and then > calls proc_dointvec() which actually updates the sysctl based on the > provided input. > > Fix the problem by switching the order of the two operations. > > Fixes: 4990509f19e8 ("[NETNS][IPV6]: Make sysctls route per namespace.") > Signed-off-by: Petr Pavlu > --- > > Changes since v1 [1]: > - Minimize the fix, correct only the order of operations in > ipv6_sysctl_rtcache_flush(). > > [1] https://lore.kernel.org/netdev/20240529135251.4074-1-petr.pavlu@suse.com/ > > net/ipv6/route.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > index f083d9faba6b..952c2bf11709 100644 > --- a/net/ipv6/route.c > +++ b/net/ipv6/route.c > @@ -6343,12 +6343,12 @@ static int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write, > if (!write) > return -EINVAL; > > - net = (struct net *)ctl->extra1; > - delay = net->ipv6.sysctl.flush_delay; > ret = proc_dointvec(ctl, write, buffer, lenp, ppos); > if (ret) > return ret; > > + net = (struct net *)ctl->extra1; > + delay = net->ipv6.sysctl.flush_delay; > fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0); > return 0; > } > > base-commit: 8a92980606e3585d72d510a03b59906e96755b8a Reviewed-by: David Ahern