Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp895555pxb; Wed, 6 Oct 2021 18:21:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYQi6C16TpS5KBjJQsJKc6PDvhaGIJ+/mik2X2b2579HlEsNbm/2GtyDcr8YNKZBp7eydQ X-Received: by 2002:a62:64cf:0:b0:44b:e21f:f1d3 with SMTP id y198-20020a6264cf000000b0044be21ff1d3mr1503791pfb.47.1633569716356; Wed, 06 Oct 2021 18:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633569716; cv=none; d=google.com; s=arc-20160816; b=lctNNSBmCDyiBIGCmU9t5t+CXMnb+88kMKcLXZCKRsugtaDWcCZhEgDL1Ra3z44h3R MlUmSr8wYYCwXs7oakiXb62Tl+JNuZXX0fEuqjUdSNFsfz9gC3OVzexh8sy466fGMiEn WaOYveYoS//njf5VdZ2LuEENkqXEoApGsEdLB7l1tijLqdISsK71DIhRmJStf77k2YnI NLzanvqOAVJKAWFvxQsxlUEEi1NybMZZurRu+zgqabDZNhjkkY7ztsoTz3iEWSW24WIQ 7JDFV1ThX2XS+WM80VxVUxP3FTLGphKmePLFvtyMkajPCZaRVKcTwucmzYR+FZpqR7ra 0atw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=JCP3+/6KDb3OiE2F6/73DcdtnFzbR25XnFV46EjpVJg=; b=M0T/SFgPtP64+/HtxqxKxkGto2HUp9VCHVCA5sjO+4p5RgKPZqkEP0HZVNjsGd31Nv APpD85OtKJxrmvQBBQChS2Ly2Vex9Q8IsW05rUs5sJnQKSsVhwKUAS55J7YeI2u3z+S3 sV7mSfg/NIcSt+eck1VpuSD/Lo7O8NQdHomgmKRC3rc89a5kZ+XlvY4iyTgbE9vCkWlu THS+8rU468z4NAWqWc+XB5n1nXXhcYIsdQd1WhdMaNWwQhfvAV51dODh5ps+zjwgTUbT EsukqVgKR+bBSSm0oqtTV6JFw2GYkTTuTrrlc+jeapMiOSm/g/0l0uCnu8X3yABDhQup WqpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HYAadukX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si13397032pgl.243.2021.10.06.18.21.43; Wed, 06 Oct 2021 18:21:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HYAadukX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232361AbhJGBQg (ORCPT + 99 others); Wed, 6 Oct 2021 21:16:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbhJGBQf (ORCPT ); Wed, 6 Oct 2021 21:16:35 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABEFCC061746; Wed, 6 Oct 2021 18:14:42 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id l16-20020a9d6a90000000b0053b71f7dc83so5466454otq.7; Wed, 06 Oct 2021 18:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=JCP3+/6KDb3OiE2F6/73DcdtnFzbR25XnFV46EjpVJg=; b=HYAadukXmKo/9+UeFo/Z4Dz9/HjxcEA/eTKaE4OjoaLxGIOvt3Tuzu55ThoyBaVeCO do7hy2LnOEyOEJShcDpV3i6k+j/FQ2yrzfJ4Yev+7BuUdl6jiZaQKdb7r2xpmIK8R2mq bi4TDfvApcaxEeS+CU2YOpaZ51X9maRF9ut1infVa5GLOI95i9x8RAUvjbvQYGyNZ6aq 6SO+uMX/J6hqk5GZDBcbcYi+OzBAgRb0LKex5fTU11tCQi12rtZPoDblgej2sYu4nmm7 8mbMc3Eyoqsb6wNAaQaJFszIbo5W4nLm76dYpAGURQqZibMdndsVXCWM9AuAsGaWpBbX rJAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JCP3+/6KDb3OiE2F6/73DcdtnFzbR25XnFV46EjpVJg=; b=qXNZYNeHyGYDFeFAr0X3hsM7oLBAwWdQMCLTSXdfpv60oqRzf9CYBdbYm3lrGEuT9q 7vq7SeJvtZOQXnCko5zJl4N0twPFG8/Pklz81ReZ/aKGBnYzKSP9EScbU5eKh0kPC0nj r/pI3hkzL7cMZ0uXq4WwYH9wr85ubeOjU2sZlBB2e/uJ/iras7hBJHt+4h+c0geD8BLy WqXNk2ZHaIVD+7ai6e9KmCOox5prPMP0LoL/zL8dz74GiBRaap7ZSRnRBKdBeb/jAFwj W7iDVesjyHf4tkk1CU2gTn07hwff9atoNKEjrc9iP6J2C0aS5T1oRJ0a4CKgJJhYDv76 GT8g== X-Gm-Message-State: AOAM5315LDtJVHPSVNYBSUomLzqc9T6ild6AKOKe+SPViFvSlyxEz25G v7sk/qh0NPvgKOATXz46EqI8mtvkuMkI0w== X-Received: by 2002:a9d:17c5:: with SMTP id j63mr1289599otj.191.1633569281949; Wed, 06 Oct 2021 18:14:41 -0700 (PDT) Received: from Davids-MacBook-Pro.local ([8.48.134.30]) by smtp.googlemail.com with ESMTPSA id p18sm4635010otk.7.2021.10.06.18.14.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Oct 2021 18:14:41 -0700 (PDT) Subject: Re: [PATCH] tcp: md5: Fix overlap between vrf and non-vrf keys To: Leonard Crestez , Eric Dumazet , David Ahern Cc: "David S. Miller" , Hideaki YOSHIFUJI , Jakub Kicinski , Martin KaFai Lau , Kuniyuki Iwashima , Yonghong Song , Alexander Duyck , Florian Westphal , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <3d8387d499f053dba5cd9184c0f7b8445c4470c6.1633542093.git.cdleonard@gmail.com> From: David Ahern Message-ID: <209548b5-27d2-2059-f2e9-2148f5a0291b@gmail.com> Date: Wed, 6 Oct 2021 19:14:39 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <3d8387d499f053dba5cd9184c0f7b8445c4470c6.1633542093.git.cdleonard@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/6/21 11:48 AM, Leonard Crestez wrote: > @@ -1103,11 +1116,11 @@ static struct tcp_md5sig_key *tcp_md5_do_lookup_exact(const struct sock *sk, > #endif > hlist_for_each_entry_rcu(key, &md5sig->head, node, > lockdep_sock_is_held(sk)) { > if (key->family != family) > continue; > - if (key->l3index && key->l3index != l3index) > + if (key->l3index != l3index) That seems like the bug fix there. The L3 reference needs to match for new key and existing key. I think the same change is needed in __tcp_md5_do_lookup. > continue; > if (!memcmp(&key->addr, addr, size) && > key->prefixlen == prefixlen) > return key; > } > > base-commit: 9cbfc51af026f5b721a1b36cf622ada591b3c5de >