Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp629888rwe; Wed, 24 Aug 2022 06:45:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ZzbG5HBL4ND2Qy5MMiyPhpysMObBCaWglN4nx3Djp4edB7DtnBgL7xjU3aQSJOxHeON5S X-Received: by 2002:a05:6402:4148:b0:440:cb9f:d10f with SMTP id x8-20020a056402414800b00440cb9fd10fmr7718674eda.77.1661348725929; Wed, 24 Aug 2022 06:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661348725; cv=none; d=google.com; s=arc-20160816; b=bFBczfgQDrUAX4q+e59LzXQKHOu6qEXxspel9fbc9yVryDr6gKbpxWUMauFAt30IGn AML2qWAHyAs2JkxuzMG1mu+Q1ras8mP5aEgptgGPp2pFJxPPJz8LxzkiZlRN63uG3L9I Mk7rtC9AVTbK2tadOCqiSx7VGW+qvsq6nwhe6dywBHOCFqzHM6xg0jsgMufevCJ0H1q8 eR2RP4vumPFIDqZOz3FRH5c568/cj12lJSf3gBEsbxjYbO3IBD1MWZlPEL5uEi15sgFJ fMLS3LfCgBT4DujQNuErbakoiIH02ZfwMLwx664NcjstQ7idW9GklZY41d8oZuuuq8WF DbRA== 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=Hd4NEvNCo36madfiGUq27AHUBCLiiaP7gh+1jZ5mLiA=; b=Zk9ELnfZpC+UwmvB8JGmztvBu/nTpFpjytyw4UQrOtxv/sK/vvOUSF38vjvISvhxRb OjCcV59vc9NGkrMmI7W1Oc1jZdYCGRRAS437zbBBEzytHbRBHRa0wiD0RcFhOYyHxq/O GzIXSQIbIxOTjoxdCc+HPvxznP2PjEYGdxykneiZ3+D4RAY2qjsBNpG29WaitzcCPbZN +E90PZJcAtSRRFr0byAIBNqQ0EFRYLL1xerYkopIn802itaaXk/eZEpq+MQDcAVd3qqJ Yk0kfMzSNN/Fwyoea/lv2vjBl1KJfBUdUJpCKrXIwo9VeevlCB4kJeUugpTOUJWuQjA1 hP0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UDSVqMpl; 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 hu9-20020a170907a08900b0072b7fac8a7asi1778102ejc.926.2022.08.24.06.44.58; Wed, 24 Aug 2022 06:45:25 -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=UDSVqMpl; 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 S238412AbiHXNlc (ORCPT + 99 others); Wed, 24 Aug 2022 09:41:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236296AbiHXNlV (ORCPT ); Wed, 24 Aug 2022 09:41:21 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF087E306 for ; Wed, 24 Aug 2022 06:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661348474; 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=Hd4NEvNCo36madfiGUq27AHUBCLiiaP7gh+1jZ5mLiA=; b=UDSVqMplyuD0vyLhuP6navxeyLdzRPmR4kHAgQMuqS9Yk6GlptjUU1khLtWoJF95GLkIRH MtOew7NY1AHXdUk6nFM7QJIlGVpJPLUtYwFodrh/D87OdH7DyVThh2JftGI23UPV3TidFP 3k8/XG9fel13Ef/+0kJxvnBuI2u7bkc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-397-FtHJDKsrNF6bE6ROAf5lrQ-1; Wed, 24 Aug 2022 09:41:10 -0400 X-MC-Unique: FtHJDKsrNF6bE6ROAf5lrQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41357185A7BA; Wed, 24 Aug 2022 13:41:09 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.192.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 248AB9459C; Wed, 24 Aug 2022 13:41:06 +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 v9 02/23] bpf/verifier: do not clear meta in check_mem_size Date: Wed, 24 Aug 2022 15:40:32 +0200 Message-Id: <20220824134055.1328882-3-benjamin.tissoires@redhat.com> In-Reply-To: <20220824134055.1328882-1-benjamin.tissoires@redhat.com> References: <20220824134055.1328882-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 v9 no changes in v8 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 d694f43ab911..13190487fb12 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -5287,7 +5287,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