From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03B49ECAAD5 for ; Fri, 2 Sep 2022 13:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236173AbiIBNzU (ORCPT ); Fri, 2 Sep 2022 09:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238636AbiIBNyy (ORCPT ); Fri, 2 Sep 2022 09:54:54 -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 ESMTPS id 79C8D1573E0 for ; Fri, 2 Sep 2022 06:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662125307; 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=10S2baNmGpvfbB3rWC8TV3GU8jc51um5+NmqwLplTxA=; b=iLJZKQpSxZ7oz7VwUYQDKIMN5qpOtrpqHod7EPwT82RTaBsGNaiTXzp+wUAuODrujCzCbJ 90pNMh84os6Hq+iWSWG0Vju1J+WUrRHErxGkQQ7fZMPrJaFz165kTtdr3SFa6CfZb03hU1 3Ab8L2yrVEJmT3l+ftWghpqsneWJaiE= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-217-EJCBgUNrN6y-py4zVE7iBA-1; Fri, 02 Sep 2022 09:11:50 -0400 X-MC-Unique: EJCBgUNrN6y-py4zVE7iBA-1 Received: by mail-pl1-f199.google.com with SMTP id h12-20020a170902f54c00b0016f8858ce9bso1270053plf.9 for ; Fri, 02 Sep 2022 06:11:50 -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:subject:date; bh=10S2baNmGpvfbB3rWC8TV3GU8jc51um5+NmqwLplTxA=; b=Wkcdfs/2Dibdtaemn9B1EL5kd0BZaXzCq+EZ2dJrK7YY0r3uufaDyOAid6GjclgquX 4WgIM5OPYMNBvBnEr8X7VizCktCI7YsWwPmlFyDa9xBX2KmGBqwBvo6+FxfmWwyjgj7G 5CEays8LKCD+Rfia3SRZRMhr0dPpR53kKDuXRM1hWSWIfSlJ+vbyRv6xqiKr+8wTYnDU 5HA9a8hDh2UN7gEp0YwnGA0Aj0YnZmGaHqMkgbzzbf4F0qiJI+6MHKgsl9PaYhaHOehf EMbd2zi+SDdYNSexhMVoDWw05V6ONbzZEm1AdQkctG8dkrc5z09/io0S1kk8oHLm2MhG fOdw== X-Gm-Message-State: ACgBeo0coHVy1qkRP+DRR5VFfTVafqvyrBUftVEN+duHzUySllfKejs8 0lYpiMyp9Oth1WZlCa9bIrQGg1clGTkmnnwLfCEt1BibbZJHMBMwtbTpZTNuQICyKnIvxapDjuA XFqqUcl92TWHMaRZ789r3BL6yF6gXOdnj X-Received: by 2002:a17:902:b58a:b0:16e:f91a:486b with SMTP id a10-20020a170902b58a00b0016ef91a486bmr36558490pls.119.1662124309710; Fri, 02 Sep 2022 06:11:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR72EpfhkEK4ko7qYW4nPa0blgG/78lQfqmeZeVLgOOiuWSw4Fu8+YGj6zLNMt/u79Hm3xPofVjqghC/L9D7cM4= X-Received: by 2002:a17:902:b58a:b0:16e:f91a:486b with SMTP id a10-20020a170902b58a00b0016ef91a486bmr36558475pls.119.1662124309461; Fri, 02 Sep 2022 06:11:49 -0700 (PDT) MIME-Version: 1.0 References: <20220824134055.1328882-1-benjamin.tissoires@redhat.com> <20220824134055.1328882-2-benjamin.tissoires@redhat.com> In-Reply-To: From: Benjamin Tissoires Date: Fri, 2 Sep 2022 15:11:38 +0200 Message-ID: Subject: Re: [PATCH bpf-next v9 01/23] bpf/verifier: allow all functions to read user provided context To: Kumar Kartikeya Dwivedi Cc: Alexei Starovoitov , 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" , Network Development , bpf , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Sep 2, 2022 at 5:50 AM Kumar Kartikeya Dwivedi wrote: > > On Thu, 1 Sept 2022 at 18:48, Benjamin Tissoires > wrote: > > > > [...] > > If the above is correct, then yes, it would make sense to me to have 2 > > distinct functions: one to check for the args types only (does the > > function definition in the problem matches BTF), and one to check for > > its use. > > Behind the scenes, btf_check_subprog_arg_match() calls > > btf_check_func_arg_match() which is the one function with entangled > > arguments type checking and actually assessing that the values > > provided are correct. > > > > I can try to split that btf_check_func_arg_match() into 2 distinct > > functions, though I am not sure I'll get it right. > > FYI, I've already split them into separate functions in my tree > because it had become super ugly at this point with all the new > support and I refactored it to add the linked list helpers support > using kfuncs (which requires some special handling for the args), so I > think you can just leave it with a "processing_call" check in for your > series for now. > great, thanks a lot. Actually, writing the patch today with the "processing_call" was really easy now that I have turned the problem in my head a lot yesterday. I am about to send v10 with the reviews addressed. Cheers, Benjamin