Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4272349rwe; Tue, 30 Aug 2022 07:26:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR6s7gReWrobUOI0B61H52j6RZGJA3foZxvobmR2Tdwxubic6KRja9X5ORAeISOIUoHxO7iS X-Received: by 2002:a17:90a:c02:b0:1fb:b69d:140f with SMTP id 2-20020a17090a0c0200b001fbb69d140fmr23803608pjs.139.1661869605258; Tue, 30 Aug 2022 07:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661869605; cv=none; d=google.com; s=arc-20160816; b=XdPel/IQR82Y3s03yfrNR01xHJsy3IJ1oipPIR31D6NfO7dADawv6fNdwr7Q/SeUuc Jh/eLJjwsqO7nqS3hAZ4pI+qqDk2w1mvt4rRYwfwtSjcwW1m+ajnDL85Av7+LBM21fjJ w4CAEeH4BQULFAs2aZkfqAHPOQ0RGuf/7nTmkjAcV/53Xn8KvAwCv8s2XZZHn5GJ95FW HcSc1fQhi/ZloblwCPMQ+ecXJt90rq8a7D2i71vl8EK/CnDiU//c9Ep/eTvHMSNXufdc yDTclgNspMBYiwFep52MlQ1TTj1sGv79oHcuBX7wIe2U9Yt5bxQU06wGd+fKZy4BHrhj A8/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UJVr43uWt8PVxH448vHnmIse/JFMIMR/CqYNuTX+I0E=; b=WbwfXO0ULBAwMEYKfndkDkYoRNVUV/8y5KXmWEnQFZV2XsNO/hlzA89zJb/+d+X0t/ WRP/tXda7iuBh9N+sanMbOSAOVi7xjpXU/WoB4Yt73m2MgOIUX8jLSZdnO8445AwDwC5 9xd9IrgDK8xPQwiL9HltVKkQA8sSQ19KZVtzDHK2pYmAuG6aWxaEFMm6QOT7c3zyn5Dw q7Me9gAloTy9vwIT4RdPPgcOYbaphRVBQSBiBV1BeGzE2gc5N+12j5CZtXkSSPqJY+uH qXfoGVmmA1M9sveLbpL3KqewYnSOzERwiex+t3OgoughluYwYlnELPrK8oGyVeTRtYHm C1aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KI7ulRrj; 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 f10-20020a63de0a000000b0042a3636816fsi2259102pgg.168.2022.08.30.07.26.29; Tue, 30 Aug 2022 07:26:45 -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=KI7ulRrj; 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 S231290AbiH3Nx1 (ORCPT + 99 others); Tue, 30 Aug 2022 09:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231292AbiH3NxD (ORCPT ); Tue, 30 Aug 2022 09:53:03 -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 17603BE1A for ; Tue, 30 Aug 2022 06:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661867525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UJVr43uWt8PVxH448vHnmIse/JFMIMR/CqYNuTX+I0E=; b=KI7ulRrjwIRswM84L4UQTjrai6STk1iriWRqGA6jCAUemjt/O/Jq4GL3eh1lR7kBuzEmLk LwFT+I9gvzmHpe3KaRWBzMKmqDIrRpbikUdgomMjuEvipR5DBWZ5mn8ydYmFoqk+zuGlEq uloRZ/DfE5tRMfnv6hS6qKdl2wNwfFU= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-371-j2A3FOOlPpySpBLHblOpvQ-1; Tue, 30 Aug 2022 09:52:03 -0400 X-MC-Unique: j2A3FOOlPpySpBLHblOpvQ-1 Received: by mail-pl1-f198.google.com with SMTP id a13-20020a170902eccd00b001730da9d40fso8091855plh.10 for ; Tue, 30 Aug 2022 06:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=UJVr43uWt8PVxH448vHnmIse/JFMIMR/CqYNuTX+I0E=; b=mzELNixOl/S1MIky43oS7bLpB/jDSnKNMx7sUsrrc7ePLOKem8Czo37dJj+FXuZnum CXy7ZTjbyM602piXfUvfnJCVQ97ks1uFxrtUOVeevpFKDMwZeXmHJxYGwevZxohv1qZi QjhmyW8mUFwgCQxF1V00l/tUS7qAV8JAyyM8X7lMyIxRX0E7zGwJ/3Sfr8MvjTfaAkPO PhSjEKvrhwg5zvaSR9TdxY7gGPCpAaxXvEbHemESi6S4p2RSxy+Irghivn6yBBoXP4Qr 0VCM8K6EFXvlJ8DKaDjoDuJHRljNl0j+QfqZTxYW0fMotHOF1KO9Naf97z+yQY1K99EW imRg== X-Gm-Message-State: ACgBeo0sKsHY/sm2UDcwJAVhi6qx428WnoXzh6oB8pBjKC5hMOWqRIyI JoWmb3YUh5w2NbWwclRI0Ar/omvSA+oKGA+x6o+XkT1F+zmDdtAvFYgPLp6NJBeUHduzt/qcEXX X+TRSsqgD+xL2RSqzBYT2K0L/79CLTuuBezynd0TX X-Received: by 2002:a65:6255:0:b0:42c:87b1:485b with SMTP id q21-20020a656255000000b0042c87b1485bmr3977295pgv.491.1661867522197; Tue, 30 Aug 2022 06:52:02 -0700 (PDT) X-Received: by 2002:a65:6255:0:b0:42c:87b1:485b with SMTP id q21-20020a656255000000b0042c87b1485bmr3977270pgv.491.1661867521925; Tue, 30 Aug 2022 06:52:01 -0700 (PDT) MIME-Version: 1.0 References: <20220824134055.1328882-1-benjamin.tissoires@redhat.com> <20220824134055.1328882-3-benjamin.tissoires@redhat.com> In-Reply-To: From: Benjamin Tissoires Date: Tue, 30 Aug 2022 15:51:50 +0200 Message-ID: Subject: Re: [PATCH bpf-next v9 02/23] bpf/verifier: do not clear meta in check_mem_size To: Kumar Kartikeya Dwivedi Cc: Greg KH , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Dave Marchevsky , Joe Stringer , Jonathan Corbet , Tero Kristo , lkml , "open list:HID CORE LAYER" , Networking , bpf , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Doc Mailing List Content-Type: text/plain; charset="UTF-8" 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 On Fri, Aug 26, 2022 at 3:55 AM Kumar Kartikeya Dwivedi wrote: > > On Wed, 24 Aug 2022 at 15:41, Benjamin Tissoires > wrote: > > > > 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; > > But this is adding a side effect, the caller's meta->raw_mode becomes > false, which the caller may not expect... Turns out that I don't need that patch anymore because I am not checking against is_kfunc in the previous patch. So dropping it from the next revision. Cheers, Benjamin > > > > > if (reg->smin_value < 0) { > > verbose(env, "R%d min value is negative, either use unsigned or 'var &= const'\n", > > -- > > 2.36.1 > > >