From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 020023BA225 for ; Fri, 5 Jun 2026 09:47:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780652864; cv=none; b=YEMwjr0n7PyF2VFnCwMhWZShw0DxSiGngICqUhUZ/fTGj1/QPSoHxN9tHQ+YG9lzClNpK7r+ajMsQSF22qucYdrzJDh1fzZbaiJakuimywZTlC34rhpufgyLT2PR2kWhXnvVIBCjjbUY1tqIhtV6HqwKHkTo07hL48O5up7xSMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780652864; c=relaxed/simple; bh=RMLKSBf6td0blMo/wVsTeAPKKkNErN1kqNLPI9HYRUg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=VwJRDamja261S8/u6fe4OoMX6J5DxiwFaKvdJp22UMtDmwif2wQHNLmPhkvYjG4N0oCFoGPFwBg6FOMuX6j0CaCulPai+MsmwxcziAeAuY1j//a0AuDm0I7mObDvyAXJeyZriEAej+06zq89/KCYw8oPZ5URSbpMB53dzKbNV8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=scXglLyP; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="scXglLyP" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2bf18c30bb2so11745075ad.0 for ; Fri, 05 Jun 2026 02:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780652862; x=1781257662; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=RMLKSBf6td0blMo/wVsTeAPKKkNErN1kqNLPI9HYRUg=; b=scXglLyPbY6K/tARilugvxthvt4HPQsFqVwUnDa267LNnSRkINOs3Qao1vLepMhU4j ViiWg8Elha9BqtGAiadYENzvAURYQt2bFENA7BidFdeuOJJ+jLlWImRaLbTJfEwDTTrX aBiijmfENBMzUgEshFkPR+HM5XFr9uM5pnIeYRJS/w6LccMk1lVeV5Vj/DFyTTjFlUnW 0VgzyxixiKhr+czvlVroUVLZYxx0/+LdEjGSpn2vXRXQrrdGJjG/fgmDABE/MBeWJ3SM lonQvsFeVcigB6aFzY3QhxISfGc5Lc1syxTEJhdF5Tw8SNRJYtpvWn7ZLdpoNWCEv5nE E6XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780652862; x=1781257662; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RMLKSBf6td0blMo/wVsTeAPKKkNErN1kqNLPI9HYRUg=; b=imqW1LCYe+DvLtAXePd597YsLUtkHO1lUSWy77Sopt9dqP3UykYOnj3vvJl+EpbxgR OTodr/lHG0/z6ANKK3xrUoKbxZ+gnPn7RpzJcwvKKJWy7UJTrHbfDlmcnunwiH5JmOfR jVQqfGgKt+WZAGTzaZ0/dw6I4f9Qbo9H4O7NoFGVF7PxNuhKsdhiDHXjzGAy696ESNfm 5B5haFV14XLvP1cLibjM6ivtuIw3OwB5z4za30Y9AFeHtMUJCEupFOoaQuPK/4XFb62Y DFGXucGgnqjN09qBs5mMHba2yuGZSFczHGcpeFJFP9+07T0PXgBig4aq3fIdIAbynDjf ShHA== X-Forwarded-Encrypted: i=1; AFNElJ8fn7kt6tSuociwJZmi0HwIKFRatb2eemIQXn5J/DB8DJgjXFPQFCSi0YrJq7BXiMuFYGDWJlY84PAbIPA=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1TEviZiKt+nVH1j/Fn1TAz+oV14qEsxrzYJdFBp+UFsZ29Seu 7r533cYNCVPwCE1ePLlySeppWJ95f/i2nFt3LgB3r+nnzzPcSExNWRQ4 X-Gm-Gg: Acq92OH8imV0m3bt+n6ou7vEl8h7OU320P3toSNmPcrxsWt+2Z7CdfNJrnCo5UxXX9v +qMeDmw+cNwgLYNe83SxLTfqavxd8J2Rxk9sMpTB6Zm6/5btDypMkLP5aQkYrbJE8wshoRKIGnE gymm69yB63kgq8FizRYJMbZIzWEoeMpeS89ky8ILQJ7veTVg5jC86kCBn4MoUXouG9dWr4CT2/p Dy4nOh3pxBSPFjvd2G60XgNvTYecazE4crQbLEo9YKsgpY+VanfhAF+i7U4CCks6teHMX+WCTmz KLWE4m8fZRxnBompZO8ppAfCGXq3AZAJm6++Oa575yeTT7o6z3JArFop/6H2nYFwQJtBVy8H9do X8uLF1c4T8ODnxmUuZA2L7A+Mr6tOy9p7iWZ6OSxe5T1yDlFM5Ry2bug4owEFZR0saXo6L+RfVg 9wvpJSWXqaJEta5saECibYBs+HysnWAI0Y1BwlhyEjo2LCU+wbaqcjtl7M/tmKvw== X-Received: by 2002:a17:902:e5ca:b0:2c0:b932:867d with SMTP id d9443c01a7336-2c1e893d0b9mr28693575ad.29.1780652862144; Fri, 05 Jun 2026 02:47:42 -0700 (PDT) Received: from [192.168.0.13] ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c16609e2e2sm84127505ad.49.2026.06.05.02.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2026 02:47:41 -0700 (PDT) Message-ID: Subject: Re: [PATCH bpf 1/2] bpf: Keep dynamic inner array lookups nullable From: Eduard Zingerman To: Nuiqi Gui , ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org Cc: dxu@dxuuu.xyz, stable@vger.kernel.org, John Fastabend , Martin KaFai Lau , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , Jiri Olsa , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 05 Jun 2026 02:47:38 -0700 In-Reply-To: <20260604151153.2488051-2-gnq25@mails.tsinghua.edu.cn> References: <20260604151153.2488051-1-gnq25@mails.tsinghua.edu.cn> <20260604151153.2488051-2-gnq25@mails.tsinghua.edu.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-9 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2026-06-04 at 23:11 +0800, Nuiqi Gui wrote: > An ARRAY_OF_MAPS can use an array created with BPF_F_INNER_MAP as its > inner map template. A concrete inner array with a different max_entries > value can then replace the template. >=20 > After a successful outer map lookup, the verifier represents the > resulting map pointer using the inner map template. Const-key lookup > nullness elision consequently uses the template max_entries even though > the runtime helper uses the concrete inner map max_entries. >=20 > Do not elide lookup result nullness for maps marked with BPF_F_INNER_MAP, > because the template max_entries does not prove that the key is in bounds > for the concrete runtime map. >=20 > Fixes: d2102f2f5d75 ("bpf: verifier: Support eliding map lookup nullness"= ) > Cc: stable@vger.kernel.org > Signed-off-by: Nuiqi Gui > --- Thank you for spotting this issue. Acked-by: Eduard Zingerman