Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2377214pxb; Mon, 11 Jan 2021 08:09:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDl6BxgaQfH3HTvokTcS58JnffI3oo1q7DDPx/ymwBs6Z++6F152pxMiManpSwN9PBXLRm X-Received: by 2002:a17:906:f894:: with SMTP id lg20mr144917ejb.348.1610381385967; Mon, 11 Jan 2021 08:09:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610381385; cv=none; d=google.com; s=arc-20160816; b=xSdRKpY7eoMe32D56HaMQsXemRQOcJLAL7+qtQYUyvqZ48sAl0IUldP+gUbiBbdh6q DEbqt5+Fz8BD8CAaqYl3D8J4+l0afIstHhgwnGpx7REkV16RVqn8xJzB015+e6eV+G/7 akREOQi13X9ox0Zf3BuGycziD0VnU265V7VK+vd/+LG98ytAgeElr+qV6oczGoxabrT8 3PL9y+vKDuxm7KD3k1XCcMeepWxsKGFlJXYeoGJ2Wn280xnBB+ZvK342VrbT5qSaHDDs Po2c9Kznqelq92cN52oJeseTOdF1CPz+ZcgRu+TvHLgYOZAaFIbjuXHjrtKXBrNUNBCQ riwQ== 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=TBi9AVliylLSBAh5IQu8XXmi3M4dSapAzhq/jOj2QaE=; b=YSjSZ0bQJuJLl3RWEAiw8KYeF4a4rsTM4tYRqP19WyNCtz47O2evRHCrgTwXHquyxf NrQ3dVd5VSrGAAJaewIgR6ws8dQ/x29CDjvnjmvBWklMibB0kfrc2iNa0lACv3leBBz2 NUOUgrLRtLQ4tXVfrzmAF/FkBtz7gqwprPKDImBSQPMbudbKT1/74qIoUzehxP4THdqy 3vjPZoUgcZFRu9L4C6UOj4SCW+ZAhlqCoT6YCat6zTfdMDCPycR1utydaeGmj7HdKgNE KpTVNDPVhb6IwsP7kapkCIZRLXrIFGbfVWRctBuvavkZjxOkgey9y1sbOYIDhEh02Y8a 6ShA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TtwK4LPw; 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 e20si77652edr.131.2021.01.11.08.09.21; Mon, 11 Jan 2021 08:09:45 -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=@gmail.com header.s=20161025 header.b=TtwK4LPw; 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 S2388156AbhAKQFS (ORCPT + 99 others); Mon, 11 Jan 2021 11:05:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728569AbhAKQFR (ORCPT ); Mon, 11 Jan 2021 11:05:17 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4970AC061786; Mon, 11 Jan 2021 08:04:37 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id jx16so299072ejb.10; Mon, 11 Jan 2021 08:04:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TBi9AVliylLSBAh5IQu8XXmi3M4dSapAzhq/jOj2QaE=; b=TtwK4LPwq2aryJ5SWXsYeHz7NAXWrSEZwpe9xhhn6yUN1qnztLRq9h9WSr1828ut8H 7LOiJ7g2lvw6YIs3AB46gaME8u8h55MC0yUbajjEmWZgYIbBMbXQbgd6oKkDA0p4QCTJ DijkVNGXIOYDiZYPyhijuohk3BgDEMDd1/nmhKKS9CQUkFaCnKwmOS5OvAw4ZXlXkH7I Wv4IsOCLpRdWXkY7jAhsZSrfIB1Yr/jaU7YhgLWyj514KCgTcgb43ztGyw22+te69cFt k/Ss5eYSj7hej/bWhYerxhgSk7SCfzXWvlqBLpm4tFAYzxmPTeFExLg0J75D7xjfjDiX 3zBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TBi9AVliylLSBAh5IQu8XXmi3M4dSapAzhq/jOj2QaE=; b=Up0EE4u0+eVQmvz61OACcJO3wkxhU4pgQ077TyKpZPNnEZm07vf56JJ/4owBvfq50Q 8shtMGk/0sooADAh9bFsJda99sJt1wIF2M3UV6V4ueSDwHa46F/KLZ9mzBdwWXt29jRd 5v/5rJMT6+SZMay22PFR534/LkbVzzOlRoXk+UaI3YSQqmfkyU6VcPDGw8YzMPUAPUwA r+27MQ/v+qzfOAtCSZaSmACcpBGQaLIV15aR66KhUf/jTsDFw1+/0d1f2vrI4rnMt9rY +mbS6JWS6N8goJIm3HichBSWpK1nZpSl8K0nK3+9XNc1m6zcQ4tGseN8vu0lYEqQY0Fc eyng== X-Gm-Message-State: AOAM533F/m3mc4HMuX4z5MNlKSp+jHMyeSWBbo2Ejl+qsMlfGuS1qCBB gApZznG/2fS3LpCEhoxEsYAjoYoddWRAg8Zck1g= X-Received: by 2002:a17:907:546:: with SMTP id wk6mr129359ejb.238.1610381076001; Mon, 11 Jan 2021 08:04:36 -0800 (PST) MIME-Version: 1.0 References: <20210111153123.GA423936@ubuntu> <17629073-4fab-a922-ecc3-25b019960f44@iogearbox.net> In-Reply-To: <17629073-4fab-a922-ecc3-25b019960f44@iogearbox.net> From: Gilad Reti Date: Mon, 11 Jan 2021 18:03:58 +0200 Message-ID: Subject: Re: [PATCH] Signed-off-by: giladreti To: Daniel Borkmann Cc: bpf , Yonghong Song , Alexei Starovoitov , Networking , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2021, 17:55 Daniel Borkmann wrote: > > Hello Gilad, > > On 1/11/21 4:31 PM, giladreti wrote: > > Added support for pointer to mem register spilling, to allow the verifier > > to track pointer to valid memory addresses. Such pointers are returned > > for example by a successful call of the bpf_ringbuf_reserve helper. > > > > This patch was suggested as a solution by Yonghong Song. > > The SoB should not be in subject line but as part of the commit message instead > and with proper name, e.g. > > Signed-off-by: Gilad Reti > > For subject line, please use a short summary that fits the patch prefixed with > the subsystem "bpf: [...]", see also [0] as an example. Thanks. > > It would be good if you could also add a BPF selftest for this [1]. > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=e22d7f05e445165e58feddb4e40cc9c0f94453bc > [1] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/ > https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/verifier/spill_fill.c > Sure. Thanks for your guidance. As you can probably tell, I am new to kernel code contribution (in fact this is a first time for me). Should I try to submit this patch again? Sorry in advance for all the overhead I may be causing to you... > > --- > > 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; > > >