Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2748232pxb; Mon, 31 Jan 2022 03:31:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxmj4D0fFBurr7+EtNq2llsPI/SrnQUCke1pBL3KJZEjG6e1txNpp/72Hr8Lcnb1sviwFJ X-Received: by 2002:a63:9143:: with SMTP id l64mr16496234pge.554.1643628713760; Mon, 31 Jan 2022 03:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643628713; cv=none; d=google.com; s=arc-20160816; b=sc6gY3levZG3tTgmBrKrAvNo3bIg3jApzFpeonx/28LUjCCbHU+Kj7v5l7FZo/C1oA sGTrY/5gJczczsYsbEF8KSY1BcA0QwDvSvQM3RXPstUlVpgmWQ9lGl58cISGHQAF9vQk 6DkZOyQAGXgIkOp1opd5UW5IJkcxQiCFegCUOpSjXTqQJe31uM9FyBVDtM0lVurLKs+d LcEmgyB80umsKC3cHbq96BwmHnyQn6XGl8Sz/K1ATG78wDMnC3Yf6mBi8nqAul2jV4k/ JkkIhGCpXU9wCoIXxoFjFwaNeoWmCf7ydGBqbuAt6wiZCMLvOTFbwZUpK3LokjhQEMpn kPag== 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:dkim-filter; bh=jUz1vj3LTc4nxky/K07D6wr8fvEcSpU5/ssFz4z4Z1Q=; b=XlUCGaH0YvlA78GRjfsTLLxfj6kukU7dQCSNGJGx35kWib+nYUpKdqmTT6Sgjck0tT 4mIz7Nu+3ap9HFec0Tb5IfZhs9UNVdt7PLxoY8CMSx8PMv5ZBoXus5nRxmeRrCyBGVco wU/C7eaRLfOK2Ag3t9clADu4DhTl6NO8jdrMBokJQ3TnUIyaER1kSbp6pnaY/F5xHPrM 0C856gyRG1A60Zb5bd8rKAs+kgJlTkKFP03YiXhtVX1p51SeNYr7rYV/QaElt77yByXJ 236jpWiKRuIj1JXXXEkKmtQIV1Snmbx9tUPhnmasfAKD9l7+ovvmXDvWgyNqzFVtuFyR R5FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=lvbGvOvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s190si12758023pgs.76.2022.01.31.03.31.42; Mon, 31 Jan 2022 03:31:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=lvbGvOvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350667AbiA1SwA (ORCPT + 99 others); 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-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