From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC7F7C2D0CD for ; Thu, 15 May 2025 18:24:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 721C86B00B7; Thu, 15 May 2025 14:24:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AFBE6B00B8; Thu, 15 May 2025 14:24:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FDA66B00B9; Thu, 15 May 2025 14:24:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2D6C46B00B7 for ; Thu, 15 May 2025 14:24:23 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2DC2F80498 for ; Thu, 15 May 2025 18:24:24 +0000 (UTC) X-FDA: 83445967248.08.6A086B9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 6AE8640011 for ; Thu, 15 May 2025 18:24:22 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=neWj93rj; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of kees@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kees@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747333462; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=h4BGRoa5yzOfqyo0jR6nYbAKjRSoNdAP90NOyrKJd/s=; b=p1Sn5bDmCoKNoxQq8lth0wccw412t4GOEpKMAbPpVEy+H2eqJ3GwU26PPYRVghoLvjsq4u ZwP9mD1n78KqQOLkEJB7EQmCFms7dcONUuRX1R5f08zep2KsC64o5O50ezMpGhebRbRH0l ed4vSkt2JzynQBXC4ZPu7MUNeF/riKo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747333462; a=rsa-sha256; cv=none; b=3EscbzUtX4zuUjetZsW2WhRBV4tl0C0PH+njlq2ynR/TGr6e8sDErrXLqb2WZFCLsLYR70 RodlcTYoQe9PRXEZ5ijqT1wQO5qYysrXy5LrMeHUyZlAlt97qBBkEVmk2/dm9SI/kl/W75 MHuW5+gpmgRVqE76vgBv1pQGgkaIYoM= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=neWj93rj; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of kees@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kees@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 029935C0392; Thu, 15 May 2025 18:22:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8B14C19421; Thu, 15 May 2025 18:24:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747333461; bh=cmyb4fslMdZMeqJjaLXvuCdgMLSOPj2eAW7zLDTyppQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=neWj93rjpazFcs+AlCYfjTtrA68QwMLPbqCAGKLV83Bw/9G5mYV5YGBG8kPiQvR5C aFWcZ6XPUcMrEPg2X9JdqcpVtlFnNDYbBWlCcWGkxStYHbhHq1I/otEkFgkY3AmctU 85ZK90t0e8tjsxybIkI4t3GZ+OVaaVzhPh3OJXIaZtDSlc1C+BlEyQK75SJ9mC/Mkl lgrpMKpgThEPyZ6vixgMLEzrmfK2eFm/zKEwCjcdqmYE9+uMQnKqP+W05IihwVECmo TtVo1zvSB4eTuLdk8yXgGrC0ycL/ncy2YcAJHAchPB9GwAuTQ3iHcu3Uyh9IIgZ5Lf 83L70jE8yVpWA== Date: Thu, 15 May 2025 11:24:16 -0700 From: Kees Cook To: Andrii Nakryiko Cc: Pawan Gupta , Shung-Hsi Yu , bpf@vger.kernel.org, linux-mm@kvack.org, Andrii Nakryiko , Ihor Solodrai , Andrew Morton , Michal Hocko , Vlastimil Babka , Uladzislau Rezki , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, regressions@lists.linux.dev, Greg Kroah-Hartman , Alexei Starovoitov , Daniel Borkmann , Eduard Zingerman Subject: Re: [REGRESSION] bpf verifier slowdown due to vrealloc() change since 6.15-rc6 Message-ID: <202505151116.4FFA176B8@keescook> References: <20250515-bpf-verifier-slowdown-vwo2meju4cgp2su5ckj@6gi6ssxbnfqg> <202505150911.1254C695D@keescook> <20250515171821.6je7a4uvmttcdiia@desk> <202505151039.DAA202A@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Stat-Signature: jr6hzowobai9ujc4yi8yp33f8oa91rda X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6AE8640011 X-HE-Tag: 1747333462-817135 X-HE-Meta: U2FsdGVkX1/bACnUcrBKzaY/aDarEpvNfZDSIbJ/p8MIE/q7axZK8Tg/A8wII/WPR8jDca6upaoeCrMHOJBuLCXPP9mW9P0m8s+1GHa3S/4NQDfFm2m7SBPtadGa8X24pR95i8X/JNHWQLVI5mQc59a6fSXhN+s6S5pYCjtfsMs6tIWNTcMDzEN7A+Zfvd3ccqHb8rka1w166KMxFA1v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m8Y/m8AJr0lfncQrnqhwCEIkIq5CMM/EzhFNqitU70/46snphLzIZtFB4yVyIcknu/h/0RkNGAIk3feuCz3eIUglDDTr9EnT+gh8rZZxpTpQ8oZNMbJsMwJVGc7fMME2AqFb41bsBEd+JCBA/tlUiak= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, May 15, 2025 at 10:53:10AM -0700, Andrii Nakryiko wrote: > On Thu, May 15, 2025 at 10:41 AM Kees Cook wrote: > > > > On Thu, May 15, 2025 at 10:18:21AM -0700, Pawan Gupta wrote: > > > On Thu, May 15, 2025 at 09:51:15AM -0700, Kees Cook wrote: > > > > On Thu, May 15, 2025 at 07:51:26AM -0700, Kees Cook wrote: > > > > > On May 15, 2025 6:12:25 AM PDT, Shung-Hsi Yu wrote: > > > > > >There is an observable slowdown when running BPF selftests on 6.15-rc6 > > > > > >kernel[1] built with tools/testing/selftests/bpf/{config,config.x86_64}. > > > > > [...] > > > > > Where can I find the .config for the slow runs? > > > > > > > > Oops, I can read. :) Doing a build now... > > > > > > > > > And how do I run the test myself directly? > > > > > > > > I found: > > > > https://docs.kernel.org/bpf/bpf_devel_QA.html > > > > > > > > But it doesn't seem to cover a bunch of stuff (no way to prebuild the > > > > tests, no info on building the test modules). > > > > > > > > This seems to be needed: > > > > > > > > make O=regression-bug -C tools/testing/selftests/bpf/test_kmods > > > > > > > > But then the booted kernel doesn't load it (missing signatures?) > > > > > > > > Anyway, I'll keep digging... > > > > > > After struggling with this for a while, I figured vmtest.sh is the easiest > > > way to test bpf: > > > > > > ./tools/testing/selftests/bpf/vmtest.sh -i ./test_progs > > > > I can't even build the test_progs. :( > > > > $ make test_progs > > ... > > CLNG-BPF [test_progs] bpf_iter_tasks.bpf.o > > progs/bpf_iter_tasks.c:98:8: error: call to undeclared function 'bpf_copy_from_user_task_str'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > > 98 | ret = bpf_copy_from_user_task_str((char *)task_str1, sizeof(task_str1), ptr, task, 0 > > ); > > | ^ > > 1 error generated. > > > > BPF selftests expect that there was a successful kernel build done > before that. So generally speaking: > > 0) cd > 1) export O=/path/to/build > 2) cat tools/testing/selftests/bpf/config >> /path/to/build/.config > 3) make O=/path/to/build -j$(nproc) oldefconfig all > 4) cd tools/testing/selftests/bpf # everything is built within this > directory, we don't support KBUILD_PATH or O for BPF selftests build > artifacts > 5) make O=/path/to/build -j$(nproc) Linux ToT fails to build, -next fails to build. v6.14.6 fails build, each in different ways. :( > But tbh, if the above causes you problems, I don't think you need to > spend that much time trying to build BPF selftests, given you know > what the issue is and you are fixing it. Well, nothing I've proposed makes any sense as far as something that would double execution time, so I don't really know what the issue is yet. :P -- Kees Cook