Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2630251rdb; Mon, 4 Dec 2023 03:12:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbC8rYfFpNsCyryY1ODTegBIAYL5aHGteEj1AOkQyRlgbmzJF7arFc76HLFjrbCNJcHXVP X-Received: by 2002:a17:90b:4a08:b0:286:a2a3:1e56 with SMTP id kk8-20020a17090b4a0800b00286a2a31e56mr700782pjb.29.1701688352535; Mon, 04 Dec 2023 03:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701688352; cv=none; d=google.com; s=arc-20160816; b=QTQNGgyNLrvsgI5/kM8YSM2Y4idB6yqfBpb7JE4CyMveJQ0cIkRGndYVH5TFxor/Bw /e7KjAYSaD/LOURKkzUio+9xAiCPk/sZfpqk4Xc/POBjcEqAlYgqY9aHXn2Yit9Lnp3C xh/QJg6ef447j6LYocHGE7jmmQ2dCTj6wrIh6uVSKZ2jm4hPp0upSSMzw2AN0aYMOtUl 0h5ZFpSDUFp0gxQwUagDxp7wlIe1JXK75nQNfDphH4eLosyk8b0IdRHnPGrVp4APD7F7 Vhh3qcBOkIFi7xk03rle97xOJx5oTDzqM1wmJkJ+L3APf3thjvuwtDmb0mJG3bmrto0v 6CtA== 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=57qN1iQssrdoPxO3vjOJxY+KkICDSFEOHy7vEhypSQY=; fh=jpJmDfseQLLi9201SgBoJxN/jukEaMZLkkomvjEx4SU=; b=tvTKh1opgoPxEgV6ZbaySHKcQBXfEC17l93tqYT/FQrWGGE2MRJUCUX0URXke9fNfN CB2bdaa3yk+Q5YVMlkqx7fN2ABLe8GLF3xVgl16O5YZrGRjrLJW1Y61wEjAZNTeDVln2 G1Qrx+LYgC1fOfuKgkxTyPoXdGL7u7BaxW3O0aA3HM57CwMjFdYRw0MACz8eGi9oFa9w EyAdtfep5mEhzojDJ+7iRtYGQodxaWKqykLXoSv3tu/fvXLu4HiwwQ/Mitxhfhvalh+6 aABWxYp4pjHbBuvsippnzBzMaVDsTBGrtGoJdHdx8WAJqjKchFSe++OZ4RA3OeSMJC8j UgnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=SJZWmelL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id v12-20020a17090a898c00b0027d04b581dcsi3055812pjn.72.2023.12.04.03.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 03:12:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=SJZWmelL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 0F8A18098B0E; Mon, 4 Dec 2023 03:12:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231556AbjLDLML (ORCPT + 99 others); Mon, 4 Dec 2023 06:12:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbjLDLMK (ORCPT ); Mon, 4 Dec 2023 06:12:10 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA881CC; Mon, 4 Dec 2023 03:12:14 -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=57qN1iQssrdoPxO3vjOJxY+KkICDSFEOHy7vEhypSQY=; b=SJZWmelLjacxjQSc2rHFwC2yAL jTj9QZTX0X4Po4XPpfbs7mcPqcRffTzF+bRxA6cc+E5pWWustakRYKEHFrKYdsNMy0O3vYtMgKPqD g6mXsMan1PhPEuOos6p54MK0NRN6dhfjkQFxjjekcKPgEUo/P8hMw93tOmEpoCTiUedvGyLRD8Z9D HLkoFDqCUrQBEg2UU8X7XyyVtMWxis4xqXdL5iszhpV2f0OjzCwzyI6Idp1VXXqqWoC3vZQiQNbY4 zqZ1Mcm2rpTcgt+Qe43CxSMZDe3gBiRFLdStRojeDIPpxLyqyFTKjjgekBA/xZqWFFnX93kfXBC7a /EPIZEzw==; 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 1rA6rJ-000b3j-D2; Mon, 04 Dec 2023 11:11:29 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6305A3003F0; Mon, 4 Dec 2023 12:11:28 +0100 (CET) Date: Mon, 4 Dec 2023 12:11:28 +0100 From: Peter Zijlstra To: Alexei Starovoitov Cc: 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 , Jiri Olsa , 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: <20231204111128.GV8262@noisy.programming.kicks-ass.net> References: <20231130133630.192490507@infradead.org> <20231130134204.136058029@infradead.org> <20231204091334.GM3818@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231204091334.GM3818@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 03:12:30 -0800 (PST) On Mon, Dec 04, 2023 at 10:13:34AM +0100, Peter Zijlstra wrote: > > Just running test_progs it splats right away: > > > > [ 74.047757] kmemleak: Found object by alias at 0xffffffffa0001d80 > > [ 74.048272] CPU: 14 PID: 104 Comm: kworker/14:0 Tainted: G W > > O 6.7.0-rc3-00702-g41c30fec304d-dirty #5241 > > [ 74.049118] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), > > BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 > > [ 74.050042] Workqueue: events bpf_prog_free_deferred > > [ 74.050448] Call Trace: > > [ 74.050663] > > [ 74.050841] dump_stack_lvl+0x55/0x80 > > [ 74.051141] __find_and_remove_object+0xdb/0x110 > > [ 74.051521] kmemleak_free+0x41/0x70 > > [ 74.051828] vfree+0x36/0x130 > > Durr, I'll see if I can get that stuff running locally, and otherwise > play with the robot as you suggested. Thanks! I think it is bpf_jit_binary_pack_hdr(), which is using prog->bpf_func as a start address for the image, instead of jit_data->image. This used to be true, but now it's offset. Let me see what to do about that...