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 5AA76C433F5 for ; Fri, 28 Jan 2022 18:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350674AbiA1SwA (ORCPT ); Fri, 28 Jan 2022 13:52:00 -0500 Received: from linux.microsoft.com ([13.77.154.182]:45742 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbiA1Sv6 (ORCPT ); Fri, 28 Jan 2022 13:51:58 -0500 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 9399420B6C61; Fri, 28 Jan 2022 10:51:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9399420B6C61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1643395918; bh=jUz1vj3LTc4nxky/K07D6wr8fvEcSpU5/ssFz4z4Z1Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lvbGvOvrQkNC8NCKPz1Tr0PkCbQ0YOisGb+WePML4fTeR5kF6MJP5BBrDDIz8jDce XfydGHauwuFBYflYXCDPql8GE7Yx418XXlUdMv/t/+gprQ8n9NFabrRQY8ENPIGjSq Dqpqu22Ta2GPknyCpSHrmUziFjKaPMmfZKGxOuNQ= Received: by mail-pl1-f171.google.com with SMTP id c9so6895311plg.11; Fri, 28 Jan 2022 10:51:58 -0800 (PST) X-Gm-Message-State: AOAM532p/zmu9vWHqJ1pmCoVaNSv4zmuHBXu8HNFwVoVY6d//TuPxS64 HLmV/l5cXOp7NzaOigPYull59qR7CN1PB0qzp+4= X-Google-Smtp-Source: ABdhPJyXDI9twZ31dbqy14P/uFAhzQvWl8ehe9Ifkthejo3c3swvZgsDFKoH1rBIu7s6RRrPOhBpvpEOAFTFcZT7iIE= X-Received: by 2002:a17:902:e891:: with SMTP id w17mr9523373plg.33.1643395918172; Fri, 28 Jan 2022 10:51:58 -0800 (PST) MIME-Version: 1.0 References: <20211210172034.13614-1-mcroce@linux.microsoft.com> <177da568-8410-36d6-5f95-c5792ba47d62@fb.com> In-Reply-To: From: Matteo Croce Date: Fri, 28 Jan 2022 19:51:22 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next] bpf: limit bpf_core_types_are_compat() recursion To: Alexei Starovoitov Cc: Yonghong Song , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 28, 2022 at 6:31 AM Alexei Starovoitov wrote: > > On Mon, Dec 20, 2021 at 10:34 PM Yonghong Song wrote: > > > > > > https://reviews.llvm.org/D116063 improved the error message as below > > to make it a little bit more evident what is the problem: > > > > $ clang -target bpf -O2 -g -c bug.c > > > > fatal error: error in backend: SubroutineType not supported for > > BTF_TYPE_ID_REMOTE reloc > > Hi Matteo, > > Are you still working on a test? > What's a timeline to repost the patch set? > > Thanks! Hi Alexei, The change itself is ready, I'm just stuck at writing a test which will effectively calls __bpf_core_types_are_compat() with some recursion. I guess that I have to generate a BTF_KIND_FUNC_PROTO type somehow, so __bpf_core_types_are_compat() is called again to check the prototipe arguments type. I tried with these two, with no luck: // 1 typedef int (*func_proto_typedef)(struct sk_buff *); bpf_core_type_exists(func_proto_typedef); // 2 void func_proto(int, unsigned int); bpf_core_type_id_kernel(func_proto); Which is a simple way to generate a BTF_KIND_FUNC_PROTO BTF field? Regards, -- per aspera ad upstream