Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2484965rdb; Fri, 8 Dec 2023 09:23:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtqiI86KkKsGcXvTM6lntOWxEnlnMl9cmBv9WU8vKMlz9lSqNEA/JBd3LEy34wMNX3axLK X-Received: by 2002:a05:6a20:158b:b0:18f:c3c8:effb with SMTP id h11-20020a056a20158b00b0018fc3c8effbmr576413pzj.21.1702056188491; Fri, 08 Dec 2023 09:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702056188; cv=none; d=google.com; s=arc-20160816; b=JgRRe4nrO3Xpewbysjrxb5TJJxj8nBJO/fYdYoJUk3H+vViWLqjzi4Ho/lcxbiFJtg 29t4hrWs9Gn5jRfR4htMhNMmt6wGVjPjQXyLv+vhOFz6U2UzHk25EalMVWj1fxJLxxi3 5Qbq3GAr6rN1P5hhZlskTzkpNSqLzZRYlVKwPq47MhBBGEIbUsVtj+QYSLRIzMLk2tBk P1Hs58w1nobf/b7dcZN9bJqbBANQEty9sNKXoYsDLCp07N8K6YweM99wH6iz6KMq9aMs 9bdCKTmX0+8YnNL5xusm4WFErTq9zsvbe27phrJAkD+ZGHSlAvfZwErE5FEqz2EMOfX8 mNrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V28FqpOL+oZWPnnuXFJFyawoJ5nIS3QYSrjANXac/eI=; fh=31pHNESfIDSRXSirSss2cSA7Q2Y3tA2WaWyHSS2Dgno=; b=GEvF9RHTK72OojDluiV3mGczaAm8nNpMMwVr9aAo9/aYGVHp7ISB5p6xSDyPohxIfN 5vIXU6qfTkYAMxuWD1QAo31uluRol/mFcHr8lAXPTQQMO2YFmpK0/SRy6jgEFXjdq1LK igd+vchwOFx54xfeWy9CApB3gfEtDQ32BCV0DLPev4AOQ2u2RTVfFjQxpL/aTE0ke/FF dLAWw17QF+GNUhsha0ns7HY0Y3vjRBeAhLn69+QFyGrqoqwoTfsdOUrriZQl8pD4OOn1 A7LRCHkbyHQZVaQH0uArrYecms1phaSGJpf8lmheC1PoNSLfRn5YRm91qUux/btVlywU +QPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UbHNqkRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u26-20020a62d45a000000b006ce99cc58a7si1830337pfl.369.2023.12.08.09.23.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 09:23:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UbHNqkRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 37AF380E7137; Fri, 8 Dec 2023 09:23:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574253AbjLHRWx (ORCPT + 99 others); Fri, 8 Dec 2023 12:22:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236017AbjLHRWa (ORCPT ); Fri, 8 Dec 2023 12:22:30 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D58419A2; Fri, 8 Dec 2023 09:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=V28FqpOL+oZWPnnuXFJFyawoJ5nIS3QYSrjANXac/eI=; b=UbHNqkRus+VeXqxGP09vb359cH 2Q/ZEqAjQU4IsYvHCMQxbyYEYrxhTuo3gNlyMc13ZpTy7FurwxlfYnyeyVDkDjthklMDFdHv1pk2O iWXktzpJ3MHht6J+8CJzFNs4XhJWPpe7r1gsueyYfHT+aGpqaquovUgnsujDTcrKtmsVXQZhAkhX3 MSmklMcr0V/IrT3Kb9WlygDyHLhiA9akWeqV9GmCO7S6JlbTqOHzZSk9q8AEFWqokE4RFo3ShjLBN Wc6sCSMhme6ocjs7BtVEOFRgo4Ltt1gOhE8YN6Q1c3Mrfepb5uEV/MLWuqzaQ0TRqBEzEgKeY6qtL tiKWKUbQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1rBeXw-0069mX-TN; Fri, 08 Dec 2023 17:21:53 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 89F2A3003F0; Fri, 8 Dec 2023 18:21:52 +0100 (CET) Date: Fri, 8 Dec 2023 18:21:52 +0100 From: Peter Zijlstra To: Alexei Starovoitov Cc: Jiri Olsa , Song Liu , Song Liu , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , "H. Peter Anvin" , "David S. Miller" , David Ahern , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Arnd Bergmann , Sami Tolvanen , Kees Cook , Nathan Chancellor , Nick Desaulniers , linux-riscv , LKML , Network Development , bpf , linux-arch , clang-built-linux , Josh Poimboeuf , Joao Moreira , Mark Rutland Subject: Re: [PATCH v2 2/2] x86/cfi,bpf: Fix BPF JIT call Message-ID: <20231208172152.GD36716@noisy.programming.kicks-ass.net> References: <20231204181614.GA7299@noisy.programming.kicks-ass.net> <20231204183354.GC7299@noisy.programming.kicks-ass.net> <20231206163814.GB36423@noisy.programming.kicks-ass.net> <20231206183713.GA35897@noisy.programming.kicks-ass.net> <20231207093105.GA28727@noisy.programming.kicks-ass.net> <20231208102940.GB28727@noisy.programming.kicks-ass.net> <20231208134041.GD28727@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208134041.GD28727@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 08 Dec 2023 09:23:07 -0800 (PST) On Fri, Dec 08, 2023 at 02:40:41PM +0100, Peter Zijlstra wrote: > On Fri, Dec 08, 2023 at 11:29:40AM +0100, Peter Zijlstra wrote: > > The only problem I now have is the one XXX, I'm not entirely sure what > > signature to use there. > > > @@ -119,6 +119,7 @@ int bpf_struct_ops_test_run(struct bpf_p > > op_idx = prog->expected_attach_type; > > err = bpf_struct_ops_prepare_trampoline(tlinks, link, > > &st_ops->func_models[op_idx], > > + /* XXX */ NULL, > > image, image + PAGE_SIZE); > > if (err < 0) > > goto out; > > Duh, that should ofcourse be something of dummy_ops_test_ret_fn type. > Let me go fix that. Next one.. bpf_obj_free_fields: field->kptr.dtor(xchg_field); The one that trips is bpf_cgroup_release(). objtool doesn't think the address of that function 'escapes' and 'helpfully' seals that function, and then BPF thinks it does escape and manages the above indirect call and *boom*. How can I tell which functions escape according to BPF such that I might teach objtool this?