Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796033305; b=kdgtjaXomtU8yi/2xh0EjRgff8+f8IEigSp/PeFiJ5CHiebuTLgjVCwT0RYk5kqAcC8K Oq8l6Uz4AywV3xAtookQRu05r4A/9Fxtg1dcPMdptzMoR3+aqlGOWRhFxMJB/3tLj2FF3 /Y65ubAEppdGtQMVSzcFQOmlNcWBG/NXoXxjERYt3B98W9ooHWN9z/xtlDxQG7Z7sVdM3 hDEQvi6mAwAfdt1C8y/bqvmaEbGMjgv7+X3bEPycxG6QUd3rtixS4vI1t8ibQWHFxOxcb e0ahFJGc6nuTBWB2CHi9v9ld3AHP88ZzeFMsmtsfp6bqTf2SZVGR/XSYnv/arrEIp4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796033305; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Reply-To:Subject:To:Cc: References:From:Content-Language:Organization:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=NcdEKVKDPgxxVVqbw65DamAEw5HVFR1VKpERYWSv1yQ=; b=BHzS2ZP+aA4xyNCrkAO5oBuW3shh2o31nKBThtZr3ktt0H/Kc/VCXLwz0GodBT9gpVgR VrUourCJglyNTdmHakq9XuJUE4A/J7jxDN7K+PXAZUtJ4yOSajqY6LVdGrynoJh627gIc AEi1vtJxNZE8c5L3irWK2fxuZrqUBPVr1SIv3BU2Ckvhjg9Jw7y5DxEhAGfNDR7NKWFKC NiB9Hey8PNs838QbgUe7XvYxUflhbfb4ye/yFaXHP3TJR31EE2q3L5EDJK3ze1fPpUmQR wcFYyuMFGxDAQfWvI1WRj+Wf78qS1K1buMa/a2bdvsv/yywXfsrP1YDxK4mueZMbqjA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=6wind.com; spf=pass smtp.mailfrom=6wind.com; dkim=pass header.d=6wind.com header.i=@6wind.com header.a=rsa-sha256 header.s=google header.b=TKNzCwjy; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC441606A327 for ; Mon, 30 Nov 2026 10:08:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EC441606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=6wind.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=6wind.com header.i=@6wind.com header.a=rsa-sha256 header.s=google header.b=TKNzCwjy Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4bb76bb36c7so8411455e9.3 for ; Mon, 30 Nov 2026 02:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1796033303; x=1796638103; darn=lists.linux.dev; h=content-transfer-encoding:content-type:in-reply-to:organization :content-language:from:references:cc:to:subject:reply-to:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to:content-type; bh=NcdEKVKDPgxxVVqbw65DamAEw5HVFR1VKpERYWSv1yQ=; b=TKNzCwjydmYpp1v1aWte7983URz8gddOMuawiSL4jaQmdAk33v+GZMrRWt2w+M4AxI eT0Sv7AKZ0h9EwZ+sTRdNocpeBVanA/mnVFMuPyslUhsveVzWysEHYRFAeXvTQjf85iu vgry26DqthdaAsfxGaZTOQIgxWpR2Ca5groMXo4u/7WaLrZEOsZHtVQrhkH4fV+jbvjW PRt2F71xf56AEWBzthFu0UV3j4ecROLKn38Kg3WXuRljNFMgX3jWC4XQt/zNSCYwl0H5 cKo13YBb6eq+aUGs8AAfODyD0I4J2QyX2zGBjim4VyhozKGJTuoiM3frcUqy9owkMAEN 75PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796033303; x=1796638103; h=content-transfer-encoding:content-type:in-reply-to:organization :content-language:from:references:cc:to:subject:reply-to:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=NcdEKVKDPgxxVVqbw65DamAEw5HVFR1VKpERYWSv1yQ=; b=1pXavgIcHhv2IE77Ygr7KkEG+bcxzf4yGGZTZfbMMdJFK8a61fdZUNUN1syQO/GYej jibMXrsI1WSjJacfGG02E6pbFqi2A7rmyv1N/a+x+94ei62sX08Qh38r7dImCPy21wBA yN71prm16PRheLODEORB3E9KUBrxKLUFdoTRv436tkXEfHw+OTTAhryl0SIQq3aF9VXB KUbErASzCE9HqYZG1iq+FTkYui9osgYZRp6gh5as4knZ/hiQaEydYyqVdIJ92pp/UW5m OgrAWQ0cg1ZA4bgsKbJffnTcn5B/mL4aXBe0UMj5NdptJDX2Z4bwtE6zfEcY3C5MyG3m lzqw== X-Forwarded-Encrypted: i=1; AL+hErHmIydI+rSmhPJy+w1HjHnLCzuMOtDHp7AQsNqbYapyEq3V/YZLfXvj09VUD37OJpD5eO7euA==@lists.linux.dev X-Gm-Message-State: APuU4Z/idhfC5zd2q2bRVBqUPGjsQ5JfGmIckJJ8pIOXgEIyyr8s+Va6 ctWPYiXa+DMVeG1QZB6LsfAENNgrVYbeUTxVH6WR1vbJruJVJMgTNtYI7KLv+HhVZ2Y= X-Gm-Gg: AZFdTZe+4nqHfnecCh6wvBkNL1vRNLPWBN1gjDXChdEoxr580G3zSMZurMyoc7TPEsv uJxx8EVJ7A4heYrqv+MmMjzvyxvIv/kNa1ExrnyYraUhmf8zuWnfHaHoHvwYPyokp3F5K0Yiijh 0fGGCN9kGxpTWRYXWNfUL0PXULOu39c/BoO+9P0ozuFvzmRkh2oDiUhBUvHMaA6z55g70k9WLw8 B44loZhvUtnJY1O8ile6CdwHfRz9qNhJFaYZhqQP9NnYWdGCIo0dsbq6M0gsiHkbTR2rSVSkNU1 uMOfKiGZgyqlmGBug9eTDf0/Qh/13jInDXqa9BVODfU2NpAtj9hlCLTXIp3UTpqdUlpmhcXudB9 8MMESn2MAQ1SH/5ILMshT6mOZUAvJxuP9i29EDJasUeUcy6BZk5v5cwxB6fgHdiKwyHWzOfemhv 38buPDbrGLL/qC/K0TDQcISN6to4SMacQ9yZnrIYLKtqpj+OTAGr9aNxWXqDBDmMGqa6fr/Jl9p nlKoX8R+uC8yeFEyis7Ert0btVetleFtTZoTeTamlYfnBc0prhk5pYt6mH+cE4VfMUERqh1gi3+ Md2osO6jA/Ea+U2GWvPaCBDGNGH9ej8xyxyRlDDV9oVJfBaWXVdoU02M4SjdtloRJrdSSgqeqLx 7XyiWLw== X-Received: by 2002:a05:600c:1113:b0:4bb:a9f6:8bbe with SMTP id 5b1f17b1804b1-4bba9f68bc2mr201581195e9.0.1796033303189; Mon, 30 Nov 2026 02:08:23 -0800 (PST) Received: from ?IPV6:2a01:e0a:ab7:2110:6a1d:efff:fe52:1959? ([2a01:e0a:ab7:2110:6a1d:efff:fe52:1959]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb8533579csm782108585e9.2.2026.11.30.02.08.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 02:08:22 -0800 (PST) Message-ID: <2027ff78-c342-4ab2-a289-c343f0c4a457@6wind.com> Date: Mon, 30 Nov 2026 11:08:21 +0100 X-Mailing-List: ipsec@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH ipsec v2 1/2] xfrm: advance the route generation when policies are removed To: Ralf Lici , Steffen Klassert , Herbert Xu Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Simon Horman , Shuah Khan , netdev@vger.kernel.org, ipsec@lists.linux.dev, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <3c91d1fc49e074fea1e87a7fdb8d4157fc42b342.1795797791.git.ralf@mandelbit.com> From: Nicolas Dichtel Content-Language: en-US Organization: 6WIND In-Reply-To: <3c91d1fc49e074fea1e87a7fdb8d4157fc42b342.1795797791.git.ralf@mandelbit.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le 27/11/2026 à 17:48, Ralf Lici a écrit :> Only xfrm_policy_insert and xfrm_set_default advance the IPv4 and IPv6 > route generations. Deleting, flushing or expiring a policy does not, so > a route that a socket cached while an allow policy without templates > matched its flow keeps validating after that policy is removed, and the > socket keeps sending in plaintext although a policy requiring IPsec now > matches. xfrm_policy_insert also advances the generation before > unlinking the policy that the new one replaces, which can still be > matched until then, since the new policy can be linked behind it. > > Advance the generation once a policy is unlinked by a delete or by its > expiry, once after all policies are unlinked by a flush, and after the > replaced policy is unlinked by an insert. Socket policies only apply to > their own socket and are left out. > > Fixes: ee8372dd1989 ("xfrm: invalidate dst on policy insertion/deletion") > Signed-off-by: Ralf Lici Reviewed-by: Nicolas Dichtel