Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp493397rdh; Tue, 19 Dec 2023 05:23:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYC+YwmG2V7AJ8X+D+LXiarobKdoGK1dF6nVGkNMBFD0Z0fOcChCe72k+lyfG08fl50Zfy X-Received: by 2002:a05:622a:24b:b0:425:4043:41ca with SMTP id c11-20020a05622a024b00b00425404341camr25649526qtx.118.1702992219731; Tue, 19 Dec 2023 05:23:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702992219; cv=none; d=google.com; s=arc-20160816; b=ChBPMQGvBbGdhCVZ+wmiKbZa9UK/Rh3sHyTCVZFuJWQCEIpqSTu4kcyghiaSvAkwgy LjRmo3Y1f7OJj+SBKYD4DFn7h1JagrbRX53lu7QTXkPlzeVU86tYUjLe5sKoJGkrxM06 e/pGCzwg8McVIXwcwgyX86kvJxHyPZl1Neb6fDBXDd6Cr4wYus7+HOOKckhEmCiRu8Fw JVpZt367ZCVpZRelu6MLeFkShqLXVpAbNOZx+IXmH6hIDGnHIPT2lJvena6nGo+d26SV Q2XOAeXYVP40iWtO42rmlM4gX11NoeAPs+ZGJZsiG44qamXF7yd80d5GV81n+4t+g5zg 88AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from:dkim-signature; bh=YwcaPbKi8QnFAxKSbYWNRfJwjYBPl0UD3EkTy1k1RjI=; fh=HQRt3482IbkaQ1sytQK2HaqA7bh9pX/5Nqgyt3+2xdU=; b=AioVHsa02qzgpP56lew39md3VpeShF3g2rWUvhnIlcSSn6o//ZeDbBJfbQF8AhNkji LLDirMMgIpBULeYtPDg+DQrTcNVTHLcXRqcflwjF9c8qwSA9xNaOGxdb1h4oeGySHdOG 7s/V9Boz4wmec/+XvdSHx0DfLMq1JzsFnxNdOmUrQbuutUsvrj9fa0neSi+Gr1IlBvXS 7MkFwBnlITY+VG+wrsl/LxV0yGLQTY/ir9ZSByzZypUhGamOsKfZRoWsWx0a8Va8kVBN enG7Z65wu2yJCKKlKkQCHv4oLg7ivl5EoH0tbyHqhRW2GSWSr7TJpOdsp0A2V1PyccOt jWJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GQTVaq0p; spf=pass (google.com: domain of linux-kernel+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i8-20020ac85c08000000b00427592331b7si5550680qti.86.2023.12.19.05.23.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 05:23:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GQTVaq0p; spf=pass (google.com: domain of linux-kernel+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5D52C1C21126 for ; Tue, 19 Dec 2023 13:23:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0593F18EC1; Tue, 19 Dec 2023 13:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GQTVaq0p" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C57D18E13; Tue, 19 Dec 2023 13:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a2340c803c6so324060166b.0; Tue, 19 Dec 2023 05:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702992207; x=1703597007; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=YwcaPbKi8QnFAxKSbYWNRfJwjYBPl0UD3EkTy1k1RjI=; b=GQTVaq0p6ubvFbGrjS1/OLKzkdoxKaQ7MTuSrIP1jrseBWILFfPLH0l25e7O31voRI HDDYdXKimX1uXkw2+ajQCA2OR8SyJrQdkESq4/WSBNj2GSuTtfD7sZTc7+ZFbNBANM/n QPElhVvWhZAlc6YDTb1zAvp0ygSKazLDqmbvUhr3SuXZGxCGujotutWTL/PvurcmAEDX FGIyWrq8oggYS2hjnv7fFDzSAwPFyWKUaw1vC9h3q/lDykmOjD6ouXaVvcrHWDgo8472 S8/y1vIaDGYYOzfo629QsJMy8GnJIbHgUwKCzpiT9adawPZJD/6Qc8wV75vSrKq7w3Ly 41EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702992207; x=1703597007; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YwcaPbKi8QnFAxKSbYWNRfJwjYBPl0UD3EkTy1k1RjI=; b=mQbD4QIboqJeFUNp0xqjXRWayjskSA/tRhVIxpMoJMw4Da0uFH4lpPw3FN2Lgbb/Bh EwJUGTcS02AwaghtFmVrh/pSK4lLoZdfIazB9yli5+GKaVv5bi+oC4KEdGtbc8cPPeOt Yrw5DpOoxMWs+J0tDORdX4THf5HKAw/yVLty+CumpVmVhr1aF2Zp1oeXuEoSzp+3UCqf XlizFZlEtskScJ4wAt0WRAkR3Z7rIHWDwI5sUwRgVVc0hmbAbkEvIwdObY4CQp00U3En l2DTkoXBeHtTR9CsGZ3Wsb5mI7ddaKlDO8EUk2MLA4fXohsAdLEhJxagy6BCK4PF7evt df2Q== X-Gm-Message-State: AOJu0YxuFm0CYGRN8j08gXhfZ8ddaqh4gP33R5Y9ll19bGqWc9SnoufN mdl/7xKvMFOYSier1lSOYYA= X-Received: by 2002:a17:906:bc56:b0:a23:5f70:a5f with SMTP id s22-20020a170906bc5600b00a235f700a5fmr1354003ejv.92.1702992206554; Tue, 19 Dec 2023 05:23:26 -0800 (PST) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id kt17-20020a1709079d1100b00a015eac52dcsm15306406ejc.108.2023.12.19.05.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 05:23:26 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Tue, 19 Dec 2023 14:23:23 +0100 To: "Masami Hiramatsu (Google)" Cc: Alexei Starovoitov , Steven Rostedt , Florent Revest , linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: Re: [PATCH v5 24/34] fprobe: Use ftrace_regs in fprobe entry handler Message-ID: References: <170290509018.220107.1347127510564358608.stgit@devnote2> <170290538307.220107.14964448383069008953.stgit@devnote2> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170290538307.220107.14964448383069008953.stgit@devnote2> On Mon, Dec 18, 2023 at 10:16:23PM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS > instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe > on arm64. > > Signed-off-by: Masami Hiramatsu (Google) > Acked-by: Florent Revest this change breaks kprobe multi bpf tests (crash below), which are partially fixed by [1] later on, but I think we have to keep bisecting crash free it looks like the rethook will get wrong pointer.. I'm still trying to digest the whole thing, so I might have some updates later ;-) jirka [1] fprobe: Rewrite fprobe on function-graph tracer --- Dec 19 13:50:04 qemu kernel: BUG: kernel NULL pointer dereference, address: 0000000000000098 Dec 19 13:50:04 qemu kernel: #PF: supervisor read access in kernel mode Dec 19 13:50:04 qemu kernel: #PF: error_code(0x0000) - not-present page Dec 19 13:50:04 qemu kernel: PGD 10955f067 P4D 10955f067 PUD 103113067 PMD 0 Dec 19 13:50:04 qemu kernel: Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN NOPTI Dec 19 13:50:04 qemu kernel: CPU: 1 PID: 747 Comm: test_progs Tainted: G B OE 6.7.0-rc3+ #194 85bc8297edbc7f21acfc743dabbd52cac073a6bf Dec 19 13:50:04 qemu kernel: Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 Dec 19 13:50:04 qemu kernel: RIP: 0010:arch_rethook_prepare+0x18/0x60 Dec 19 13:50:04 qemu kernel: Code: 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 41 55 41 54 55 48 89 f5 53 48 89 fb 48 8d be 98 00 00 00 e8 68 8f 59 > Dec 19 13:50:04 qemu kernel: RSP: 0018:ffff888125f97a88 EFLAGS: 00010286 Dec 19 13:50:04 qemu kernel: RAX: 0000000000000001 RBX: ffff88818a231410 RCX: ffffffff812190b6 Dec 19 13:50:04 qemu kernel: RDX: fffffbfff0c42e95 RSI: 0000000000000008 RDI: ffffffff862174a0 Dec 19 13:50:04 qemu kernel: RBP: 0000000000000000 R08: 0000000000000001 R09: fffffbfff0c42e94 Dec 19 13:50:04 qemu kernel: R10: ffffffff862174a7 R11: 0000000000000000 R12: ffff88818a231420 Dec 19 13:50:04 qemu kernel: R13: ffffffff8283ee8e R14: ffff88818a231410 R15: fffffffffffffff7 Dec 19 13:50:04 qemu kernel: FS: 00007ff8a16cfd00(0000) GS:ffff88842c600000(0000) knlGS:0000000000000000 Dec 19 13:50:05 qemu kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Dec 19 13:50:05 qemu kernel: CR2: 0000000000000098 CR3: 000000010633c005 CR4: 0000000000770ef0 Dec 19 13:50:05 qemu kernel: PKRU: 55555554 Dec 19 13:50:05 qemu kernel: Call Trace: Dec 19 13:50:05 qemu kernel: Dec 19 13:50:05 qemu kernel: ? __die+0x1f/0x70 Dec 19 13:50:05 qemu kernel: ? page_fault_oops+0x215/0x620 Dec 19 13:50:05 qemu kernel: ? rcu_is_watching+0x34/0x60 Dec 19 13:50:05 qemu kernel: ? __pfx_page_fault_oops+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? asm_sysvec_apic_timer_interrupt+0x16/0x20 Dec 19 13:50:05 qemu kernel: ? do_user_addr_fault+0x4b3/0x910 Dec 19 13:50:05 qemu kernel: ? exc_page_fault+0x77/0x130 Dec 19 13:50:05 qemu kernel: ? asm_exc_page_fault+0x22/0x30 Dec 19 13:50:05 qemu kernel: ? bpf_prog_test_run_tracing+0x1ce/0x2d0 Dec 19 13:50:05 qemu kernel: ? add_taint+0x26/0x90 Dec 19 13:50:05 qemu kernel: ? arch_rethook_prepare+0x18/0x60 Dec 19 13:50:05 qemu kernel: ? arch_rethook_prepare+0x18/0x60 Dec 19 13:50:05 qemu kernel: ? bpf_prog_test_run_tracing+0x1ce/0x2d0 Dec 19 13:50:05 qemu kernel: rethook_hook+0x1e/0x50 Dec 19 13:50:05 qemu kernel: ? __pfx_bpf_fentry_test1+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? bpf_prog_test_run_tracing+0x1ce/0x2d0 Dec 19 13:50:05 qemu kernel: fprobe_handler+0x1ca/0x350 Dec 19 13:50:05 qemu kernel: ? __pfx_bpf_fentry_test1+0x10/0x10 Dec 19 13:50:05 qemu kernel: arch_ftrace_ops_list_func+0x143/0x2e0 Dec 19 13:50:05 qemu kernel: ? bpf_prog_test_run_tracing+0x1ce/0x2d0 Dec 19 13:50:05 qemu kernel: ftrace_call+0x5/0x44 Dec 19 13:50:05 qemu kernel: ? __pfx_lock_release+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? rcu_is_watching+0x34/0x60 Dec 19 13:50:05 qemu kernel: ? bpf_prog_test_run_tracing+0xcd/0x2d0 Dec 19 13:50:05 qemu kernel: ? bpf_fentry_test1+0x5/0x10 Dec 19 13:50:05 qemu kernel: ? rcu_is_watching+0x34/0x60 Dec 19 13:50:05 qemu kernel: bpf_fentry_test1+0x5/0x10 Dec 19 13:50:05 qemu kernel: bpf_prog_test_run_tracing+0x1ce/0x2d0 Dec 19 13:50:05 qemu kernel: ? __pfx_lock_release+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? __pfx_bpf_prog_test_run_tracing+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? __pfx_lock_release+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? __fget_light+0xdf/0x100 Dec 19 13:50:05 qemu kernel: ? __bpf_prog_get+0x107/0x150 Dec 19 13:50:05 qemu kernel: __sys_bpf+0x552/0x2ef0 Dec 19 13:50:05 qemu kernel: ? rcu_is_watching+0x34/0x60 Dec 19 13:50:05 qemu kernel: ? __pfx___sys_bpf+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? __pfx_lock_release+0x10/0x10 Dec 19 13:50:05 qemu kernel: ? vfs_write+0x1fa/0x740 Dec 19 13:50:05 qemu kernel: ? rcu_is_watching+0x34/0x60 Dec 19 13:50:05 qemu kernel: ? rcu_is_watching+0x34/0x60 Dec 19 13:50:05 qemu kernel: ? lockdep_hardirqs_on_prepare+0xe/0x250 Dec 19 13:50:05 qemu kernel: ? seqcount_lockdep_reader_access.constprop.0+0x105/0x120 Dec 19 13:50:05 qemu kernel: ? seqcount_lockdep_reader_access.constprop.0+0xb2/0x120 Dec 19 13:50:05 qemu kernel: __x64_sys_bpf+0x44/0x60 Dec 19 13:50:05 qemu kernel: do_syscall_64+0x3f/0xf0 Dec 19 13:50:05 qemu kernel: entry_SYSCALL_64_after_hwframe+0x6e/0x76 Dec 19 13:50:05 qemu kernel: RIP: 0033:0x7ff8a1897b4d Dec 19 13:50:05 qemu kernel: Code: c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f > Dec 19 13:50:05 qemu kernel: RSP: 002b:00007fff34f7d158 EFLAGS: 00000206 ORIG_RAX: 0000000000000141 Dec 19 13:50:05 qemu kernel: RAX: ffffffffffffffda RBX: 00007ff8a19aa000 RCX: 00007ff8a1897b4d Dec 19 13:50:05 qemu kernel: RDX: 0000000000000050 RSI: 00007fff34f7d190 RDI: 000000000000000a Dec 19 13:50:05 qemu kernel: RBP: 00007fff34f7d170 R08: 0000000000000000 R09: 00007fff34f7d190 Dec 19 13:50:05 qemu kernel: R10: 0000000000000064 R11: 0000000000000206 R12: 0000000000000004 Dec 19 13:50:05 qemu kernel: R13: 0000000000000000 R14: 00007ff8a19df000 R15: 0000000000e56db0 Dec 19 13:50:05 qemu kernel: Dec 19 13:50:05 qemu kernel: Modules linked in: bpf_testmod(OE) intel_rapl_msr intel_rapl_common crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_inte> Dec 19 13:50:05 qemu kernel: CR2: 0000000000000098 Dec 19 13:50:05 qemu kernel: ---[ end trace 0000000000000000 ]---