Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3469164rwa; Tue, 23 Aug 2022 05:23:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4tAxoO1T7AJSddhCyXmXDnEj1qY46656n1Y532x8w3oAMlN3P1sfttm1fKdHnVMSBMJgMh X-Received: by 2002:a17:902:ebc8:b0:172:549d:e392 with SMTP id p8-20020a170902ebc800b00172549de392mr24142422plg.141.1661257429915; Tue, 23 Aug 2022 05:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257429; cv=none; d=google.com; s=arc-20160816; b=Ephj3sumceZZZMjK+wcZylJbnGvjEVWr4yv+B//zlICsbRFNJ9oYn+iXI11oHNqnKm Cv51395azcpZs6kPLE63auvTY/SvYlKFhWkbZbQf4KHYRnWFnZDvJmZl7k0A++uYEU6N 4EVQuKqlGd6FwQfn+PXZwyVczqfG5FvyRQb1dLILSXdxAQsnbplu3qq1tBxkDlj+gxVx I6iBznlAxeMMBWssHKFa/VooTgggfrCPJnoerUFZkjbZEm17cPeFy2eUKsP+il8cxwq5 43IsRoDwUeS0HTqBgBZcoUjP2qZLIofS6qQX/jxCawkFKqcUxmVwFtBv8tOW2OP3SP07 sC5w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yXXRm/pcBdpcv1YmcONYg0ps88t1ck8AtKX7WsQzDg8=; b=lD75pKmGmVZiPzq6WCLWdcIP48E5fKixZxZvWdbwIA1TzBRcO/ynDPv8P7k5FfBzIE r4lieUpW86Iii8fZirKNNIcIkTux25btTdP2U9RcE2WBXvP+WsUvCeLfXRo4sUIVbs88 dh4fZH4Ougc+WDbl5IqifD4OTbkJKFfW4cRb/+lGwEsRdyw8WPzo/VwS++YNgP9NXuop FOtj6mbTfErGw/PuXy5OmrFBYm4ZBLg+l9KwKLk4bphbQBbkvKgOT6ICg+KkO0v8WDzb vAcC/2ufkMf6Auma9j7sLVvWjN5qcv34YAfbudQx/RfWM3IjRJvhg57+SXs/gzmuZAGu F24g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d7yDFRzr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b0041d70afeebasi8829634pge.652.2022.08.23.05.23.39; Tue, 23 Aug 2022 05:23:49 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d7yDFRzr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355483AbiHWKcQ (ORCPT + 99 others); Tue, 23 Aug 2022 06:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354203AbiHWKQy (ORCPT ); Tue, 23 Aug 2022 06:16:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBC2580508; Tue, 23 Aug 2022 02:01:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF07BB81C4E; Tue, 23 Aug 2022 09:01:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24EADC433C1; Tue, 23 Aug 2022 09:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245273; bh=hr/Pn1MtnmU1uTRaC0OALxO0Ji88TLf/S+Ck1P6grus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d7yDFRzrIsdN5CUqLGP2QQGjrVMmVo6uPXqyCdq7Ur2IbjLkBAzhLuiBXRwiyx3cc jPzBiKsvYqF/mLOgZZfZmiltXUG2reHu/r67ypFNqF5yFG3MtmYRWzgxOKXEaXQJ2i ggf3M0IKGTd7ZfdPBQSV0viB1cVaKxYaYLfAmlCc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Jean-Philippe Brucker , John Fastabend , Alexei Starovoitov , Ovidiu Panait Subject: [PATCH 4.19 026/287] selftests/bpf: Fix "dubious pointer arithmetic" test Date: Tue, 23 Aug 2022 10:23:15 +0200 Message-Id: <20220823080101.156298170@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 From: Ovidiu Panait From: Jean-Philippe Brucker commit 3615bdf6d9b19db12b1589861609b4f1c6a8d303 upstream. The verifier trace changed following a bugfix. After checking the 64-bit sign, only the upper bit mask is known, not bit 31. Update the test accordingly. Signed-off-by: Jean-Philippe Brucker Acked-by: John Fastabend Signed-off-by: Alexei Starovoitov [OP: adjust for 4.19 selftests] Signed-off-by: Ovidiu Panait Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/bpf/test_align.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/tools/testing/selftests/bpf/test_align.c +++ b/tools/testing/selftests/bpf/test_align.c @@ -475,10 +475,10 @@ static struct bpf_align_test tests[] = { */ {7, "R5=inv(id=0,smin_value=-9223372036854775806,smax_value=9223372036854775806,umin_value=2,umax_value=18446744073709551614,var_off=(0x2; 0xfffffffffffffffc)"}, /* Checked s>=0 */ - {9, "R5=inv(id=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, + {9, "R5=inv(id=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"}, /* packet pointer + nonnegative (4n+2) */ - {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, - {13, "R4=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, + {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"}, + {13, "R4=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"}, /* NET_IP_ALIGN + (4n+2) == (4n), alignment is fine. * We checked the bounds, but it might have been able * to overflow if the packet pointer started in the @@ -486,7 +486,7 @@ static struct bpf_align_test tests[] = { * So we did not get a 'range' on R6, and the access * attempt will fail. */ - {15, "R6=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, + {15, "R6=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"}, } }, {