From nobody Mon Dec 1 23:07:03 2025 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.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 CF220342CB0 for ; Wed, 26 Nov 2025 22:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764195456; cv=none; b=pqijd2jBzgr/GZ8PIkF92HlzMQ+HSffqyiGEHrD+yJFvszzhOoZ1AqCv5d8zhN6ysr+m9xjrITV9HbrscQ4JOjtY7kLHqfgK4jbWlq+E4xlifp4w9ik81kOh2QNN6WBo4KTS4awMg1n4tT4O1T8vETKdqzHAPliODe/d5JOKsd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764195456; c=relaxed/simple; bh=WQcm0EHsw6PYPITVbaCdvvynX9VHge/XcXBmVFGe0zc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ZvbNwooutEA7j6HGZZqcSZBMTDgFYpqulDf20lRRTmN7p0ThiBhXl15lCj6xJNIhxlHMK5ibtmA82XSYtyQ+j2hsnJ34lbDloji8zhEpz0Z+svapL37eBrjO9U2g1k3Roer9rWxdWTQ9jl/Gq5Ps8xSq7tRGt7B/8YySyfj3alA= 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=PqY/6+CA; arc=none smtp.client-ip=209.85.215.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="PqY/6+CA" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-b98e6ff908aso677858a12.2 for ; Wed, 26 Nov 2025 14:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1764195454; x=1764800254; 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=zt/vrs22IFRNV23j1sT0XTLeik6zpTMCFKyG7xgZ91A=; b=PqY/6+CAnpy12IwsGyQKGgcLJytH6cmOKqNp9oSJtcWLknjb4w93p1kwv19YxXFj4c w+CwgbZaBRE3huLJkPluEdMkOAuVm+CUFLMGG9U0ZwJpRpvU+7wC+HelP6q6i/BiTiWa sUre1XTS7JPAyDE5cLhoi/dBoy4W6eN7K2V2Q8jaPx10exbZ3jKhfTGScizo1rOHf1Fy qAsN5L6SLBp+tZhNByOmosj/RLUlvGEb97Sk+VjbyySv0PLpHdPWc5ApRM1flGizMSGT 4r9QkGUhH5JRWhwLvNSCF2Ti956xsmJFnnoCRpSCQsvnaiWzlTsq8/Ng8B3zyx52RPrl tkOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764195454; x=1764800254; 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=zt/vrs22IFRNV23j1sT0XTLeik6zpTMCFKyG7xgZ91A=; b=ebF5eif5cT4e69Pj8xQcYo28cjftBRLt3ADp8v+WACv9IaSjHQZbpAUD+BJWefBCZ8 QXBuNR1XSonCuWP0/kAZpW0OzTRrfsovqQppv2UPjPingS+j7mNv8doPdltL4J+xaBCU A3w5Kj6gwXx0s4wPc/iP7JQ0kDPHC4x1Jd2p11xojE+xGshWKWjSEWHGivs1B0dh1odT hPGcD2/jKD6U+JzJY4YVBzVrJqJCAmJnvb8aT1jEcz+RxsEb6Ng8cknmGn5OvzOrM1Ra pUL5F3V3VlBqWN0yuA1d7KgvJ4MGCEw5Tq8SALV7FdgXpDQRSA/lk1F2nyjZXg8iG8IW H7EQ== X-Forwarded-Encrypted: i=1; AJvYcCV/me13TbFXmaAgg1mSR4tBcWmDU5f9zwWbpimjn4SjfA2cTttb7FAbWxc6IbxV66DuwRYHV1pP7a/PQ1A=@vger.kernel.org X-Gm-Message-State: AOJu0YzZFPqGwlPjTAaGTmvTSyDQUshHYxCUIfKqd9lBmhXg1ANiqwz8 xIez1YQI/ZU/JaXUq4C6xqUO9I17TzliDVyOUtJo5zgh7El+f/p+LxetTnG2m7j+mphqf8Q6FL0 miizHnaj2c8OHYV6obfkEReUwZ6fKHw== X-Google-Smtp-Source: AGHT+IFIz71LhfTwWHL1z2gigA7hdTT4BwNN3sP1QkyaP0YT8yLO1AIMoS4BZJ/uN8VXCBLMXckv46l8r9Qy1fLWBAo= X-Received: from dlf18.prod.google.com ([2002:a05:7022:412:b0:119:c6ec:cc42]) (user=samitolvanen job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:6ba8:b0:11b:9386:7ece with SMTP id a92af1059eb24-11cbba58e14mr5798079c88.43.1764195453875; Wed, 26 Nov 2025 14:17:33 -0800 (PST) Date: Wed, 26 Nov 2025 22:17:27 +0000 In-Reply-To: <20251126221724.897221-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: <20251126221724.897221-6-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=1442; i=samitolvanen@google.com; h=from:subject; bh=WQcm0EHsw6PYPITVbaCdvvynX9VHge/XcXBmVFGe0zc=; b=owGbwMvMwCUWxa662nLh8irG02pJDJnqNaUG053rjder3zVjlW4vPdJ5pHaVQ9Pt/iLtuP7Jx qn65Uc6SlkYxLgYZMUUWVq+rt66+7tT6qvPRRIwc1iZQIYwcHEKwETU7zEybJns+mHy4+zTJ+U+ OG/aWnFd7Z5i07HzfjyvPNob+T6ZeDEydPQdDLx5/ObLqx/6jrd8Ktfcb88me3iO/qma+TP2s3B GMAIA X-Mailer: git-send-email 2.52.0.487.g5c8c507ade-goog Message-ID: <20251126221724.897221-8-samitolvanen@google.com> Subject: [PATCH bpf-next v4 2/4] bpf: net_sched: 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_kfree_skb() 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 --- net/sched/bpf_qdisc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/sched/bpf_qdisc.c b/net/sched/bpf_qdisc.c index adcb618a2bfc..e9bea9890777 100644 --- a/net/sched/bpf_qdisc.c +++ b/net/sched/bpf_qdisc.c @@ -202,6 +202,12 @@ __bpf_kfunc void bpf_kfree_skb(struct sk_buff *skb) kfree_skb(skb); } =20 +__bpf_kfunc void bpf_kfree_skb_dtor(void *skb) +{ + bpf_kfree_skb(skb); +} +CFI_NOSEAL(bpf_kfree_skb_dtor); + /* bpf_qdisc_skb_drop - Drop an skb by adding it to a deferred free list. * @skb: The skb whose reference to be released and dropped. * @to_free_list: The list of skbs to be dropped. @@ -449,7 +455,7 @@ static struct bpf_struct_ops bpf_Qdisc_ops =3D { .owner =3D THIS_MODULE, }; =20 -BTF_ID_LIST_SINGLE(bpf_sk_buff_dtor_ids, func, bpf_kfree_skb) +BTF_ID_LIST_SINGLE(bpf_sk_buff_dtor_ids, func, bpf_kfree_skb_dtor) =20 static int __init bpf_qdisc_kfunc_init(void) { --=20 2.52.0.487.g5c8c507ade-goog