From patchwork Tue Mar 7 22:04:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Kuohai X-Patchwork-Id: 6221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2330996wrd; Tue, 7 Mar 2023 01:26:31 -0800 (PST) X-Google-Smtp-Source: AK7set8Xm9u6AAcgDkgY0ByAoqcSxHhlZJrphMgc1uH0zSMf+MnlCRkDgfapPwiWK2G7M7fE03y3 X-Received: by 2002:a17:906:bfc9:b0:88d:ba89:1837 with SMTP id us9-20020a170906bfc900b0088dba891837mr15634911ejb.8.1678181191163; Tue, 07 Mar 2023 01:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678181191; cv=none; d=google.com; s=arc-20160816; b=K1DRE42PeNbzmSoVSpmk5zwzVH28IqsRPluFrhIALdUE15z9cNx+paa9DzGdIE5LpF 9wspO6BTROdDf7INTgOSeXfyI+z71/1CJ+uDZZmJwGlHXR/Z0XrIBtx9NAI6t2q5ZYYh 0ANrw7bgEL91cjVSl307uGhZ8LLGgNvb2Hsx5YcEBPmyFRjv+g3zFKXO1QG2FZoMAOEp 6TLPDqYbOUF0QeuNN9h5/ubPKGKC0dWrSTSCBEBYyEonFnROpNKEr6w1skqoKCCwineE dF/yNjNGBN/d9KSH3D6k4sNR8isHvf/S8n33f1yyihFT4/Tiie++4KHyjGgY3HP12WCi OWVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xTk6zeYTVLA1JxKXO188AnmD/sC9nYozUwWUCCWlHik=; b=kU3Ckx1qsiuX+EkJk1yayEIQUW68Q71C3hQG3BejDYXxmmEOsBUUgxJfwMrjLXmFcu 4k0lNmVp//MCFfobotnXobcZg9sbJzHrCB8B6+Ud6QdOhzcsfu7I5cfePrVSnTIIDxyQ I0nHGU4n0lY1+IS/P3qxcEVDxjJ6b/ymUvf8CAqhT3ZDFxZ/vjVlR85r10md/31QJJMb EDKVQDllAqIc1wMu6HYiAtfhCWYsQagn2GWJw3s4++nmL9F910skBGlwRomri45Zqg54 0b2VaVPlBazAqochbVFBWGDsQngGWcpD4RBToZ7ZmFSjr1Dg5jrqMf3VQngdR7wl8iw3 m4WA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gu12-20020a170906f28c00b008cdccdc43d9si11841034ejb.695.2023.03.07.01.26.07; Tue, 07 Mar 2023 01:26:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbjCGJFX (ORCPT + 99 others); Tue, 7 Mar 2023 04:05:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbjCGJFU (ORCPT ); Tue, 7 Mar 2023 04:05:20 -0500 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F139932524; Tue, 7 Mar 2023 01:05:19 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PW8fg20jHz4f3jZC; Tue, 7 Mar 2023 17:05:15 +0800 (CST) Received: from k01.huawei.com (unknown [10.67.174.197]) by APP4 (Coremail) with SMTP id gCh0CgDXia1L_gZkc5mfEw--.53857S2; Tue, 07 Mar 2023 17:05:17 +0800 (CST) From: Xu Kuohai To: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan Subject: [PATCH bpf-next 0/2] update 32-bit bounds when the lower 32-bit value is not wrapping Date: Tue, 7 Mar 2023 17:04:47 -0500 Message-Id: <20230307220449.2933650-1-xukuohai@huaweicloud.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CM-TRANSID: gCh0CgDXia1L_gZkc5mfEw--.53857S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY-7kC6x804xWl14x267AKxVW8JVW5JwAF c2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62 vIxIIY0VW8XVW5AwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xII jxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjc xK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IY c4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI 0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY 0x0EwIxGrwACI402YVCY1x02628vn2kIc2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4 IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1r MI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJV WUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rWU JVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr 1UYxBIdaVFxhVjvjDU0xZFpf9x07joksgUUUUU= X-CM-SenderInfo: 50xn30hkdlqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_12_24, KHOP_HELO_FCRDNS,MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759700520466543243?= X-GMAIL-MSGID: =?utf-8?q?1759700520466543243?= This patchset updates __reg_combine_64_into_32 function to set 32-bit bounds when lower 32-bit value is not wrapping, and add cases to for it. Xu Kuohai (2): bpf: update 32-bit bounds when the lower 32-bit value is not wrapping selftests/bpf: check bounds not in the 32-bit range kernel/bpf/verifier.c | 27 ++-- tools/testing/selftests/bpf/verifier/bounds.c | 121 ++++++++++++++++++ 2 files changed, 132 insertions(+), 16 deletions(-)