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 AF098C00140 for ; Mon, 15 Aug 2022 14:42:16 +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=GyCy3MwgHUutZ07/ZWRvSuo6SiYqobNsdZJ9FObtFMs=; b=aL09te21i4KkXc IPGbHctQYbCT+I7o9X409pJ0QZEQaCZVTKQ+x/CVSFttDHGpqQzcel7nFyHCZaXUpj5jXCMwTvFqE lEnsCUN6ab/ekqM3TYhMYFWZKjjz5T+3cYVIFll3aQxdyP9ebPcud0W7PNk5f9RNY24QHT80bK8en 9DdjJ7JrjgxrBYSTr8PBk9PQBR02YkwnD/fcMruO5YM+WEtcSVSqEcp1s4BcqFU4BBCljR1OR4eSC 1F35H7g/VMMK6o7FBPb8WykFNW6YQc+f9iSzce2vuOKkxoVo42GUXIcW0g0/jE4IFC8pC+V5X+RWV JTjZmn4as9v2VzCJ2RMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNbHA-000Ela-Rx; Mon, 15 Aug 2022 14:41:08 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNayz-00HUx0-ER for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2022 14:22:23 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C6694B80EDB; Mon, 15 Aug 2022 14:22:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99EECC433C1; Mon, 15 Aug 2022 14:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660573338; bh=cMOSMMwjW+Uy4SnFO1CPh4j8XCn72xisDX7qbMrLxKA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RXWCZ6OrK5ovNQjEqJqZBQTbAOhlvb0Uc4yIPpTG2vz2SKSffpuRzGrH5MtAjg3T8 axOplBarAR5/ntNrJajfyRE2D92SHWmY02SGuPLnGgWYmwJlDk0lZURV3sDwe4OsWm gOUZztbQ16WpTNAqQqpZnGJLJQrTKQ56NVyd2pieaBoAjInmyQljywiApixTcJdTlN ukTmsYasdRH7TXzht9iC77obxv+b5KsTdjhaUjjopcENlaJpcTyyo/fP3ATLIJbz+b 32yZZRnSbUIv1woAXOCTAheBZtcWjpE/A+yu8BagIPEGbbVI6/o0f2TnN9FmKnews/ LDyffW/XUr87A== Date: Mon, 15 Aug 2022 15:22:13 +0100 From: Will Deacon To: Max Schulze Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, naush@raspberrypi.com Subject: Re: BUG: Bad page map in process/Bad Swap file entry, RPI CM4 on clone syscall Message-ID: <20220815142213.GA10448@willie-the-truck> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220815_072221_833711_F9FDD7DE X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: linux-arm-kernel@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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Fri, Aug 12, 2022 at 10:01:06PM +0200, Max Schulze wrote: > I run a userspace program, which does image analysis. This is compiled > from freepascal. The program freezes, I get below kernel oops. My program > is calling SysUtils.ExecuteProcess('/sbin/shutdown') when finished, I have > traced with strace and it hangs at the *clone syscall*. > = > I have 4 different devices where this happens. Tonight I built the latest > kernel with debug infos (rpi-5.19.y commit c3a3eb5a3). > = > $ cat /proc/cmdline > = > coherent_pool=3D1M snd_bcm2835.enable_headphones=3D0 snd_bcm2835.enable_h= dmi=3D0 > video=3DHDMI-A-1:1920x1080M@60 smsc95xx.macaddr=3D<> > vc_mem.mem_base=3D0x3ec00000 vc_mem.mem_size=3D0x40000000=A0 console=3Dtt= y1 > root=3DPARTUUID=3D<> rootfstype=3Dext4 fsck.repair=3Dyes rootwait kpti=3D= 0 nokaslr > mitigations=3Doff > = > = > [20:47:09] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready > [20:48:46] BUG: Bad page map in process projecta=A0 pte:1110111111111111 = pmd:800000001c40003 > [20:48:46] addr:0000007fa1c00000 vm_flags:00100073 anon_vma:ffffff805bf80= d08 mapping:0000000000000000 index:7fa1c00 > [20:48:46] file:(null) fault:0x0 mmap:0x0 read_folio:0x0 > [20:48:46] CPU: 0 PID: 1069 Comm: projecta Tainted: G=A0=A0=A0=A0=A0=A0= =A0=A0 C=A0=A0=A0=A0=A0=A0=A0 5.19.0-v8+ #1 > [20:48:46] Hardware name: Raspberry Pi Compute Module 4 Rev 1.0 (DT) > [20:48:46] Call trace: > [20:48:46]=A0 dump_backtrace.part.0+0x1dc/0x1ec > [20:48:46]=A0 show_stack+0x24/0x80 > [20:48:46]=A0 dump_stack_lvl+0x8c/0xb8 > [20:48:46]=A0 dump_stack+0x1c/0x38 > [20:48:46]=A0 print_bad_pte+0x2ec/0x350 > [20:48:46]=A0 vm_normal_page+0x16c/0x190 > [20:48:46]=A0 copy_page_range+0x45c/0x13c0 > [20:48:46]=A0 dup_mm+0x5bc/0x7f4 > [20:48:46]=A0 copy_process+0x1354/0x2370 > [20:48:46]=A0 kernel_clone+0xf0/0x590 > [20:48:46]=A0 __do_sys_clone+0xa4/0xe0 > [20:48:46]=A0 __arm64_sys_clone+0x74/0x90 > [20:48:46]=A0 invoke_syscall+0x68/0x1a0 > [20:48:46]=A0 el0_svc_common.constprop.0+0x88/0x170 > [20:48:46]=A0 do_el0_svc+0xcc/0xf0 > [20:48:46]=A0 el0_svc+0x30/0x70 > [20:48:46]=A0 el0t_64_sync_handler+0x1ac/0x1b0 > [20:48:46]=A0 el0t_64_sync+0x18c/0x190 > [20:48:46] Disabling lock debugging due to kernel taint > [20:48:46] get_swap_device: Bad swap file entry 801111112111111 > [20:48:46] BUG: Bad page map in process projecta=A0 pte:1211111111111111 = pmd:800000001c40003 > [20:48:46] addr:0000007fa1c02000 vm_flags:00100073 anon_vma:ffffff805bf80= d08 mapping:0000000000000000 index:7fa1c02 I hate to say it, but this all looks like memory corruption hitting the page table and possibly the 'struct page' array to me :/ Are you able to reproduce this problem using an upstream kernel, rather than one built from the raspberry pi tree? Another thing to consider (and apologies if this sounds silly) is the power supply. Are all four of your devices using the same power supply? Are you able to try something beefier? Finally, you could enable CONFIG_MEMTEST and boot with memtest=3D17 on the command line, just in case it's a rogue DMA or something. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel