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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71BEFC433DF for ; Fri, 10 Jul 2020 17:00:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E265207BB for ; Fri, 10 Jul 2020 17:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594400414; bh=pTyURjANtPqmaLJUbxYqI4qaMGNCNSURnp1G+dRkB1o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=hpJm7SM8fnn3gwOfnOJsdjlyvvF2jBr1Pk/Xd36i+4JdFpSipVl1M4usjcxHOuge3 nfU7opKMg66v7ilAxjQ9ZZeVhbQXMZ8i9vy23fv2tj3RKZI/RWVTTWd3sczn01T+P1 NEl5qqhqa/L/kz0MZ4nDnP0IaZXC1RWMQ9XJT+jg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbgGJRAN (ORCPT ); Fri, 10 Jul 2020 13:00:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:37342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbgGJRAN (ORCPT ); Fri, 10 Jul 2020 13:00:13 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E2D62078B; Fri, 10 Jul 2020 17:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594400412; bh=pTyURjANtPqmaLJUbxYqI4qaMGNCNSURnp1G+dRkB1o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HnVJiYlzf+9XFUcJO/ZGQdAlmlTzC3Tkxf6ranJEAFmIbPfLys7jyc358mBNCgeDH kSlcbtn0oWqnbYCzfDB7wXNOBo1XczhLcRRWiu4zOVOKOd2sPLZeItKhosD6xK/I1o vtHkuhEhhqlfkhTYVpWxorxK0HNq6FFcg2nQBtXI= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 7FF79405FF; Fri, 10 Jul 2020 14:00:10 -0300 (-03) Date: Fri, 10 Jul 2020 14:00:10 -0300 From: Arnaldo Carvalho de Melo To: Alexei Starovoitov Cc: Daniel Borkmann , KP Singh , "David S. Miller" , "Paul E. McKenney" , Networking , bpf , Kernel Team Subject: Re: [PATCH v5 bpf-next 2/5] bpf: Introduce sleepable BPF programs Message-ID: <20200710170010.GC7487@kernel.org> References: <20200630043343.53195-1-alexei.starovoitov@gmail.com> <20200630043343.53195-3-alexei.starovoitov@gmail.com> <20200630234117.arqmjpbivy5fhhmk@ast-mbp.dhcp.thefacebook.com> <5596445c-7474-9913-6765-5d699c6c5c4e@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Em Wed, Jul 01, 2020 at 08:21:13AM -0700, Alexei Starovoitov escreveu: > On Wed, Jul 1, 2020 at 2:34 AM Daniel Borkmann wrote: > > > > +1, I think augmenting mid-term would be the best given check_sleepable_blacklist() > > is rather a very fragile workaround^hack and it's also a generic lsm/sec hooks issue > > I tried to make that crystal clear back in march during bpf virtual conference. > imo whitelist is just as fragile as blacklist. Underlying > implementation can change. > > > (at least for BPF_PROG_TYPE_LSM type & for the sake of documenting it for other LSMs). > > Perhaps there are function attributes that could be used and later retrieved via BTF? > > Even if we convince gcc folks to add another function attribute it > won't appear in dwarf. Warning, hack ahead! Perhaps we could do that with some sort of convention, i.e. define some type and make a function returning that type to have the desired attribute? I.e. typedef __attribute__foo__int int; __attribute__foo__int function_bla(...) { } ? > So we won't be able to convert it to BTF in pahole. > Looking at how we failed to extend address_space() attribute to > support existing __rcu > and __user annotations I don't have high hopes of achieving annotations > via compiler (either gcc or clang). So plan B is to engage with sparse folks and > make it emit BTF with __rcu, __user and other annotations. -- - Arnaldo