From nobody Sat Feb 7 10:07:46 2026 Received: from mail-dy1-f202.google.com (mail-dy1-f202.google.com [74.125.82.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E74782DAFA8 for ; Sat, 10 Jan 2026 08:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768033570; cv=none; b=YEqReq17FXTO8IK9fTx/bJpVZTs1NKfMnfJ+E3E6FQWHhdSYcuXWjpmjanNXN4kEFubReYbCsWoPnVat8zgbqaKsCxctuZ1sScAxqwwwUAcZ9WuBf8h5+3xrw2lq8zdhYQZw4hUmZR6a/iPhxlHG0+4oPGjp5RErvrY0AQl85zo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768033570; c=relaxed/simple; bh=fU9tXtVUuvz++hhVpv6nOf14ncQA9HihGffXc9Blti4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XlDoY2i4/WGWlCg4AWdwrDx37LEz3qeMcO/9+/H5yxcu7eCk475mDtIhjZgF0DIkXOgGe/55EW9H4DbfWe4i1R0VCWor0Mz3i3YhhfUrTPfG3C2UeU+H1r+jcV3sU9wJcuedyMISUdcURcHDcn3Ib/ZAt5X+t+qrN2Q+Ojk4RJ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--samitolvanen.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=1aUYk9bM; arc=none smtp.client-ip=74.125.82.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--samitolvanen.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="1aUYk9bM" Received: by mail-dy1-f202.google.com with SMTP id 5a478bee46e88-2b0751d8de7so6545031eec.1 for ; Sat, 10 Jan 2026 00:26:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768033560; x=1768638360; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=PZhkoiS2Eo/kq3Cli8CQX1phFsPCl4naA/gjIFzyLV8=; b=1aUYk9bMCBtiYbJSy8auWrAI2DyPvbN+xBIkVdWjy+Ppe3JPx1TqgTU1UL0Zz0t2W1 xXyRSkgXR1uprPKNStP19RBOLEKEolshdB0V3J7HrNPS6gWzXDT03JDuhzBeoWWkW9Qo Z9u4XB+b2ZMB+afa0CymDJpgDPjnPVoDZ/ZHM9Az7TAZVFDCLEbw4oF5gM4P2GlrlYwf K6yLJRRq2oRqB2T1+6vzG92FaBJ2nxPWY8qG0wUhAZOtvUGleoSo5s5GpA/ILwLWXtaF 7LZ9TJJrLloXwGIIuy1eDeVflrM/l5VtgoZ8qUVwy4meTDHJ/TqUMm2A1f2JD87xf/fy iiWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768033560; x=1768638360; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PZhkoiS2Eo/kq3Cli8CQX1phFsPCl4naA/gjIFzyLV8=; b=lz53bKUUI2Mqc7F3d6QB4Qztz6UnUOyPBEySOJajAwIQ4S5Tid6RgCbz8aj3ZkQrM0 ch1yxYjyxUtO3Yc82cl/vz/dKb7HzhsFqxJvQV3xpPWo0bK//EWGJrDiBHfv/eaCWW6t vOuTDGOuASIzh1rDbuMDWnw3bd345BnuJyg5DodFFfnO2wfQL2/KauoTrKFi49GvLRlx ohHowqAicEblfE/eUbl4ec6hNQ9KLNqZ6MmPwLqfNQQU2Av0aJZRDjYPzA0D0+wRFB+s 8VmIOhP3grXQVeqbx5QaluOf3QEYssOOSokiK2jznBepkfK0O41oleekQaN7KmahGGjo htqQ== X-Forwarded-Encrypted: i=1; AJvYcCXdpHTO5MV81oJ5oCKC2ZmzYuOwvFf61uJyZRBHMrj3d/7U1JI8YXD2rclvG4HypAdkym8J3g1z8lzNM80=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0bT5pq+YhWjiTSYqnYVAC/oMWLbXprJcoB0XsWs4gVEte3n44 GPLBBJsrdnPDmEDXaMT8SiZvkjdEOQYZGaEZPepLzbdjgVSh10gMPfCg4vbEDjiuFjLLb/o8Hp/ y1REzm4R6NAmhyxnhrsMKdIaiJjVUkQ== X-Google-Smtp-Source: AGHT+IG9YKCSq7wS7f0FWH0qnCPG7v4Hjw/ILCg0+RfetXQsjFo9F+6oxi8SmQfwivw3ZF8EVRkWhSbDDRqzXAdk+xg= X-Received: from dycog7.prod.google.com ([2002:a05:7301:9a87:b0:2ae:3278:d74f]) (user=samitolvanen job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:e9d9:20b0:2b0:582e:fe51 with SMTP id 5a478bee46e88-2b17d2a841dmr7814723eec.20.1768033560093; Sat, 10 Jan 2026 00:26:00 -0800 (PST) Date: Sat, 10 Jan 2026 08:25:52 +0000 In-Reply-To: <20260110082548.113748-6-samitolvanen@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260110082548.113748-6-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=1607; i=samitolvanen@google.com; h=from:subject; bh=fU9tXtVUuvz++hhVpv6nOf14ncQA9HihGffXc9Blti4=; b=owGbwMvMwCUWxa662nLh8irG02pJDJlJvHwP4ydbut2RMjnQ9ODCnS2OKqy+lja+XC473u2V/ rt9QYdSRykLgxgXg6yYIkvL19Vbd393Sn31uUgCZg4rE8gQBi5OAZiIziVGho2HN68R23FxSueL Hab7bx5u1xBQ2VO556dvY/lcnR5Z72SG/xn92xL+WF+wn8H//Vi40D6OmGk7HFhWpV5am8jbL5f yiQMA X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260110082548.113748-9-samitolvanen@google.com> Subject: [PATCH bpf-next v5 3/4] selftests/bpf: Use the correct destructor kfunc type From: Sami Tolvanen To: bpf@vger.kernel.org Cc: Vadim Fedorenko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Viktor Malik , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Sami Tolvanen Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With CONFIG_CFI enabled, the kernel strictly enforces that indirect function calls use a function pointer type that matches the target function. As bpf_testmod_ctx_release() signature differs from the btf_dtor_kfunc_t pointer type used for the destructor calls in bpf_obj_free_fields(), add a stub function with the correct type to fix the type mismatch. Signed-off-by: Sami Tolvanen Acked-by: Yonghong Song --- tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/t= esting/selftests/bpf/test_kmods/bpf_testmod.c index 1c41d03bd5a1..bc07ce9d5477 100644 --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c @@ -285,6 +285,12 @@ __bpf_kfunc void bpf_testmod_ctx_release(struct bpf_te= stmod_ctx *ctx) call_rcu(&ctx->rcu, testmod_free_cb); } =20 +__bpf_kfunc void bpf_testmod_ctx_release_dtor(void *ctx) +{ + bpf_testmod_ctx_release(ctx); +} +CFI_NOSEAL(bpf_testmod_ctx_release_dtor); + static struct bpf_testmod_ops3 *st_ops3; =20 static int bpf_testmod_test_3(void) @@ -707,7 +713,7 @@ BTF_KFUNCS_END(bpf_testmod_common_kfunc_ids) =20 BTF_ID_LIST(bpf_testmod_dtor_ids) BTF_ID(struct, bpf_testmod_ctx) -BTF_ID(func, bpf_testmod_ctx_release) +BTF_ID(func, bpf_testmod_ctx_release_dtor) =20 static const struct btf_kfunc_id_set bpf_testmod_common_kfunc_set =3D { .owner =3D THIS_MODULE, --=20 2.52.0.457.g6b5491de43-goog