From mboxrd@z Thu Jan 1 00:00:00 1970 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 322B3346E63 for ; Wed, 24 Dec 2025 19:25:55 +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=1766604356; cv=none; b=Mo0VgnyXSb/FKPcqV4tPuqwVCLu2v58CGXxR2kiPEicdHlvVsLfdDBrsX2m8+5pLhqXdbPd4LK2JnvwdCZUdly2unbvsZEdaER7uphYqrOtq8A8+aFhalGLyVlklwC9n5mT3JkgJN3aXAQIndJEo4pw6i/TuYKLDPrFClEuVadk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766604356; c=relaxed/simple; bh=3JV+TVAyUmvwGgR9UmSQuhyV77l5a3V/cDQh4KLyifU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BsYDDsrB7l0GWOr+ZHjfelQgZ5aeskhg+aVVtTPels+nDzBaUWNXSNv8/140wg+tV5XeWGLMQ1h0vDed9giPdnqFixodebAzwrGxKlgGIl+ZKEMg7z4eqdVKyrpy7rv9KILAhij8kWwKNw7ZsbWDhTzFUcHKp9D5NsOeF5FNivE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n90JWn8s; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n90JWn8s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A586C4CEF7; Wed, 24 Dec 2025 19:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766604355; bh=3JV+TVAyUmvwGgR9UmSQuhyV77l5a3V/cDQh4KLyifU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n90JWn8sxTVOSl8zxgvKk6bRI/ySUIQLX5u6YEpK2MOeNWP5qThRRwi91TRPvbbyo S8ohm7CaRQB5++y0U9Q90n2rtwc1fjM8hRwQOgO8gPcHcauZOy2Csptofb6VjdiltF 3eWHB1tiu7eqM9UrmUA1DI+FFN01ZwQCycLLR9lk3HEgcpnZbFImDJkbDtdpCTlTyq 8GXKtNZGwFtWCEev9tbi0LIMOty7EAWT92XYalvCtI8Ly7ZmmQDYVJy65VuskbIylt NaJr0goPsTULCGshW2ntLmwhRGa0BcJBwnNkHArrcljLmyIwwd0Xj6EkxsF6+vBhO3 nTVF2yMEAf7VA== From: Puranjay Mohan To: bpf@vger.kernel.org Cc: Puranjay Mohan , Puranjay Mohan , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Eduard Zingerman , Kumar Kartikeya Dwivedi , kernel-team@meta.com Subject: [PATCH bpf-next 6/7] selftests: bpf: fix test_kfunc_dynptr_param Date: Wed, 24 Dec 2025 11:24:35 -0800 Message-ID: <20251224192448.3176531-7-puranjay@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251224192448.3176531-1-puranjay@kernel.org> References: <20251224192448.3176531-1-puranjay@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As verifier now assumes that all kfuncs only takes trusted pointer arguments, passing 0 (NULL) to a kfunc that doesn't mark the argument as __nullable or __opt will be rejected with a failure message of: Possibly NULL pointer passed to trusted arg Pass a non-null value to the kfunc to test the expected failure mode. Signed-off-by: Puranjay Mohan --- tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c b/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c index 061befb004c2..11e57002ea43 100644 --- a/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c +++ b/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c @@ -48,7 +48,7 @@ SEC("?lsm.s/bpf") __failure __msg("arg#0 expected pointer to stack or const struct bpf_dynptr") int BPF_PROG(not_ptr_to_stack, int cmd, union bpf_attr *attr, unsigned int size, bool kernel) { - unsigned long val = 0; + unsigned long val = 1; return bpf_verify_pkcs7_signature((struct bpf_dynptr *)val, (struct bpf_dynptr *)val, NULL); -- 2.47.3