Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp792468rdb; Tue, 23 Jan 2024 15:41:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfeIxopIfc7u7T3OWWEJNw55C3TJCc1N5ugLecODPBkgyL+gCOmOhf9huHGYwbkCZ/6Ufa X-Received: by 2002:a17:90b:3106:b0:290:80a3:f810 with SMTP id gc6-20020a17090b310600b0029080a3f810mr428574pjb.40.1706053316594; Tue, 23 Jan 2024 15:41:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706053316; cv=pass; d=google.com; s=arc-20160816; b=X94mCDJcgFRErqxzT/d/BH0f+4Z8kwHeeI+X0nM14MW3M7T7DE+NKdj835641ZYmRc 9e+UvqotxgKDXpTtwxm0yYvdAj/ZVzdy4W2FdprCtp5KJR/73j/GzDWiQJmNDsVg+R5G nZzGcUldFi2xi+N+qUgMKr55l8mpHqwhz4Th/BnZ1cMVCJ4x5y71AQi5VhgErjWK54SG rj0S9UIwo/JjGIdRqQzaveXASDZJ8ZjZAHzINlcFCQTzKi6HT3tbQRMayvvUGQv/9c56 isVue7JzHZS/+U8NLL1G6/jXgYuAtaoSmBsEA3ifhXOdcP3O9CKgbs63CBhFq6q5l6LY chxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:date:message-id:from:subject :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=2Rr7AGgk5Yg5d8KvyM7RyoONTLCUoDIpkSMm8XMPNRE=; fh=0UcYvB/pacd/tboIj7JnS6WoPr7hW//enW8DJdCIZ5c=; b=qHOuHANQqdRH/PrNEH7mguaTyrAM5o5cjidjnUCBIQzEX8zeaLw1h821K8yypio/n1 Du7mVhNGJ/UpBB/aKvAUaeosFHQqRLznpEP6+nKF24+pqbyNOQBBHZngkIOYzGmvYey1 roocf8PlwoMRFvS59g0Ci/uNjQQLhAtoyu5g76JHhdF7lkubZflBKGGUcyODd9h2jdc9 QrOQyLbZCtxVo54yuxGKYs22ZGBH6qyRBRyuQD+NrdYnkcZm75sEjE/6tahz2Y6MSVNp o1RycElKm1Yn6gGsQ1VY6x83fKNBt7ekpYiX/epRtDtNTiFRe/A1bBFMX318+NMHnhPR 0nSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EJzChJs3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-36191-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36191-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q7-20020a17090a2dc700b002907e7d45bdsi5643230pjm.61.2024.01.23.15.41.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 15:41:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36191-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EJzChJs3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-36191-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36191-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 32266B27D7E for ; Tue, 23 Jan 2024 23:41:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 723DC54279; Tue, 23 Jan 2024 23:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EJzChJs3" 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 957A94F5F3; Tue, 23 Jan 2024 23:40:50 +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=1706053250; cv=none; b=k8tc1ERw55CmLFEwiM3bKV64jD5wDcR2l4u7YRRdDn6SwTyUdFD9/nwwpXRGEogQZdhM/ofQzGHNfuVEcwft9B3u5qIYy1TxNLSinNiiotSxz2BrtViGVXcKZWKbDC8RU5HiXvUt4Ko/ApWSvr88qcnNNCADMXX2XLTf6kSNhc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706053250; c=relaxed/simple; bh=J6rnNUzVj1P2Qg/1GF111rxMutxfmlksq0mYZS2yDjE=; h=Content-Type:MIME-Version:Subject:From:Message-Id:Date:References: In-Reply-To:To:Cc; b=OEUsc8paSxPnZS45ZmjyqngKoB9XE4vzuPMd/GwnUanSWG8tsAi9+K1+BGDTcl9SmAVLVwORTEiZk/D+GjRsGoI0XeuR+FUt6s1Luir16iwuMccB3ddcznUuoxhwCUpF6MGkH1k0vCCqAyDDn5NkBfY5688ow4b1G9dmqsIkhpM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EJzChJs3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 2FFE0C433A6; Tue, 23 Jan 2024 23:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706053250; bh=J6rnNUzVj1P2Qg/1GF111rxMutxfmlksq0mYZS2yDjE=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=EJzChJs3r2a0rWoG85Zs3Vj8Mh3yBc+jcmhfD9iXGVYSCT9GsOuizEx9emv6+UrOq h2wzJ5mZGQGHBhg5mXKkoAM08RBzRM2WeXA6COZ0+JmIZXJhqZ9U8AVvQFMNb/g8d0 HJf177y+JHmllKMXUQX2SuCb48pHDLKdUFFGl3GwieQc3LBU0/VtJYLE8fErOyDZXR 4j8/3q5/0Y5kvRY73BQhQGOSQH5pVl0ROEP3SmoJ+klAzIX1UCL99oy15sL0bQ2BLT F8Wgx71uYSIC88l1M0RRCvzFFUh27FpkUGKhjsKPzg2xFWrJ+veIMVGx9S1CXbqZRO nn0LbYJkemJrw== Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (localhost.localdomain [127.0.0.1]) by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id 1894DDFF767; Tue, 23 Jan 2024 23:40:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] bpf: Refactor ptr alu checking rules to allow alu explicitly From: patchwork-bot+netdevbpf@kernel.org Message-Id: <170605325009.25186.130330660193751446.git-patchwork-notify@kernel.org> Date: Tue, 23 Jan 2024 23:40:50 +0000 References: <20240117094012.36798-1-sunhao.th@gmail.com> In-Reply-To: <20240117094012.36798-1-sunhao.th@gmail.com> To: Hao Sun Cc: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net, eddyz87@gmail.com, linux-kernel@vger.kernel.org Hello: This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov : On Wed, 17 Jan 2024 10:40:12 +0100 you wrote: > Current checking rules are structured to disallow alu on particular ptr > types explicitly, so default cases are allowed implicitly. This may lead > to newly added ptr types being allowed unexpectedly. So restruture it to > allow alu explicitly. The tradeoff is mainly a bit more cases added in > the switch. The following table from Eduard summarizes the rules: > > | Pointer type | Arithmetics allowed | > |---------------------+---------------------| > | PTR_TO_CTX | yes | > | CONST_PTR_TO_MAP | conditionally | > | PTR_TO_MAP_VALUE | yes | > | PTR_TO_MAP_KEY | yes | > | PTR_TO_STACK | yes | > | PTR_TO_PACKET_META | yes | > | PTR_TO_PACKET | yes | > | PTR_TO_PACKET_END | no | > | PTR_TO_FLOW_KEYS | conditionally | > | PTR_TO_SOCKET | no | > | PTR_TO_SOCK_COMMON | no | > | PTR_TO_TCP_SOCK | no | > | PTR_TO_TP_BUFFER | yes | > | PTR_TO_XDP_SOCK | no | > | PTR_TO_BTF_ID | yes | > | PTR_TO_MEM | yes | > | PTR_TO_BUF | yes | > | PTR_TO_FUNC | yes | > | CONST_PTR_TO_DYNPTR | yes | > > [...] Here is the summary with links: - bpf: Refactor ptr alu checking rules to allow alu explicitly https://git.kernel.org/bpf/bpf-next/c/2ce793ebe207 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html