From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 AB7033019B2 for ; Mon, 12 Jan 2026 20:33:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768250008; cv=none; b=JV0t63b8pma+BiYslWKyFUaJjYsD+6U0v7rR2a2y1IrtTT+uZ1Zjt4Iz9h7/gOVCwERGpbIvFvGwvtx1Yvq/VlskY6UuBUmwFLFD23haaoZGPwddsw6lQ0In+NaFpV/hNXr9eh5Ee3omYiNWQULoFuwlLP2kwnjuPv0eN4JwxO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768250008; c=relaxed/simple; bh=6E5ir0MKvTzLi3KjeQ67vT4rjxiQJWGb+HPPvyVahF8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BNp6pxxUiQKlqALbw+3Y+uzyjKNPC16ZaOrDcyAgXeSqLX2jjNY6/lzqSGbgrbF6ZykFHXJOW6sXRP3L0o4rI9GOgT+RJHl0h8rZJ4FZv0haYI89b3e1UT90INT7Z6EtWjD0MDtOq9nZrpEhMZhQthg6XvAvAKlMDu86mk3+uz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=EUhMqNkC; arc=none smtp.client-ip=95.215.58.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="EUhMqNkC" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768250004; h=from:from: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; bh=uZwAZadttIzjQgCgVSRvtALF13IG3cbZd+R+sJcZlcY=; b=EUhMqNkCjNyynrPQz1qcS4A/nBCP6IMO+ZRiU6uQgjq41ze4qU3IYqJotfgfSM61LKypAE ZlTdXNkEeMdTYc6CHzikiBEyiOFKgVInodHi20Oh1mTEj1R6eBZGTE/6N0H/uSNqU4FbNg YNwxAOJYzzIixOR2qdxxhzTt6xxCB4M= Date: Mon, 12 Jan 2026 12:33:15 -0800 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v5 0/4] Use correct destructor kfunc types To: Sami Tolvanen Cc: Vadim Fedorenko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , 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, bpf@vger.kernel.org References: <20260110082548.113748-6-samitolvanen@google.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20260110082548.113748-6-samitolvanen@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 1/10/26 12:25 AM, Sami Tolvanen wrote: > Hi folks, > > While running BPF self-tests with CONFIG_CFI (Control Flow > Integrity) enabled, I ran into a couple of failures in > bpf_obj_free_fields() caused by type mismatches between the > btf_dtor_kfunc_t function pointer type and the registered > destructor functions. > > It looks like we can't change the argument type for these > functions to match btf_dtor_kfunc_t because the verifier doesn't > like void pointer arguments for functions used in BPF programs, > so this series fixes the issue by adding stubs with correct types > to use as destructors for each instance of this I found in the > kernel tree. > > The last patch changes btf_check_dtor_kfuncs() to enforce the > function type when CFI is enabled, so we don't end up registering > destructors that panic the kernel. Acked-by: Martin KaFai Lau