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 57A55CA0EFC for ; Fri, 30 Aug 2024 09:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sauza3UPY9jaejki/8R0hsavcymQKl4spTiGRrUsN3k=; b=m/rBUtW+fZloujr8LijU20AmR1 5tinqhbJSDyK/3vf02fK/T08zI7fQUdVKuqysM0Tkju5ma14LEnhhwPQq1YK6fCuQ+tTGnZUE1jim /rEzCs6l5Ibz15AgmWSRg8M5cH87qLrRRRXBfk3otycKysDf8PZ4fsqoC5k1iF9cPPw++rjQG+zj9 hUQAMa6vb/IwH9+btPZU1fvGlPPpBmfQTqifoqrNbo/BFRfr2+HGbdBOKAEv7x/Cq6zDQnKav6+bV za619Kl0Gqadft3nlT91vc4dKATPSG1QlH0oWa4INSKp2aHQ69sHea4vKUlloXvMJAy1GGYm7pZOV 9z9RhSRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyLF-00000005ejb-3D9H; Fri, 30 Aug 2024 09:54:53 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyJQ-00000005e0C-1z3y for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 09:53:02 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id B4B33A4454C; Fri, 30 Aug 2024 09:52:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28D9FC4CEC2; Fri, 30 Aug 2024 09:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725011579; bh=uEdtAmc02zf8K/kC/H0kNtQPwfgD9V1CqxF8y1Kd7Rc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rHDe1q+1zvL/T1y3pHhXPhFTQTPFUQQG1jZ7B1w1LaA8RlmOkh5OBCTzy2JuWs7Ua RuBIArZVo2Q7D6lc3JVT7Kp1TapBr0FYnvEswwtW6TyGHbl8StdhNRyltWit+fUfrN fuQ1FzTBCqWGQh32Z2iRL2NeYvzGnlLYg+0VU6mqDwE814GSo44jwJGrk359mqRWQk mO1gg2ITxMtLc7LF1LQxxwsuBGMP9l1AkLj5vEQOjIJIkZFyd4EXL8mn/RhTH04bvI RM7GPtowh6FduLEdwMCPHKpOn/CNmDEy6JnR1D5kNEC7yMAssxnt/yZS5Cj5NjTisP dGIatUOnbkjpQ== Date: Fri, 30 Aug 2024 10:52:54 +0100 From: Will Deacon To: syzbot Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, maz@kernel.org Subject: Re: [syzbot] [arm?] upstream test error: KASAN: invalid-access Write in setup_arch Message-ID: <20240830095254.GA7769@willie-the-truck> References: <000000000000f362e80620e27859@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000000000000f362e80620e27859@google.com> 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-20240830_025300_663871_40E37135 X-CRM114-Status: GOOD ( 15.40 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 30, 2024 at 01:35:24AM -0700, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 33faa93bc856 Merge branch kvmarm-master/next into kvmarm-m.. > git tree: git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fuzzme +Marc, as this is his branch. > console output: https://syzkaller.appspot.com/x/log.txt?x=1398420b980000 > kernel config: https://syzkaller.appspot.com/x/.config?x=2b7b31c9aa1397ca > dashboard link: https://syzkaller.appspot.com/bug?extid=908886656a02769af987 > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 > userspace arch: arm64 > > Downloadable assets: > disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/384ffdcca292/non_bootable_disk-33faa93b.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/9093742fcee9/vmlinux-33faa93b.xz > kernel image: https://storage.googleapis.com/syzbot-assets/b1f599907931/Image-33faa93b.gz.xz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+908886656a02769af987@syzkaller.appspotmail.com > > Booting Linux on physical CPU 0x0000000000 [0x000f0510] > Linux version 6.11.0-rc5-syzkaller-g33faa93bc856 (syzkaller@syzkaller) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #0 SMP PREEMPT now > random: crng init done > Machine model: linux,dummy-virt > efi: UEFI not found. > NUMA: No NUMA configuration found > NUMA: Faking a node at [mem 0x0000000040000000-0x00000000bfffffff] > NUMA: NODE_DATA [mem 0xbfc1d340-0xbfc20fff] > Zone ranges: > DMA [mem 0x0000000040000000-0x00000000bfffffff] > DMA32 empty > Normal empty > Device empty > Movable zone start for each node > Early memory node ranges > node 0: [mem 0x0000000040000000-0x00000000bfffffff] > Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff] > cma: Reserved 32 MiB at 0x00000000bba00000 on node -1 > psci: probing for conduit method from DT. > psci: PSCIv1.1 detected in firmware. > psci: Using standard PSCI v0.2 function IDs > psci: Trusted OS migration not required > psci: SMC Calling Convention v1.0 > ================================================================== > BUG: KASAN: invalid-access in smp_build_mpidr_hash arch/arm64/kernel/setup.c:133 [inline] > BUG: KASAN: invalid-access in setup_arch+0x984/0xd60 arch/arm64/kernel/setup.c:356 > Write of size 4 at addr 03ff800086867e00 by task swapper/0 > Pointer tag: [03], memory tag: [fe] > > CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.11.0-rc5-syzkaller-g33faa93bc856 #0 > Hardware name: linux,dummy-virt (DT) > Call trace: > dump_backtrace+0x204/0x3b8 arch/arm64/kernel/stacktrace.c:317 > show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 > __dump_stack lib/dump_stack.c:93 [inline] > dump_stack_lvl+0x260/0x3b4 lib/dump_stack.c:119 > print_address_description mm/kasan/report.c:377 [inline] > print_report+0x118/0x5ac mm/kasan/report.c:488 > kasan_report+0xc8/0x108 mm/kasan/report.c:601 > kasan_check_range+0x94/0xb8 mm/kasan/sw_tags.c:84 > __hwasan_store4_noabort+0x20/0x2c mm/kasan/sw_tags.c:149 > smp_build_mpidr_hash arch/arm64/kernel/setup.c:133 [inline] > setup_arch+0x984/0xd60 arch/arm64/kernel/setup.c:356 > start_kernel+0xe0/0xff0 init/main.c:926 > __primary_switched+0x84/0x8c arch/arm64/kernel/head.S:243 > > The buggy address belongs to stack of task swapper/0 > > Memory state around the buggy address: > ffff800086867c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > ffff800086867d00: 00 fe fe 00 00 00 fe fe fe fe fe fe fe fe fe fe > >ffff800086867e00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe > ^ > ffff800086867f00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe > ffff800086868000: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe > ================================================================== I can't spot the issue here. We have a couple of fixed-length (4 element) arrays on the stack and they're indexed by a simple loop counter that runs from 0-3. Will