Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp671797rdb; Thu, 8 Feb 2024 18:51:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcrzsQVIiEl6ePaz3rA6wRriNFLjbSM8ycfdMebrTMRCruf1E19WlpzEF2P8pylEqOg490 X-Received: by 2002:ac2:544a:0:b0:511:79db:e6d7 with SMTP id d10-20020ac2544a000000b0051179dbe6d7mr12369lfn.2.1707447065482; Thu, 08 Feb 2024 18:51:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707447065; cv=pass; d=google.com; s=arc-20160816; b=I/OiN0yPE9w2+0RjSF8VvwoqyBPODgA/w1ohZ2O8d9W+OQU8CMozzu2hwy16qFawiK 8yI3EM0GuTEXLSNJayD8kfuWFCM4ZN8587MUV4DQ4FHF4LgYLBlbSXPzVfMNvvZM23A5 lzUVI6oi5sS3XdBQQLoqQ4EXh8bfcGpl0+/Unwq8AeFs1W/FIUwp3ZqQjJ2FACbj06ZT V90vV46Iu5YAuB/0I9hBUeFgGm6bHAVdiUJf+19F1CJ1lIBYuM68Eq971CT3QprgMC2k kvPZ7d6872B8Sy6gvnZYeW0QpQrKS+/HnKyluy3hElIF+P6VR03rtbw5wGjXjEdv4Jbm PR8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nj9opqbQ5/AcFYVCj/vP5eercGB3ykX399OJ84biNsE=; fh=LNyNVKaiEY6rSkZ0JxxRAu+ZscowdlVu5xtYB2Q+PqA=; b=zEN+cnArcuZQg8OFIDqNKJCfGKKbx6kQkC8uEdMTnCRZ2W43QwVBdVTytCSkQ4DMiv /0GnX4a4gRDV05IRBtBjoAjAZMso33v+UixZnO5cWexB0BsgbgLSug1h1tSh2F5Xctww rrqfik0EagtsE2Ngd61gY8Hf8HtzGALvSAvC+U8OfsQBjJ8eWjm3z8C4TVBtZZyqb5kn P6+5kOKW0dN3llmwqHTTwtk3FpPM5NY4eCyGBUv/cJvWJFhj8S434YVmnooocr4FIK6c RTZlBjiEdy95Evzn3DZ5khmGnBMomAmPSJNWp8gPV1t9oV2CH5qpRwaD3pdXFCE7ZAv3 5fog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hPSh6adM; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-58948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCUsJYFBBS1qq23BDDVeQwj0S7u/MXTBOy5vfu4l2Xsl+t3WUX7DyJzHu3Gr2NtigqEcu9IGLXeO6zn9WySZLUTYK5WxfDXmm4RzpuaojA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a10-20020a170906684a00b00a3b938f357asi312895ejs.98.2024.02.08.18.51.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 18:51:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hPSh6adM; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-58948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 398C51F21E21 for ; Fri, 9 Feb 2024 02:51:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 799E61879; Fri, 9 Feb 2024 02:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hPSh6adM" Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A6F35663; Fri, 9 Feb 2024 02:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707447053; cv=none; b=IaFVUCOSVNv5bQGtSBRpEw28Gkc/FWArorK14JP6vjWVFiMjY3VER9hC99VumYeph6+G4HLnLw3nEcHan5ZyL6Z3qLm6bMBhvyNtArfoBRHWVemRPKVsCbUZx/SMIBkxVrc4fb5MUskTqEJLgYfLda2UT3nXoViDGWfK46/HAhU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707447053; c=relaxed/simple; bh=7afYQWsKUrAcpAeznLizU1hFIZ9xJ5fDSzGextpy+8c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I7nxmZgt8bukDocjlfMUwIFX5kxy4FEJzJO2iS0sfeIYdqWED1gu86XANaYCyeqwjC5A8/IYUhj7gz70eaJf7+tnlGaBsDtVO/fWfruXqo2VWdSXdj/q9cc/xCIuiIIqTY1A1S+X5ZuF6Umai2lp2ZXqWiaDZMHGamUmjB77vMc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hPSh6adM; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-68009cb4669so2265676d6.1; Thu, 08 Feb 2024 18:50:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707447051; x=1708051851; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nj9opqbQ5/AcFYVCj/vP5eercGB3ykX399OJ84biNsE=; b=hPSh6adMMw8Qio8TJYQ0ehXbSTBcDfsILTDctSLk9WxjlyoGnvyhiWGD84mHjQti5D oLW/4JiKX3/+HsTiJEKWRRqd1Fw4DcD7iAHFdS/HFbD7C5HDiDy7CN4nA9z82ODZfToh LzztFw189W48KXchlaooJcPwB5JKVEl+p+Kh6aBC/DnmM7zJChucc4sv7iwmIKeJ6Zv0 p5Q9U25q3o/auQ0oQe6tikfHIt9Gl3KglQa7kbWIW+a/wOxcYZUp4HPxEIaelZEMRusc iKPrNIPwOZqiumZXwwt+jMp+5th107ZsD0KZOpLyD76enA28U5bQ4zNh/CU5xwkK9jw9 +3vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707447051; x=1708051851; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nj9opqbQ5/AcFYVCj/vP5eercGB3ykX399OJ84biNsE=; b=ukVr9GLSkRzTtTGTESPaId/CXwglS8hYNN0KGr+wvAsZg4Hl9QcSm1JJBSXRL+PshV 7jWG0NftwXJFzg41wSyvCkyY3xRLP6GCQbnosDzBzw9B0YAeXcLxzttdFQaM7we/LjcZ w6kpo0UR5yIZA4aFXJE1kasJR6WpWLzkrCmCsGczF+otou4sRFZuYcaXAxo5rH3MKOrJ oIwJa2cLfX4gJAAbk6Xm7KfPvsDrIxxfba/zD5Tqr8zagZmyaovSiS2FO/2z3KP69Y7z y6ipPpUSO9IuDlBd1Gj3Sw9G/Cf/+zZhNOfhYhdz8ml60tfkVc8C5TUGday4GXo11qSl IRKA== X-Gm-Message-State: AOJu0YyldLR2d5xrHmCFoBWbKOUu1Ij0sLyt8OaXi+pEdxyrHKaMurb+ ShY7kfOVuU3TgBldwOBCU00n88TRQpPcQO845GEGCUpNip5Jw+tc X-Received: by 2002:a0c:aa1b:0:b0:68c:c249:4c47 with SMTP id d27-20020a0caa1b000000b0068cc2494c47mr309388qvb.28.1707447050935; Thu, 08 Feb 2024 18:50:50 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUCIynohXxMMivTiDa/ehKzYq04RxDtgYQ5miiPimefr/7rpfEkzDi+j/XRJyXugl4AHYteurMru3C+cEwE/G52cmFX0FtYQ7OKLjzn Received: from localhost ([2601:8c:502:14f0:acdd:1182:de4a:7f88]) by smtp.gmail.com with ESMTPSA id lr9-20020a0562145bc900b0068cd399760fsm163333qvb.61.2024.02.08.18.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 18:50:50 -0800 (PST) Date: Thu, 8 Feb 2024 16:50:49 -0500 From: Oliver Crumrine To: Stanislav Fomichev Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: remove check before __cgroup_bpf_run_filter_skb Message-ID: <3htegzrugq4xwlizizsaku6g2pzwhndcnxxxmji4fvblisiuro@icvcsa3mky3w> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 08, 2024 at 04:43:06PM -0800, Stanislav Fomichev wrote: > The check is here to make sure we only run this hook on non-req sockets. > Dropping it would mean we'd be running the hook on the listeners > instead. I don't think we want that. You are correct that we don't want to run the code on listeners. However the check for that is in the function this macro calls, __cgroup_bpf_run_filter_skb (the check is on line 1367 of kernel/bpf/cgroup.c, for 6.8.0-rc3). The check doesn't need to be done twice, so it can be removed in this macro.