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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10FCFCFC5E2 for ; Thu, 10 Oct 2024 16:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EJ10KZFS6htTQZ/CRMF3RDydl4nUYsAq/WPVU4aqwM8=; b=g6NJ/TW5kT3EY9 M2fss46+hogdC5N93zOsGHYz6mpVqN/4/zCjG65YrpDaRk2dbFqfqmVv2OpPU1BgDjQqpgvaP4pyQ 1JY+/iLbYJlnmtuYTPOwwFE3U6PuHi7oAImR8A7FtzerRnODIN43xRfmRuxx2TK8hTkTwGXJH7bT4 taqWaoVTKSSHAbIn0KYgZswOhIAk7HwTxBkIzgdrOOhqGM6KYXZRNPuXAXeT/eQF50p5TpEYs/d25 yQjiL4PtNUKlRdN1DFxog+aNaBF5e/uIlW6pqKuR6grhfOUrgIHUY5z/olkGnUkgZRZafG++lgWr6 9J6U+BmWbpIf9xV+ZCsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sywIp-0000000DaLD-2olf; Thu, 10 Oct 2024 16:46:15 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syv2R-0000000DJpT-0a2z; Thu, 10 Oct 2024 15:25:16 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id CE93BA4347C; Thu, 10 Oct 2024 15:24:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94D86C4CEC5; Thu, 10 Oct 2024 15:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728573883; bh=gnTehr7qrLMKw/pUpKhTMaCY3tpDIt6F6aFobT96HoY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ekagPdIZxqT4SWWRuS6VjAHAzc6oWKEW/4hsSTRm4pLygcR/K/5nYo1MRhIB1W8Bi WhUInbNKfRaSZHzNuMbNo/gh/Dm11IzVkhHlBcuZvhkOJMQBELbJP+QR/GYDeVHSby +1ODj4I12HqiH5y8g34fzvrSEzf2u/HDRwYAX/nNnTn9iTEhJxcxooLVqAwIKD6FZv b3fbK7YHQj8tX05PEVkLu2GJn3pxXz8GTYW1p2sF1xOis1mXNPjG1oTG9dYByuOZVe q0nYNSfpcIxt1MrmJaX80Vmf5bsmJaexf7/nT75nIm1VGT6H7a1RxSwQLd/ELhYVan 63H6TXss7XvhQ== Date: Thu, 10 Oct 2024 18:20:53 +0300 From: Mike Rapoport To: Sergey Senozhatsky Cc: Andrew Morton , Andreas Larsson , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Brian Cain , Catalin Marinas , Christoph Hellwig , Christophe Leroy , Dave Hansen , Dinh Nguyen , Geert Uytterhoeven , Guo Ren , Helge Deller , Huacai Chen , Ingo Molnar , Johannes Berg , John Paul Adrian Glaubitz , Kent Overstreet , "Liam R. Howlett" , Luis Chamberlain , Mark Rutland , Masami Hiramatsu , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Oleg Nesterov , Palmer Dabbelt , Peter Zijlstra , Richard Weinberger , Russell King , Song Liu , Stafford Horne , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Uladzislau Rezki , Vineet Gupta , Will Deacon , bpf@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-trace-kernel@vger.kernel.org, linux-um@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: Bisected: [PATCH v5 8/8] x86/module: enable ROX caches for module text Message-ID: References: <20241009180816.83591-1-rppt@kernel.org> <20241009180816.83591-9-rppt@kernel.org> <20241010083033.GA1279924@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20241010083033.GA1279924@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_082515_327058_2FBCA35B X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Thu, Oct 10, 2024 at 05:30:33PM +0900, Sergey Senozhatsky wrote: > On (24/10/09 21:08), Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > > > Enable execmem's cache of PMD_SIZE'ed pages mapped as ROX for module > > text allocations. > > > > With this modprobe disappoints kmemleak > > [ 12.700128] kmemleak: Found object by alias at 0xffffffffa000a000 > [ 12.702179] CPU: 5 UID: 0 PID: 410 Comm: modprobe Tainted: G N 6.12.0-rc2+ #760 > [ 12.704656] Tainted: [N]=TEST > [ 12.705526] Call Trace: > [ 12.706250] > [ 12.706888] dump_stack_lvl+0x3e/0xdb > [ 12.707961] __find_and_get_object+0x100/0x110 > [ 12.709256] kmemleak_no_scan+0x2e/0xb0 > [ 12.710354] kmemleak_load_module+0xad/0xe0 > [ 12.711557] load_module+0x2391/0x45a0 > [ 12.712507] __se_sys_finit_module+0x4e0/0x7a0 > [ 12.713599] do_syscall_64+0x54/0xf0 > [ 12.714477] ? irqentry_exit_to_user_mode+0x33/0x100 > [ 12.715696] entry_SYSCALL_64_after_hwframe+0x4b/0x53 > [ 12.716931] RIP: 0033:0x7fc7af51f059 > [ 12.717816] Code: 08 89 e8 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8f 1d 0d 00 f7 d8 64 89 01 48 > [ 12.722324] RSP: 002b:00007ffc1d0b0c18 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 > [ 12.724173] RAX: ffffffffffffffda RBX: 00005618a9439b20 RCX: 00007fc7af51f059 > [ 12.725884] RDX: 0000000000000000 RSI: 000056187aea098b RDI: 0000000000000003 > [ 12.727617] RBP: 0000000000000000 R08: 0000000000000060 R09: 00005618a943af60 > [ 12.729361] R10: 0000000000000038 R11: 0000000000000246 R12: 000056187aea098b > [ 12.731101] R13: 0000000000040000 R14: 00005618a9439ac0 R15: 0000000000000000 > [ 12.732814] Below is a quick fix, I'll revisit module - kmemleak interaction in v6 diff --git a/kernel/module/debug_kmemleak.c b/kernel/module/debug_kmemleak.c index b4cc03842d70..df873dad049d 100644 --- a/kernel/module/debug_kmemleak.c +++ b/kernel/module/debug_kmemleak.c @@ -14,7 +14,8 @@ void kmemleak_load_module(const struct module *mod, { /* only scan writable, non-executable sections */ for_each_mod_mem_type(type) { - if (type != MOD_DATA && type != MOD_INIT_DATA) + if (type != MOD_DATA && type != MOD_INIT_DATA && + !mod->mem[type].is_rox) kmemleak_no_scan(mod->mem[type].base); } } -- Sincerely yours, Mike. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv