Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3131378pxb; Tue, 12 Jan 2021 07:06:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnO/B1OWYcrB6km7lYkRFLQaHpPdV0CsiZ0ta4U95UjpuUtLVpvtGNqR4/7RFaYpeZLW+F X-Received: by 2002:aa7:d750:: with SMTP id a16mr3840310eds.252.1610464014993; Tue, 12 Jan 2021 07:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610464014; cv=none; d=google.com; s=arc-20160816; b=PtYoj3a+Wb+6vZp6NCgsAj6200v9wM0zpP7+uys0Xmbpe9QhQwv5AH6O6fyK852wjw X+VBtSgepFTKo0HcUp1wnwpeEn4KOCcydgWZCWERyaI/ygbmDyYQJCMQ4XuHk88ucvXg 50RBu9/NyWMhItZFpP3y43MHaM5/C/WJOOLmWAS6/V+mKQL7UnYiAn7bNCiCHREU3/AF 8juQlTgW3vKQsD9Pu6M1q0X4R12WTXvVWCIuow268LG5ddMXQD12jdaKK2aAr5zXyqvb xbD9ITML4CmgWY4HTMwX50V6kzbXKrd/Kum3XU3hCcixa7x96gzHyuN+tATI2vG4YWaV 7O3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NuVHEBAAcMBI+7L/Kq2vIBTLAIxJLZ1JSKqx4+/a0pM=; b=T48DJWicZPuOjbkJZF/OUNdegUaWrw/3Cv8T3Xsp4SpLkeGJ0iHUQtiW6vO7nG3FQh al5hkSkl0iOvwOGtCAgOb2eVLTFz82cNeML4lUu5EZHfVMmsMAFI1VdRroprcfwAVrr6 wt+s2vyChzOxbSVXDPMzqY+GWLIWJUhD3xO+yANcZyt8plrOhbQBVJROroLiWvIItKDr m3pZ6JRrONmgGPqPNCi7lNseA5cUuDpVLHlt2DTGQwi768sdsEpnDAoH4XVsm+R/b11j KDjNyR2OEGEb+78QGNhwaiy2oFBicSYzsgnyxPgpBDBkAwI242Swma2ep8aLAU97dh6N 28xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ayrt50U/"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d27si1222534ejc.384.2021.01.12.07.06.30; Tue, 12 Jan 2021 07:06:54 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b="Ayrt50U/"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389403AbhALPCR (ORCPT + 99 others); Tue, 12 Jan 2021 10:02:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:33730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728901AbhALPCR (ORCPT ); Tue, 12 Jan 2021 10:02:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BA1382313E for ; Tue, 12 Jan 2021 15:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610463696; bh=Z1rbMQMt/ZBnWtsqUtXo+X1vs3VvV7P3JPZmshyA4oM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Ayrt50U/8AdxtQ+n6VVJ/r5hTHYjjFRwmngE3zk7FAZREjhrQ3PgcX4+091dw+akt QRaRtRvgiRMIYCk+dIuB9KZpbcaykNFJOyfB6udsY1ibZ0nsJK1aitQ0Lddw57sots GzZ5Zz3TSjaxYJ+XMwnYA78wFWLTnKVsuPjmf/X/kn/5okYRx+htZbv2Xxo5NSvtKt jEF2+ismvKC7g20z09O0CIUFu6G94F5ME8aFS5Q/PScdTaiAiTiFZuoueilwk/iIAV 5EFE3AdKkJvKZNjpXJ0F3D3g25xZ8h/fUXy2bfuWyFBMgZ2DTepgfc6wKG4PFpiZ8T v1duIAcIDiuFg== Received: by mail-lf1-f54.google.com with SMTP id h205so3819399lfd.5 for ; Tue, 12 Jan 2021 07:01:35 -0800 (PST) X-Gm-Message-State: AOAM532GCB2y8G1xAqD3sei3qnFGh1H6NksRA+VphrO2FDQ5GtrBJnvi v0xGHY5/pgT1p5WOvImuRNiJsdp7a7za/P+gJtBbCw== X-Received: by 2002:a19:810:: with SMTP id 16mr2427834lfi.233.1610463693714; Tue, 12 Jan 2021 07:01:33 -0800 (PST) MIME-Version: 1.0 References: <20210112091403.10458-1-gilad.reti@gmail.com> In-Reply-To: From: KP Singh Date: Tue, 12 Jan 2021 16:01:23 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf 1/2] bpf: support PTR_TO_MEM{,_OR_NULL} register spilling To: Gilad Reti Cc: bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , Networking , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 3:24 PM Gilad Reti wrote: > > On Tue, Jan 12, 2021 at 3:57 PM KP Singh wrote: > > > > On Tue, Jan 12, 2021 at 10:14 AM Gilad Reti wrote: > > > > > > Add support for pointer to mem register spilling, to allow the verifier > > > to track pointer to valid memory addresses. Such pointers are returned > > > > nit: pointers > > Thanks > > > > > > for example by a successful call of the bpf_ringbuf_reserve helper. > > > > > > This patch was suggested as a solution by Yonghong Song. > > > > You can use the "Suggested-by:" tag for this. > > Thanks > > > > > > > > > The patch was partially contibuted by CyberArk Software, Inc. > > > > nit: typo *contributed > > Thanks. Should I submit a v2 of the patch to correct all of those? I think it would be nice to do another revision which also addresses the comments on the other patch. > > > > > Also, I was wondering if "partially" here means someone collaborated with you > > on the patch? And, in that case: > > > > "Co-developed-by:" would be a better tag here. > > No, I did it alone. I mentioned CyberArk since I work there and did some of the > coding during my daily work, so they deserve credit. > > > > > Acked-by: KP Singh > > > > > > > > > > Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier > > > support for it") > > > Signed-off-by: Gilad Reti > > > --- > > > kernel/bpf/verifier.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > > > index 17270b8404f1..36af69fac591 100644 > > > --- a/kernel/bpf/verifier.c > > > +++ b/kernel/bpf/verifier.c > > > @@ -2217,6 +2217,8 @@ static bool is_spillable_regtype(enum bpf_reg_type type) > > > case PTR_TO_RDWR_BUF: > > > case PTR_TO_RDWR_BUF_OR_NULL: > > > case PTR_TO_PERCPU_BTF_ID: > > > + case PTR_TO_MEM: > > > + case PTR_TO_MEM_OR_NULL: > > > return true; > > > default: > > > return false; > > > -- > > > 2.27.0 > > >