Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3160180pxb; Tue, 12 Jan 2021 07:45:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMzi+e+sETYdJ3+2gNFZBfVpzIWFomUu/1RvIy1mCqm1LGoDUTILhPJXwLEdYa84GUv773 X-Received: by 2002:a17:906:8255:: with SMTP id f21mr3572348ejx.265.1610466329253; Tue, 12 Jan 2021 07:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610466329; cv=none; d=google.com; s=arc-20160816; b=H7Z0HPKjvR0zwcpAYtqm8sb/aU9l7QO8es07ECvnIfNKjYL2FvANTx6NTBjsr8WyNy zJK964iWR9WQ11h5JHGsM9Ibo37oR1UVjs5EhUD3SGTo7FwLSY2/BEV6/V0QpF4cjv4x bampUtnq9MeplzC9T7aB/PrDAkliNXJWNVO88T9zwLqcGdU2ffn0dQi+49UacJaV0oWH EsNAmTmYAgiiK1ncQ4LAustsimjOL8E1lnx6DZN4+MVznKqsswH9ivMW+sb8Xf21+1uC xwLVuudXgMQgypTqPJSKVrszPKCS4Fuu7MA9ZoyHfOGhr13fjt8DXWuHNPLHa6GHKlUi Ryaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=LTTg2wbwqawxhW6+yLZTeEZ8F9FNjADRFrhMdCXa58Q=; b=QuMwy1Fy69oHoUxaTMiXrmSofDpQpBme7fg9JHRLoKArDTeTQW+kDhwue/eQgQur4l f34xgTPhgL7iRiV1tpXOX1mczl7xsmHv3QF5Zh0BpkK7oncuHw2yMLi2kqzhCaTsrdRE SgF7zSeAUauqJi5So1QyxH7K4yFhsssjyD0lG3fdyIR2GyBmapgFjDVlPSTywAnJZ2XB /dkVmUhpClfWmQEsr51seZl1GvPPy9z0l5BiZUhVQxLVEDognpvMjsOSZmzqngDiysH5 RNxmauEyMi83LsqQCiou1gmQGN5JOvVSmOUC8CneSf6nAIZYKtepfI7XMBJi6l+fSBmI pNSA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si1283447ejn.17.2021.01.12.07.45.05; Tue, 12 Jan 2021 07:45:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405026AbhALPoH (ORCPT + 99 others); Tue, 12 Jan 2021 10:44:07 -0500 Received: from www62.your-server.de ([213.133.104.62]:56640 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404536AbhALPoD (ORCPT ); Tue, 12 Jan 2021 10:44:03 -0500 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1kzLpI-000Dp0-KM; Tue, 12 Jan 2021 16:43:20 +0100 Received: from [85.7.101.30] (helo=pc-9.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzLpI-000KzU-Bo; Tue, 12 Jan 2021 16:43:20 +0100 Subject: Re: [PATCH 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill To: Gilad Reti , KP Singh Cc: bpf , Shuah Khan , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , linux-kselftest@vger.kernel.org, Networking , open list References: <20210112091545.10535-1-gilad.reti@gmail.com> From: Daniel Borkmann Message-ID: <60034a79-573f-125c-76b0-17e04941a155@iogearbox.net> Date: Tue, 12 Jan 2021 16:43:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.4/26047/Tue Jan 12 13:33:56 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/12/21 4:35 PM, Gilad Reti wrote: > On Tue, Jan 12, 2021 at 4:56 PM KP Singh wrote: >> On Tue, Jan 12, 2021 at 10:16 AM Gilad Reti wrote: >>> >>> Add test to check that the verifier is able to recognize spilling of >>> PTR_TO_MEM registers. >> >> It would be nice to have some explanation of what the test does to >> recognize the spilling of the PTR_TO_MEM registers in the commit >> log as well. >> >> Would it be possible to augment an existing test_progs >> program like tools/testing/selftests/bpf/progs/test_ringbuf.c to test >> this functionality? How would you guarantee that LLVM generates the spill/fill, via inline asm? > It may be possible, but from what I understood from Daniel's comment here > > https://lore.kernel.org/bpf/17629073-4fab-a922-ecc3-25b019960f44@iogearbox.net/ > > the test should be a part of the verifier tests (which is reasonable > to me since it is > a verifier bugfix) Yeah, the test_verifier case as you have is definitely the most straight forward way to add coverage in this case.