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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 233E8C677F1 for ; Mon, 16 Jan 2023 20:55:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 95A936B0074; Mon, 16 Jan 2023 15:55:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 90A586B0075; Mon, 16 Jan 2023 15:55:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D1886B0078; Mon, 16 Jan 2023 15:55:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6B8526B0074 for ; Mon, 16 Jan 2023 15:55:17 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 11744A0763 for ; Mon, 16 Jan 2023 20:55:17 +0000 (UTC) X-FDA: 80361867474.20.7954D06 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id EC672160018 for ; Mon, 16 Jan 2023 20:55:13 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qsXBwAWM; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673902515; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NC9LhxlmAcfoz2BLlV8ZmsTc89YKJONOkmmDX2k8BvU=; b=tnNuULETU/K3byvzGxRPQZnaYM/Jm/dd2PLTeGlRTn1O32t6hjTreDtgWCoBHGUKq6FxVO jQ9Ill1dMlYLgsLb68rejPJtdxk3xvJrAaFJavzWX7NUBUlZq6oUOiVCXhfZ1Kf2Pel2/w APnTVkMuQFTrGTxziDTF3en/pqNnL5k= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=qsXBwAWM; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673902515; a=rsa-sha256; cv=none; b=SO2QgzhQspVsieTuJcYETI1UkvJ896gNz3HuwjhBF3MesgAS4mWLQnPdTpvi2SnKpx1UHl dyV90KIBk4mIwzAnIfLyNFefuaGPjwdjZf3ATEnJi5GSb1Xz5OIrcHFN2FW05koEezoo5f W7/lToknqsAPTFJ0S8kJ0KNDFDvh7KI= 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=NC9LhxlmAcfoz2BLlV8ZmsTc89YKJONOkmmDX2k8BvU=; b=qsXBwAWMEdMcf9PIGQgdhJ1hvN x/N7SHzvR7Z2eZqR7Lb+h0Y3KPH/n4LdHH1Gh8/WEnERsmyR34w4u71u2wOLLaE0zb+edHeA0O3AK pbtMYmtO756D1k6lNZRj0N9fMF34TwVS0gHIUBbeFvVHSex/cNQsUkrZWwDRgUBo/ddeOB0Sz3Fpv 0iQfQwikv9C3TVamhj516w65HyfQjyCm3oWOrOUYGdny4TsMrgC7s4fhICS4udy0yiOKzde06Ilrf IY9Yco9cKhl3ckA7gmVNgXtKGxcf/SGfOw0CjrU7TZSAGoF9MithHprGxZuqGw9VB+05DC6s0T7qS S7ORRLIA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHWVa-0093p1-Vb; Mon, 16 Jan 2023 20:55:11 +0000 Date: Mon, 16 Jan 2023 20:55:10 +0000 From: Matthew Wilcox To: Jann Horn Cc: Dmitry Vyukov , syzbot , almaz.alexandrovich@paragon-software.com, ntfs3@lists.linux.dev, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] stack segment fault in truncate_inode_pages_final Message-ID: References: <000000000000baa88c05eaa934bb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: EC672160018 X-Stat-Signature: zkf993fyumkujbmp41zn6fajhqzhg9oy X-HE-Tag: 1673902513-592693 X-HE-Meta: U2FsdGVkX18w+3BXXFBCgeSIfRVSN/F4uZ0rgCvE2QKt+NqWAums2ZnTB3MOeohXMxWNi63caWG2dWu/xsf8xjnIOjLZx6/5oU8X+0h3bZragfMvokO3si1G2BGNz/ja8yxZkrR6hPQPq9cIPIYv1jbAdTKvox8Gt/f15alaMj0OPSTU5aO6m8LjsAGMZMCDzbiFCFxHzPzRqJRyzKYiZwDoPSuPrqCcC4ao2ofCvM/ba4bisWoPayB/J1IGWN3uHllaZoDxkk/eaTZgPlT/oxljoDAiXCqVo0LO91m29lmhHRXP89l3Dfwgqb+bP3/dCks1fx7MqbDkYSclWwVV+l9C67lMIvMm9Ku9Qb5f9zJ28oAuZycY6XiZmkCuxjQVEahAxtXz0Lz9hboV5iuF+jjS8zzHwZz9WR+fYzx+fQpXm8n1rIBOLVO9WYYe6VNntiyzQ/2cnmwW3z16wz5vAmm9djPFVXIb5bXaKQyO3vaEY8NXybg6jAskg6adfYF0inDtsUpCTTk056YwdyDfEJqBrjUpBAJ1ZlArET/A3Pq5MGbNDMgW2BJYqhBgHALSl2ODDjbE4TfbCx/fJGwhlkTbfuGCTIPAB6xCJWe8f7clVZAZNsN3POU8oxE6KGFZkDGAJm1NHAL43PkkvDAs9jAYq8Na83vLdCwBJrj4DTw3cYCuSim8K1VowC/wHUU1V4VyVO3A7U5qKELw3Em93woSN96E2QMx8ETFNC370GyWF6OREBgzS8H408kTcor+LjWNfo+ifI0kPzBnnnkACyFS9ay59nzxHrJKTQb/EZwpDsFRFQuyVbD0Fy+t1dGUfCfwVvY+yn4ev8j42xBnx3x5HRMA3STberJf1BX1sdXoKof3QKo8Yen/faRTV2g27tZHWAeH9pPavxcAn/8T5WOAzbGbqNpZ3Jn6lQ5S8sIv3Sq5iNYjoi7/UaXjAh9pg61SbF5droWfFubFvgw DvMYP9Ff jPfGwGF35BLCA+UF93vbEFZEml09E20ndWQge1Hjh7vQYOxXni+0pcs1dMfWG+gurET9h3a7eQdG3zN9/BdGg93+HtbLXdMVfeUhaX6AcBj1xyJru+wZXIELeyuVkfHN5FhJKwn+YGzoRsZ0qcLnsTw7bml2dByOqgWqwW5ylXrOGyaOGn9qqO9CItf/c3oRED3UrdyqDjetDeXPDtxh8/0nK6KhXcm8URzUz X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jan 16, 2023 at 09:46:37PM +0100, Jann Horn wrote: > On Mon, Oct 10, 2022 at 9:42 AM Dmitry Vyukov wrote: > > On Mon, 10 Oct 2022 at 09:35, syzbot > > wrote: > > > > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit: 833477fce7a1 Merge tag 'sound-6.1-rc1' of git://git.kernel.. > > > git tree: upstream > > > console output: https://syzkaller.appspot.com/x/log.txt?x=17cae158880000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=676645938ad4c02f > > > dashboard link: https://syzkaller.appspot.com/bug?extid=0f7dd5852be940800ca4 > > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > > > Downloadable assets: > > > disk image: https://storage.googleapis.com/syzbot-assets/f66757bbae28/disk-833477fc.raw.xz > > > vmlinux: https://storage.googleapis.com/syzbot-assets/50ec5a2788dd/vmlinux-833477fc.xz > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > Reported-by: syzbot+0f7dd5852be940800ca4@syzkaller.appspotmail.com > > > > +ntfs3 maintainers > > There's something deeply wrong with this one; it looks like we're There's often something deeply wrong with NTFS-related reports. I've seen lockdep reports which are clearly corrupt lockdep state, for example. I suspect inadvertent stack smashing, but have done nothing to prove that assumption. I just ignore reports tagged as ntfs now. > trying to execute from an RIP that is not aligned to a full > instruction. RIP points to the last byte of a CALL instruction. It > looks like, somehow, while we were somewhere inside > _raw_spin_unlock_irq, something stomped over RIP. Note how the "Code > starting with the faulting instruction" section shows an instruction > that's not visible in the "All code" dump above. > > Code: 48 c7 c0 40 e8 ca 8d 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 > 80 3c 10 00 0f 85 e0 01 00 00 48 8b 05 65 42 6d 0c e8 80 2e 06 <00> 85 > c0 74 17 65 ff 0d 55 c9 a4 7e 0f 85 3e fb ff ff e8 ec ce a2 > All code > ======== > 0: 48 c7 c0 40 e8 ca 8d mov $0xffffffff8dcae840,%rax > 7: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx > e: fc ff df > 11: 48 c1 e8 03 shr $0x3,%rax > 15: 80 3c 10 00 cmpb $0x0,(%rax,%rdx,1) > 19: 0f 85 e0 01 00 00 jne 0x1ff > 1f: 48 8b 05 65 42 6d 0c mov 0xc6d4265(%rip),%rax # 0xc6d428b > 26:* e8 80 2e 06 00 call 0x62eab <-- trapping instruction > 2b: 85 c0 test %eax,%eax > 2d: 74 17 je 0x46 > 2f: 65 ff 0d 55 c9 a4 7e decl %gs:0x7ea4c955(%rip) # 0x7ea4c98b > 36: 0f 85 3e fb ff ff jne 0xfffffffffffffb7a > 3c: e8 .byte 0xe8 > 3d: ec in (%dx),%al > 3e: ce (bad) > 3f: a2 .byte 0xa2 > > Code starting with the faulting instruction > =========================================== > 0: 00 85 c0 74 17 65 add %al,0x651774c0(%rbp) > 6: ff 0d 55 c9 a4 7e decl 0x7ea4c955(%rip) # 0x7ea4c961 > c: 0f 85 3e fb ff ff jne 0xfffffffffffffb50 > 12: e8 .byte 0xe8 > 13: ec in (%dx),%al > 14: ce (bad) > 15: a2 .byte 0xa2 > > We're interpreting unaligned instruction bytes as "add > %al,0x651774c0(%rbp)", and RBP is non-canonical (1ffff92000a6cf44), so > we get a Stack Segment fault. > > Unless this is some kind of asynchronous stack UAF decrement, I think > this might not be NTFS's fault. > > > > stack segment: 0000 [#1] PREEMPT SMP KASAN > > > CPU: 1 PID: 22407 Comm: syz-executor.5 Not tainted 6.0.0-syzkaller-05118-g833477fce7a1 #0 > > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 > > > RIP: 0010:trace_lock_release include/trace/events/lock.h:69 [inline] > > > RIP: 0010:lock_release+0x55f/0x780 kernel/locking/lockdep.c:5677 > > > Code: 48 c7 c0 40 e8 ca 8d 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 e0 01 00 00 48 8b 05 65 42 6d 0c e8 80 2e 06 <00> 85 c0 74 17 65 ff 0d 55 c9 a4 7e 0f 85 3e fb ff ff e8 ec ce a2 > > > RSP: 0018:ffffc90005367a10 EFLAGS: 00010002 > > > RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000001 > > > RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 > > > RBP: 1ffff92000a6cf44 R08: 0000000000000000 R09: ffffffff8ddf9957 > > > R10: fffffbfff1bbf32a R11: 0000000000000000 R12: ffff888093973498 > > > R13: ffff888093973278 R14: ffffffff8a22b140 R15: ffff8880478d8a00 > > > FS: 00007f9ae3bb2700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > CR2: 0000001b2e927000 CR3: 000000003f6b9000 CR4: 00000000003506e0 > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > Call Trace: > > > > > > __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:157 [inline] > > > _raw_spin_unlock_irq+0x12/0x40 kernel/locking/spinlock.c:202 > > > spin_unlock_irq include/linux/spinlock.h:399 [inline] > > > truncate_inode_pages_final+0x5f/0x80 mm/truncate.c:484 > > > ntfs_evict_inode+0x16/0xa0 fs/ntfs3/inode.c:1741 > > > evict+0x2ed/0x6b0 fs/inode.c:665 > > > iput_final fs/inode.c:1748 [inline] > > > iput.part.0+0x55d/0x810 fs/inode.c:1774 > > > iput+0x58/0x70 fs/inode.c:1764 > > > ntfs_fill_super+0x2e89/0x37f0 fs/ntfs3/super.c:1190 > > > get_tree_bdev+0x440/0x760 fs/super.c:1323 > > > vfs_get_tree+0x89/0x2f0 fs/super.c:1530 > > > do_new_mount fs/namespace.c:3040 [inline] > > > path_mount+0x1326/0x1e20 fs/namespace.c:3370 > > > do_mount fs/namespace.c:3383 [inline] > > > __do_sys_mount fs/namespace.c:3591 [inline] > > > __se_sys_mount fs/namespace.c:3568 [inline] > > > __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 > > > do_syscall_x64 arch/x86/entry/common.c:50 [inline] > > > do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 > > > entry_SYSCALL_64_after_hwframe+0x63/0xcd > > > RIP: 0033:0x7f9ae2a8bada > > > Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 > > > RSP: 002b:00007f9ae3bb1f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 > > > RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007f9ae2a8bada > > > RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f9ae3bb1fe0 > > > RBP: 00007f9ae3bb2020 R08: 00007f9ae3bb2020 R09: 0000000020000000 > > > R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 > > > R13: 0000000020000100 R14: 00007f9ae3bb1fe0 R15: 0000000020000140 > > > > > > Modules linked in: > > > ---[ end trace 0000000000000000 ]--- > > > RIP: 0010:trace_lock_release include/trace/events/lock.h:69 [inline] > > > RIP: 0010:lock_release+0x55f/0x780 kernel/locking/lockdep.c:5677 > > > Code: 48 c7 c0 40 e8 ca 8d 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 e0 01 00 00 48 8b 05 65 42 6d 0c e8 80 2e 06 <00> 85 c0 74 17 65 ff 0d 55 c9 a4 7e 0f 85 3e fb ff ff e8 ec ce a2 > > > RSP: 0018:ffffc90005367a10 EFLAGS: 00010002 > > > RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000001 > > > RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 > > > RBP: 1ffff92000a6cf44 R08: 0000000000000000 R09: ffffffff8ddf9957 > > > R10: fffffbfff1bbf32a R11: 0000000000000000 R12: ffff888093973498 > > > R13: ffff888093973278 R14: ffffffff8a22b140 R15: ffff8880478d8a00 > > > FS: 00007f9ae3bb2700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > CR2: 0000001b2e927000 CR3: 000000003f6b9000 CR4: 00000000003506e0 > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > > > > > > > --- > > > This report is generated by a bot. It may contain errors. > > > See https://goo.gl/tpsmEJ for more information about syzbot. > > > syzbot engineers can be reached at syzkaller@googlegroups.com. > > > > > > syzbot will keep track of this issue. See: > > > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group. > > > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com. > > > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/000000000000baa88c05eaa934bb%40google.com. > >