From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 AD3E32848BB for ; Sat, 21 Mar 2026 01:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774057478; cv=none; b=QLQvrM1fbZJlbhtTXawJIADIkNsVufhP1OQx3kMuJnWo2eEX31tEi6kx1xkwo0PMvIwalZtQggWgHgCUSehbrX8s76/ILPO30sE8aGDjVBYQXj0AFybjP0UAnYpAYt/IvDGVVLyTaYl1nLJFih+UD3QiZUg1LfMWDhq81b7MSdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774057478; c=relaxed/simple; bh=MNCOi5/h443DIwoG6VbqkWNCnAEU+MPikOWLWIHFstU=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=HWIe7t64+UmOTx25iamp8RPHEq6X94Jxru/iyTKe0a1ghhc03R+978K7TNL/CT5KTGGmTZSkIEd/TOZf9BGLXE+7mnlGi8WQO3X1kKHHHr5FOWV1CtAp7UAWshd2/+4HR/vls/e5bwgAN7dXcT8Db3IbXdlSflhNcAVmHq066H8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com; spf=pass smtp.mailfrom=etsalapatis.com; dkim=pass (2048-bit key) header.d=etsalapatis-com.20230601.gappssmtp.com header.i=@etsalapatis-com.20230601.gappssmtp.com header.b=S7JVVOvo; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=etsalapatis-com.20230601.gappssmtp.com header.i=@etsalapatis-com.20230601.gappssmtp.com header.b="S7JVVOvo" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-8cfc2d1fdbfso163132185a.3 for ; Fri, 20 Mar 2026 18:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsalapatis-com.20230601.gappssmtp.com; s=20230601; t=1774057475; x=1774662275; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=l3hhbjOHvnbqGz2vwBIyGKF5DZ1+kS7uyDwWIovuGd8=; b=S7JVVOvolMPpJV8/J37oZcH70VId2TpkAzKTTE8bGDXR8ls6/ZLh3YzQNSFmV+CiiP Tpn4grhmegKJlrKEuEMrsjVFHdtxRYr7Lpik36NAHTvd8pnt+iJ4HL6Jy/xuGf/K1Vr9 GXRazMcn2ByCKQkc1HAoZ66Yv6fWN+mhzj8eOkaJlkIUvYxABMzv42qbyUEAr430Bn/b T9vQ34gtXrAw2NCFrP8mc6+BhDM9yPmKF8MVYoEWCbkKFdYOo0N92NlyC16ntVEWHP+v /0HFqLU1YimVST67AXdcG6Vb0DPcsoJAKpn/IgeCfp3pB6H7KW+c16ZyeF9nBCuK36FT mTwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774057475; x=1774662275; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=l3hhbjOHvnbqGz2vwBIyGKF5DZ1+kS7uyDwWIovuGd8=; b=FhGuQ4RDV+scgpfUDTihEo/FMEICWR1WoinaPMeylAsZ6lWcPLJk0wod+i6qssER2b Gy26qt6eY5FRy/PBicZzesv8Bf3uL6AysEABKOKsbxRuiNSzz9YOmGCJRfuMmE/66/KF 5l+Ibz712t1UbJL/Dwf4VB5aKTW/gIbcaBrMN+kczgqiAfJljtCZFc1uADEFjwSuNsLL NOEpYSwZp5Ixfx+s4wiB93T76O6ELVTQB5UER91DOlMHC1SvflDU1kii6wHIiNVtFkzQ Uqi6/2UP7tjFugH2w6yMIekQ55+v3/Q3EU50IHEjX9/sSKmlrkYiPekXQMgZjrLgqbxJ 9ABQ== X-Forwarded-Encrypted: i=1; AJvYcCV10Grr2YeEYxCsWW1f4cxx2eGhSTkU7ysNXHDPuSkgoKWX1rZhrp1ItLxjctFX2Mmy1APYvvNzfcdwRcQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzL52LIHkYvGoVjF5zf0NOm3cjFK1FGW5u1aiublFFrYFEEoYl7 mZfPqnInN+heO43lbrZ9/fACMtRsLhr2JE4/CI0Oy+I+nGUpWcNvffBN1kuOlSxKlrmfbn5rnSk b07WzLpI= X-Gm-Gg: ATEYQzwvJCxeGAwyCas7HCSBWTU4m04t4Xb9Sd99Luyt42SlLFu0nJpPkUhYsVp4a3l rJsnK9jVJ3o4tbvxt0beIwioS4XMhFcd+o9XT3qW/M17rd7md/EZd61BLXkL3mAOcWrc7V5/bVn O6wi1H464BofIrlpHc4EYrBbsGgZpPnRbAV+ajLts+nRDiPLi6vfwLLRs8mlITpPF7jGoYkpL2M jkkcECIMyONiyfBBlcNpDUOSt8fZFNwtIpYdSIttSmUM2n7iesOOIrz6SZLmho0tCDcKsPWNGyG wOB6j1FHYNsozyapmA7DCDS6fDAUUQWZOAqYImlVZbcUj/6tqZHljXfwTlOcr0+aW6hQ/6t4/YQ oMmG4OOwVIXW+C4GpxvWEl1DP9XJZfgM9PReOv5ilKdVQie9cg4wHhe4XKUnqkAmmlddJUbXbnh AMGppBeaFVAW/yoaGaF4TMgPY= X-Received: by 2002:a05:620a:708e:b0:8cd:8f18:d1c4 with SMTP id af79cd13be357-8cfc7f7fed3mr716959885a.56.1774057475400; Fri, 20 Mar 2026 18:44:35 -0700 (PDT) Received: from localhost ([140.174.219.137]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cfc8f5cd32sm294791185a.7.2026.03.20.18.44.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Mar 2026 18:44:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Mar 2026 21:44:33 -0400 Message-Id: Cc: , Subject: Re: [PATCH] bpf: Fix refcount check in check_struct_ops_btf_id() From: "Emil Tsalapatis" To: "Keisuke Nishimura" , "Alexei Starovoitov" , "Daniel Borkmann" , "John Fastabend" , "Andrii Nakryiko" , "Martin KaFai Lau" , "Eduard Zingerman" , "Song Liu" , "Yonghong Song" , "KP Singh" , "Stanislav Fomichev" , "Hao Luo" , "Jiri Olsa" , "Amery Hung" X-Mailer: aerc 0.20.1 References: <20260320130219.63711-1-keisuke.nishimura@inria.fr> In-Reply-To: <20260320130219.63711-1-keisuke.nishimura@inria.fr> On Fri Mar 20, 2026 at 9:02 AM EDT, Keisuke Nishimura wrote: > The current implementation only checks whether the first argument is > refcounted. Fix this by iterating over all arguments. > Second Sun's recommendation to add a selftest for this. > Signed-off-by: Keisuke Nishimura > Fixes: 38f1e66abd184 ("bpf: Do not allow tail call in strcut_ops program = with __ref argument") Nit: strcut_ops -> struct_ops Once you add the selftest, feel free to add: Reviewed-by: Emil Tsalapatis > --- > kernel/bpf/verifier.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > index 159b25f8269d..278443118a23 100644 > --- a/kernel/bpf/verifier.c > +++ b/kernel/bpf/verifier.c > @@ -24853,7 +24853,7 @@ static int check_struct_ops_btf_id(struct bpf_ver= ifier_env *env) > } > =20 > for (i =3D 0; i < st_ops_desc->arg_info[member_idx].cnt; i++) { > - if (st_ops_desc->arg_info[member_idx].info->refcounted) { > + if (st_ops_desc->arg_info[member_idx].info[i].refcounted) { > has_refcounted_arg =3D true; > break; > }