Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4764379rdh; Wed, 29 Nov 2023 09:59:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IELcXeoXwrZovM2jR+Wfh7NC6jgBjV8WROK+1q0GNYSFjw1AqWCOUwRl7r+s2HSHriRqF98 X-Received: by 2002:a17:903:183:b0:1cf:66d5:70ac with SMTP id z3-20020a170903018300b001cf66d570acmr21969222plg.50.1701280786552; Wed, 29 Nov 2023 09:59:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701280786; cv=none; d=google.com; s=arc-20160816; b=0WXsRQmP1nqcO4H9+kGDc1CBv05DhlA5PV5L6tobRf5/ve0hojJaAEj542FX0JwDlz h9EqVQbuysZ+2j/rOnzZXiw0opSE2aM/U5DmbHRZcbl6gpKEqQLmNHdY6XY1zLG4zzDw PLA+hI0CxecaaWU+vIFDQxeg2f09hgB6wkcC2PVzHIWQI6P0SiS5WZ+VPSmv+X7wXURd jWXoRI5blqrgFccfQWuaC92Fzi71H5Se/ZnK4STYswjGrzY7AtvT0Zke54u4vWjfb+Zt HnWW+mziZL20NiZ9crucEkWsEGmJoaf2BVoi8cpDn2vv4NvMyQaiVPiOOc7pZuXirIaD vx/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=z/jSiKm5mFkB2ZNc7YYsPmOJjp6MJIABZm4Gv8dPzkk=; fh=X1lxrGLA7V3PBg9NtHG1M9vtBdBLI2mDk4lzNRfgcS0=; b=r6zddWNkMxDt4ZQaSaXGMXiP0F6lLWngtqAgWLoJWMjwZodpNIw/HI2YnB/XpRaHjw 49kXVNbWksNYAyxEvo2z2/wayutujB7cYClWI5M+Go1k5RHHMwaWV5ICxmPq0eDyYfz3 gDpUqy9gCS5zJLNMwpVvibg71AIkN3j569/G+hYK2DfaCl0T22kCrt0pBawxZ4IOHH+2 i/m3hnh7FmCImRKEEcuBndfEHWYzAvWdAiMT6i+C9V21A3JrU/lGbV/gNCA5twryu/q3 RF9sG+cU2s+N14jYu5DOQ5omGNtV5auZeVkwRBRNRSzO8ZL+iXh6fgt00sxLy5/4xJKU DEIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="PH46EBt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id jc11-20020a17090325cb00b001c9cc243868si13856379plb.618.2023.11.29.09.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:59:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="PH46EBt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3180180ACC57; Wed, 29 Nov 2023 09:59:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbjK2R72 (ORCPT + 99 others); Wed, 29 Nov 2023 12:59:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjK2R71 (ORCPT ); Wed, 29 Nov 2023 12:59:27 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C1595 for ; Wed, 29 Nov 2023 09:59:33 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-548c6efc020so554a12.0 for ; Wed, 29 Nov 2023 09:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701280772; x=1701885572; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=z/jSiKm5mFkB2ZNc7YYsPmOJjp6MJIABZm4Gv8dPzkk=; b=PH46EBt/ap/QWNe506pDAOitZBC8BKClHJLixqd45kpMk+oeWEcx3AXcfvfFjxRJC+ ptbVAWs5mI+ugyVbBm9ILXXTbFbSx2NF6OP5WxFWSpuj+tsZopqj6sYB3qdNIJeZwtJr Z1gLUAQYms0/WClHZQZzdt2L5+r0vLt+hac/iwJrYD1YZbumJhSOewhyADdHfcwVtLbV eHfz5lvUSVjvWmWZiIfzda6g1dSPK7s7odMzF36gJvPvU1om9RqfuyChZdnnJnisSGp+ rW76K2BjwAAWsfCq+eYQITl5P5h65pGrZEzDO786+jmdfhhIwhtBEyv5RH0Ve9vduH02 iwUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701280772; x=1701885572; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z/jSiKm5mFkB2ZNc7YYsPmOJjp6MJIABZm4Gv8dPzkk=; b=X4gJUE/xvISqcztOgT8C6TbEmdOC3IiVDLsZXcaZ72qjVsEqeb6vREJNcze9Vvrwo/ 5CQ84e0H2whufbpsbOKKnaKHYbV8BekI8cTyaJapmPkP3xkLySSamxDGNNaxYVsKYMDJ KIN8LPIq3TK8Pzf2kTo/Odbczc+RDuLO0jfKmuP2oWd9IlpbLOTiyTXmnEdm1ER4wV5k 5P/MWA1ugCCcnr4OdPXzJgc6INSIMuv2FSo9F4ze2NT7pzmMPRrSZ1g7yjiZTVr/Czfv hNpWZagJfspReOvMDkPeC6clsKncKqn3OKuiQuCQOmutTxbA8gufVo3KPIx2Tg90tK7f /U3Q== X-Gm-Message-State: AOJu0YxzhS80bf9bY/q+9giz+7t2BhLVLkMsUCPKRxtcLqrQrArSif0Q C0exjzP+qnWfKWWXVXkKR51tAcQM0aiYz6bsxhd/Ng== X-Received: by 2002:a05:6402:430e:b0:54b:67da:b2f with SMTP id m14-20020a056402430e00b0054b67da0b2fmr632179edc.7.1701280771486; Wed, 29 Nov 2023 09:59:31 -0800 (PST) MIME-Version: 1.0 References: <20231129165721.337302-1-dima@arista.com> <20231129165721.337302-6-dima@arista.com> In-Reply-To: <20231129165721.337302-6-dima@arista.com> From: Eric Dumazet Date: Wed, 29 Nov 2023 18:59:20 +0100 Message-ID: Subject: Re: [PATCH v4 5/7] net/tcp: Don't add key with non-matching VRF on connected sockets To: Dmitry Safonov Cc: David Ahern , Paolo Abeni , Jakub Kicinski , "David S. Miller" , linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com>, Francesco Ruggeri , Salam Noureddine , Simon Horman , netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 09:59:44 -0800 (PST) On Wed, Nov 29, 2023 at 5:57=E2=80=AFPM Dmitry Safonov wr= ote: > > If the connection was established, don't allow adding TCP-AO keys that > don't match the peer. Currently, there are checks for ip-address > matching, but L3 index check is missing. Add it to restrict userspace > shooting itself somewhere. > > Yet, nothing restricts the CAP_NET_RAW user from trying to shoot > themselves by performing setsockopt(SO_BINDTODEVICE) or > setsockopt(SO_BINDTOIFINDEX) over an established TCP-AO connection. > So, this is just "minimum effort" to potentially save someone's > debugging time, rather than a full restriction on doing weird things. > > Fixes: 248411b8cb89 ("net/tcp: Wire up l3index to TCP-AO") > Signed-off-by: Dmitry Safonov Reviewed-by: Eric Dumazet