From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 2D7813859D4 for ; Wed, 1 Apr 2026 16:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775061774; cv=none; b=TAdACMlpmV9lun2rhusb6EXHHLY9cu6fTEyPLJsgd4IuuNSoQS7+px/BKV8SDH1FYfCidYLwc7cpR2YXXw7CpCyIAbZYiUOHSt3nS3W4aYcpgfqs8049kNHRQztUYzXc4lplRxmo7bdxE2ouHtAQtY31sM3hQrFis9c2cNNRnGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775061774; c=relaxed/simple; bh=bK5VcBzFH7seN9+AMOZbQhRoAWaOmgP6bggqWtU0CKs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=j5e4q0HtInEJzhmoLxrEdbTi2+HuX8uffiUIFTCJml5QYgSxiBuiduujNxKI3yPoEnuGsz1HQDucDyVywWf3+3aK+aoRKpUiz0UD5Vq1xepqwFrDAqkjQKmLuW0rVnG81nSrTLvVcIk0pbjXbWp6zIEKjPelOOeEoN6Eedd8A5c= 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=rxnJC3MM; arc=none smtp.client-ip=209.85.128.45 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="rxnJC3MM" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-48374014a77so86121965e9.3 for ; Wed, 01 Apr 2026 09:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775061772; x=1775666572; darn=lists.linux.dev; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=KV+tSC2Aqfk5AN8Gr0A0YOBmS6aIW69bjJ/AxSnLy9M=; b=rxnJC3MMbJMKYjewYWDZl2/DYsl7MRom50swJ4JDa6v1rXSRuHibjZ3wPYipDj/W7r 8qbcuRiyLS1tKqw/+7nf6ajlRycOCYstqcu2rQI7SHde2v/7tEi3eJk4hORuGLEGU096 XVSDq6hW/CC6kg+rbL93KRJsDhWA0f8s/qD9LM3GXJMzSNdadlgdZhwI08VuSFefFK8a tJF6cArDZajDDNv/3I9N7sPA0TitROIrCzwxTy5trycBqaHDu+lhIsrVbFWlur0chNF+ Jz/0Ftg0yLkoNsbcmm3rs4hLUwPQb6ccP+bTbKWuMsV7oQx+j6w5PGyRzZPm3rYtDicx mA2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775061772; x=1775666572; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KV+tSC2Aqfk5AN8Gr0A0YOBmS6aIW69bjJ/AxSnLy9M=; b=EF6gBlpIyf4i5Sb6eywh6NOeQ9HnUc0YutZs/FnP8QF+j+pXYaCUL+e6lqJbRDlSj/ UvxhnEoy8TK4egvIjjUB5CYQVafY1YaQpnzq0x6tiPCenIsBxJJUqCsIj2PtZpXCN/MB pGKouhOfy3MeVs/FeCZKRGoQYYy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Received: by 2002:a05:600c:a4a:b0:487:21c7:2885 with SMTP id 5b1f17b1804b1-4888355e52cmr77059995e9.5.1775061771400; Wed, 01 Apr 2026 09:42:51 -0700 (PDT) Received: from mail.gmail.com (2a01cb0889497e0077853c1cf79fe628.ipv6.abo.wanadoo.fr. [2a01:cb08:8949:7e00:7785:3c1c:f79f:e628]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4887c8b8e8asm44527295e9.25.2026.04.01.09.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2026 09:42:50 -0700 (PDT) Date: Wed, 1 Apr 2026 18:42:49 +0200 From: Paul Chaignon To: Alexei Starovoitov Cc: Greg Kroah-Hartman , Shung-Hsi Yu , Eduard Zingerman , stable , patches@lists.linux.dev, Andrea Righi , Emil Tsalapatis , Alexei Starovoitov , Sasha Levin Subject: Re: [PATCH 6.12 034/244] bpf: Fix u32/s32 bounds when ranges cross min/max boundary Message-ID: References: <20260331161741.651718120@linuxfoundation.org> <20260331161742.960922011@linuxfoundation.org> <2026040115-dose-aerobics-7c6d@gregkh> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Apr 01, 2026 at 07:32:26AM -0700, Alexei Starovoitov wrote: > On Wed, Apr 1, 2026 at 4:44 AM Greg Kroah-Hartman > wrote: > > > > On Wed, Apr 01, 2026 at 02:22:58PM +0800, Shung-Hsi Yu wrote: > > > Cc Eduard and Paul since they know this change better. > > > > > > On Tue, Mar 31, 2026 at 06:19:44PM +0200, Greg Kroah-Hartman wrote: > > > > 6.12-stable review patch. If anyone has any objections, please let me know. > > > > > > > > ------------------ > > > > > > > > From: Eduard Zingerman > > > > > > > > [ Upstream commit fbc7aef517d8765e4c425d2792409bb9bf2e1f13 ] > > > > > > > > Same as in __reg64_deduce_bounds(), refine s32/u32 ranges > > > > in __reg32_deduce_bounds() in the following situations: > > > ... > > > > > > Hi Greg, > > > > > > This patch is causing the following BPF selftests to fail > > > > > > #222 reg_bounds_crafted > > > #222/27 reg_bounds_crafted/(u64)[0x7fffffffffffffff; 0xffffffff00000000] (s64) 0 > > > #222/28 reg_bounds_crafted/(u64)0 (s64) [0x7fffffffffffffff; 0xffffffff00000000] > > > #222/29 reg_bounds_crafted/(u64)[0x7fffffff00000001; 0xffffffff00000000] (s64) 0 > > > #222/30 reg_bounds_crafted/(u64)0 (s64) [0x7fffffff00000001; 0xffffffff00000000] > > > #222/59 reg_bounds_crafted/(s64)[0xffffffff00000001; 0] (u64) 0xffffffff00000000 > > > #222/60 reg_bounds_crafted/(s64)0xffffffff00000000 (u64) [0xffffffff00000001; 0] > > > #222/79 reg_bounds_crafted/(s64)[S64_MIN; 0] (u64) 0 > > > #222/80 reg_bounds_crafted/(s64)0 (u64) [S64_MIN; 0] > > > #262 reg_bounds_rand_consts_s64_u64 > > > > > > The failure is caused by the selftests' expectation not aligning to the > > > stable 6.12 behavior. I believe the easier way out is to drop this, then > > > wait for [1] to land and pick it up in stable (or I'll try to backport > > > and send). That should address the root cause of what this patch is > > > trying to workaround. > > > > > > 1: https://lore.kernel.org/bpf/d4fe45f8bd5c6a48efd2ba3b66932bf7eb5aa020.1774025082.git.paul.chaignon@gmail.com/ > > > > Now dropped, thanks. > > I suggest ignoring the selftest failures. > The patch is necessary for stable and backports. > It's fixing a real issue. The selftest is failing because we're missing commit 1f8fe377855b ("bpf: Improve bounds when s64 crosses sign boundary") in v6.12. It's the s64 counterpart to the s32 patch backported here. In bpf-next, we have both the s64 and the s32 patches. The s32 patch also updates the reg_bounds_crafted selftest to cover the logic for both the s64 and s32 patches. If we backport only the s32 patch, the updated selftest fails. I can send v6.12 backports for both the s32 and s64 patchsets if that helps. There are a couple minor conflicts when backporting the new selftests. Or we can just cherry-pick 1f8fe377855b alone.