Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp689677imi; Thu, 21 Jul 2022 09:04:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v1g0CUN0NCY0n5BojaN+9inGBa3oDuI8FUYjYZj6RNBPvRhd2C1Ogcmi5wuHyX7Qo1X6R5 X-Received: by 2002:a05:6870:32cb:b0:10c:289b:76ba with SMTP id r11-20020a05687032cb00b0010c289b76bamr5822978oac.72.1658419454213; Thu, 21 Jul 2022 09:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658419454; cv=none; d=google.com; s=arc-20160816; b=dei9rGQmJof9hvOJSjxnvHLOmIdzxB93rOQR0STsd/nkHRcdcurei1D8yV8E8wXfPJ O6c9PxiRp3cplD9J4GWF95zQb/R1A3nTSniMP/p8pwgPogotJJj+45kyx2WB7gA6xkX/ HuCKdwYQtGF9FJilpqecdNwyRjLYwqg0JYvS3hnMKnoDwqcBo3LditbIk2lObBE3mGo+ AuVG9XI74Gss3Dtu8Jj0mFtIwRys3JxK5IHgc2L13Dqf5vwxMR7SM/MkQ9GQ9+65c6N4 XldTgIbnvy9yzwldX/6i4GUky/gZ0sGh/ElNT4Qbw2iQXn53uVVlDF+DDDTpNYSLWX8K 1TEQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sacPSbtHxPkvSU7XP0J7Ei2CUrY8a0FAjmE7NV33lFk=; b=bIGUIIm4Q7liX2AaDV2OOeK76Bd5ZlJygTMpfPx/N+QLpQsW/rUGIgVdqqL6uyVxnV vkHqhkGw3nLiYlldb636Cx/ICCdK0HsZQ8epUy/d+TWAAhtn30pfW/743c0PyL9Q0SIB ASYbxDilt4i8J3QglkP5NkF2PzdPp0dxUJc7TUIy+dZvzoz895fx7hcz1RMoZwE+NR8S DpmveAFyg4f1JLpYz/LjgVKBuQquowLjzNEwMa9n53K4pOmItDq3ibVvKxyKkHWgt4fe zTI5q77QIgsT61BTcBht+m9/j9EZGcqa+1NERpG0Y0k65duReaTs6e9TOonU1kzkM+2O 2pDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WzaV7U81; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a056830411200b0061cafe11b9dsi2497026ott.6.2022.07.21.09.03.59; Thu, 21 Jul 2022 09:04:14 -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=@redhat.com header.s=mimecast20190719 header.b=WzaV7U81; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232822AbiGUPhi (ORCPT + 99 others); Thu, 21 Jul 2022 11:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232685AbiGUPhG (ORCPT ); Thu, 21 Jul 2022 11:37:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 27FAE8877B for ; Thu, 21 Jul 2022 08:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658417810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sacPSbtHxPkvSU7XP0J7Ei2CUrY8a0FAjmE7NV33lFk=; b=WzaV7U81xeFOQqSAHD3fR3rGN08FFzzAusw/JqJP9P9E3xpAyAtOHjq5A7M77rmJMsx+Dd y0zd892KLnvVWoNWHR8XISdnei7gNZSgGFa7Ny++qrKosoLs2TrAoPEVLvg3ow2+Jrl0XB H6/4ZAQs7pmWNOwZT5I5aGadqoWGoT4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-454-1DhWE6ZgOHuTRd5QbahEWw-1; Thu, 21 Jul 2022 11:36:42 -0400 X-MC-Unique: 1DhWE6ZgOHuTRd5QbahEWw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BDFDB2804061; Thu, 21 Jul 2022 15:36:41 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.194.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 758E82166B26; Thu, 21 Jul 2022 15:36:38 +0000 (UTC) From: Benjamin Tissoires To: Greg KH , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , Kumar Kartikeya Dwivedi , John Fastabend , KP Singh , Shuah Khan , Dave Marchevsky , Joe Stringer , Jonathan Corbet Cc: Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Benjamin Tissoires Subject: [PATCH bpf-next v7 03/24] bpf/verifier: do not clear meta in check_mem_size Date: Thu, 21 Jul 2022 17:36:04 +0200 Message-Id: <20220721153625.1282007-4-benjamin.tissoires@redhat.com> In-Reply-To: <20220721153625.1282007-1-benjamin.tissoires@redhat.com> References: <20220721153625.1282007-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 The purpose of this clear is to prevent meta->raw_mode to be evaluated at true, but this also prevents to forward any other data to the other callees. Only switch back raw_mode to false so we don't entirely clear meta. Acked-by: Yonghong Song Signed-off-by: Benjamin Tissoires --- no changes in v7 new in v6 --- kernel/bpf/verifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index d5fe7e618c52..92714299831c 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -5282,7 +5282,7 @@ static int check_mem_size_reg(struct bpf_verifier_env *env, * initialize all the memory that the helper could * just partially fill up. */ - meta = NULL; + meta->raw_mode = false; if (reg->smin_value < 0) { verbose(env, "R%d min value is negative, either use unsigned or 'var &= const'\n", -- 2.36.1