From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.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 380E535B634 for ; Thu, 16 Apr 2026 07:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776325429; cv=none; b=Fnv+wQO2sW4A1y6zgBeIsGyPmUMBP0FsqvJy0D8Sl7oej8rCcQoBeMuVjad3k2/F4rZ/U/NHxzniXMJNEfHu1TVrBRVOBsUHETGXIVeAGQI2i4CjiEq4md3eemLaaYB0XYoKSx3OGZBkuMY5Ogoa0ElWIWI2U1f2TP1l2Qntz3Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776325429; c=relaxed/simple; bh=LURWwFmN6Lhm3n+L2kmQVrHIUNNBhmNaLACiuEKH+p0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=g1BFGolWvq92deTTtFgjFHhnjdAP4umfP+M5p2b5P/Ff5O+NLqThuDF4jRYfGvOR1HcgTbyvRw6nlFViiR2axSACWZRQ/ABxzlWJym6VEJKURsM1yQCEr/i+WfQoeJxaaZDaK+Yuv7UtbZ+guf9ABtemI8IDCWPlMjdrvzuf3C4= 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=bn8fPwRy; arc=none smtp.client-ip=209.85.210.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="bn8fPwRy" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-82f6b592fc7so662204b3a.3 for ; Thu, 16 Apr 2026 00:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776325427; x=1776930227; 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=LURWwFmN6Lhm3n+L2kmQVrHIUNNBhmNaLACiuEKH+p0=; b=bn8fPwRyteXquyoe2czMzelpphv20JKmOVwZFLTuQjA3eeXNWhUWbKC+o0jGCfNSX1 SwDzwyuZU5Px5N56RD2fZJA7X8n+njERrks/UuGUxmn/Ns6cjbft+96N0uoT2xXCUlil VoByaAf3cJNvuLiEjYUVZ9hVBKhuR/8Uf/POIgNIXr4Q4P4QceFBRkd7g5zQWMKFNbqF KD26+82auGP8kORuKPwexoHznD6GXwAU1ShnTUZ15NqDSSyE4yUQ8U7JblSBSPud933L 6LhfYmENYQV+eEOsqbxS2sssO/bvVd061jug/pUArd1AxmTges2olkpCtBTTgSgh8PtL LJ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776325427; x=1776930227; 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=LURWwFmN6Lhm3n+L2kmQVrHIUNNBhmNaLACiuEKH+p0=; b=Fx9yyVa2rmOs5gI9FLXPitPHnVfxcjgiaNxzJs79D78Qs5ISDleOPEJzIFzRP7hzHM bA6TTKa2FnBPEjAnJz1lfnNf/q7O9hLtQmdjsgx2f/F58dz9+13krtCONbg7vJJn/jJC cIXeuBKKU8icRnXs7yDQnnpNKUOyyvocs0K/oZtikUbwjX2hNNYQsl/hthhviWOFlvNN UhPkpcbtcMDH+vkU3SmGSS0vX/CKtHiW9Tivxi/NQFN3p9PEXWtuXyAbDGr5LhPEEUa0 24hvhwGEHfipMrh2yuqyjbbYKuq1+7Ncxfx11zCXYVc0Kk9NT/aUBFZcmNp3RkdoGpk5 pMAA== X-Forwarded-Encrypted: i=1; AFNElJ+qjwpazjYBiTBeMFxirE/66GuwX1mlM2bSgbjXUtabcldFv7kZzvuSW4iEAaR8aNlhtDflLv/psDunTog=@vger.kernel.org X-Gm-Message-State: AOJu0YxclFE8nVG7ie+OOmBwgR4uOliHhDMxbeGFBGZNgS5Pxd938BD6 WKftWYkCcMDSZgyZJx7V46nEiY5zGxyylHPT6jp26mXAtVK024dRHfN3 X-Gm-Gg: AeBDietB9AcX/6f4Ib/iKjLR/obCIAOzTYtXruDB7+ep1U5U54rk/t6avtHNFRGv+lr D93RPtv4PNwav24KjxSC8Duy6NBtNZwXHgglpuS6NfiPwjMYgPr5W0iLZ78cJal5RhfJXjJ/tbO qU+gfdOrNYORyJ9wvRc0W+QL3Xot4PBYMwcD2evhFl0KpgwtEEsIZFqwu+4MjjrgopQrplkDhKN wCnJU+NJcHDt7P9iAZP4X4C9WjOvN0IlptiAkkifgV7bZmazEwpUS9x1I7OXqKDJz7CWxMQ0zzQ dDamWYYlMSuPEHi1HJ9/9xHyVvJu/AoYzX8q0YoQf8inw+9oFPT/9bH3wYBgtqW6jRtnfFqshqa aPyKP1YLX8CcHDjCRSroPFJ8Oe9PEav9NMZ2KO/r1h/kiJeaEgo6QVdRBxEaLAIJsUmjkPD+gaq mCjVdtqA3hp4Smq9N3bD3RAuEkXVbH90tTlMtVMWSE97b6YAciLIc= X-Received: by 2002:a05:6a00:4b04:b0:82f:6bd2:eac5 with SMTP id d2e1a72fcca58-82f6bd35957mr5136022b3a.2.1776325427368; Thu, 16 Apr 2026 00:43:47 -0700 (PDT) Received: from [192.168.0.56] ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f673e38ccsm4366170b3a.33.2026.04.16.00.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2026 00:43:46 -0700 (PDT) Message-ID: Subject: Re: [PATCH 1/2] bpf: deduce_bounds_64_from_32 tightening with circular range logic From: Eduard Zingerman To: Shung-Hsi Yu Cc: Helen Koike , harishankar.vishwanathan@gmail.com, paul.chaignon@gmail.com, andrii@kernel.org, yonghong.song@linux.dev, ast@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com Date: Thu, 16 Apr 2026 00:43:44 -0700 In-Reply-To: <7tgaeg4mpuoage626jaxu6sl6yht2ace4saog7yyx33pope7xk@kixri3atcb5q> References: <20260410124035.297632-1-koike@igalia.com> <16990d86263fb24079e6f0b476a8854ec2366932.camel@gmail.com> <7tgaeg4mpuoage626jaxu6sl6yht2ace4saog7yyx33pope7xk@kixri3atcb5q> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2026-04-16 at 11:52 +0800, Shung-Hsi Yu wrote: > On Wed, Apr 15, 2026 at 12:12:45AM -0700, Eduard Zingerman wrote: > > On Fri, 2026-04-10 at 09:40 -0300, Helen Koike wrote: > > > Unify handling of signed and unsigned using circular range logic. > [...] > > Hi Helen, Harishankar, Shung-Hsi, Paul, > >=20 > > I think this algorithm is correct and covers all cases discussed earlie= r. > > I also prepared simple correctness check using cbmc in [1]. >=20 > Given the "Fix invariant violations and improve branch detection" is > merged and the original Syzkaller reproducer no longer triggers an issue, > teaching the verfier how to do better bound deduction (i.e., precision > improvement) seems less appealing than before, unless: There is only so much information that can be gained from 32->64 tightening. I think this patch-set makes such tightening as precise as it can be. Which is a nice property, hence I'd like to proceed merging it. > 1. LLVM produced program show similar pattern and was rejected by the > =C2=A0=C2=A0 verifier, which will be fixed by this patchset > 2. We're proceeding with cnum RFC as a whole, and this marks the first > =C2=A0=C2=A0 step (I am assuming this is the case?) This is likely, I'm about to share the RFC. > My understanding is that we just need the verifier to be smart enough > to accept safe LLVM-generated program, where as Syzkaller-generated one > is not as much of a concern if it does not causes any issue. cnum > improvement make sense because it simplifies the code, and could > potentially be the last time we have to touch 32->64 deduction (famous > last word). >=20 > Shung-Hsi >=20 > [...]