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 3E558C63797 for ; Tue, 17 Jan 2023 06:07:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BDB96B0078; Tue, 17 Jan 2023 01:07:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 96D826B007B; Tue, 17 Jan 2023 01:07:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80E566B007D; Tue, 17 Jan 2023 01:07:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 724C36B0078 for ; Tue, 17 Jan 2023 01:07:18 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3AC6816024A for ; Tue, 17 Jan 2023 06:07:18 +0000 (UTC) X-FDA: 80363258556.09.42475F7 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by imf16.hostedemail.com (Postfix) with ESMTP id 8C730180011 for ; Tue, 17 Jan 2023 06:07:15 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=I4bEeBAY; spf=pass (imf16.hostedemail.com: domain of dvyukov@google.com designates 209.85.208.175 as permitted sender) smtp.mailfrom=dvyukov@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673935635; 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=lB+N5hDJu7j1hmIQtvxGWBe1fqIaRUGQGcJBc+PwjY0=; b=TSs/+96CxUOo0vyt2VDNtXhJTOuJOsFDLjl9mwypgyyhZRSiGOrk8tuAoxgD5vAQc1cV0c 0g8e7FvQCctcAL8AZi99M9ShIFTluJaqMifoHMSZWO4/WijnrZP1ZxjRv36f5GUi0s25gZ 6zRG8WYJ7JayEDUmZqI4eQ60dRzMJLE= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=I4bEeBAY; spf=pass (imf16.hostedemail.com: domain of dvyukov@google.com designates 209.85.208.175 as permitted sender) smtp.mailfrom=dvyukov@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673935635; a=rsa-sha256; cv=none; b=jlErVwA8PhLkNH2sUXI0NKVV5SauDcLNvg8X+8Scth7UclHtDyG8mcBojufIxQHvpPs33P cpALLs575VupUQuOQEM2etKXMlUi+OsxJekWhq0i6/T7JW4ZNMZ58dZAOvLdc+YBNP26v3 Vn2pUVS0Qb3r08OLZ8/Np033SeFIhXw= Received: by mail-lj1-f175.google.com with SMTP id y18so28558048ljk.11 for ; Mon, 16 Jan 2023 22:07:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lB+N5hDJu7j1hmIQtvxGWBe1fqIaRUGQGcJBc+PwjY0=; b=I4bEeBAYRAfXZoab00XgXsczCOGBTC0QHQIXU3lb7S7KVibpH6j4u2n1s4Lkx0dnF7 XLjvlmo0XmMPGSzfAYBVtU4EY8ymhnFKZCkEToeY9FE8ZJz87IKsop+5f88XBCD9dUoX GQDMwXvEfi+nZ4vMNvZfm+xsQ9Hho3yH1a+MLNdMQKQqcAdpjz+JmTWO2JdEiKLbVIiT hKp1MYCNXRaiYizamc7oHtY/V0zwPEFXk72qVg5yErKeK35txJu/ArWzZJK1z7AZbb0W y/ZZI3bFeK7KJM3FX12TdmAPRxrJP23T9vFhbO0NFP+sAENxlVnjPug6qb10D3Y/R3y0 5G3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lB+N5hDJu7j1hmIQtvxGWBe1fqIaRUGQGcJBc+PwjY0=; b=n1LND1JMOyuBT9z56qE7eYPASaJk3+cT31Ejf1gBPZPgRuHbVQ31q6djV6xfaOoFa9 e3pPOHej1L3dTL0KVeU+uPkZosib+8h0DAmwI/c2DzW63StSJiBaWylszLwCL0WoEnzR mxtoywjJ7H13iuz2L5N73GSjn/ZRsRgQYADN9Ac9iERmzMteNXwQ3qtYLNhPWu+45wO+ Sfm4g0cuqjNuC5N64qzySXf2RplF4Oycgul1iXVB4uPrXOV0u9kSOEMtdbMgMyp2xuuR 360MCYvFODlv3xLVxKRPRZ3Laf6uH+P+fqXyCCjT06G+yFmynHIwsrKg7onzIcZR1/X1 0S7g== X-Gm-Message-State: AFqh2kqy/5TphZkm1MtnaXuYtpKRHrRSCcLbxh8GHx4moYgPA3kuh5LA B7oLN1mpsmy2h8VIEZFyDLh+SHkfQQ4U8GVb72nR0g== X-Google-Smtp-Source: AMrXdXvmqA7rduDtf5Al4c0Iccf2xerVDa9obCy7StxCB2kQyMhf0s0mhEy6O9ZyUeNORadahyVYCeGY64bU5+XLrvY= X-Received: by 2002:a2e:a1cb:0:b0:285:7172:61ff with SMTP id c11-20020a2ea1cb000000b00285717261ffmr183106ljm.79.1673935633433; Mon, 16 Jan 2023 22:07:13 -0800 (PST) MIME-Version: 1.0 References: <000000000000baa88c05eaa934bb@google.com> In-Reply-To: From: Dmitry Vyukov Date: Tue, 17 Jan 2023 07:07:00 +0100 Message-ID: Subject: Re: [syzbot] stack segment fault in truncate_inode_pages_final To: Jann Horn Cc: 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, willy@infradead.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8C730180011 X-Stat-Signature: 6tqaegfefdnhtsg6mni5ymu9yfzwx6h6 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673935635-14653 X-HE-Meta: U2FsdGVkX1+xyi7Dd1gOvSYkWhQSjO7rR3lsrHlPTfuEhZOTSxhMULjkOkrrIL7QGYXUjygU9DVAxyCkiZzvPFwQgZPv3uJgKdMKPTEAjQT8Ri2fEZa6HG4wqLWjuGD2fcJY8WtRpQ129S9LnSLSc957msrsWAacbkCeQDI69uAHPIAD/igL+cbwYxQFKeffoRFc5r6s3APQmZGarAMFOrnJVklR0Mz4McOH/nbzDo4jSjpfgsEouFm012L9e/ey3QCVOmVj9nqKBjb7WJmQLxeeLItco3/dyi27rgAOK4y4Dvd9zL1t+/VRw9Said3mGepxJ1y3WKnN5t8JZVrexzvApI0EfYQXHxF7lkJU8/X/TUzM4BnS0olh8y+oF1GhkV93/qgXypSfcINZfZbYz7A27MT4mEvsVr6UZKQTYSoq7xLWHDuGZDj7Ck3Cp2oOh9TyElNeMyhFHFVxawfu6DhAxH0ppxXbwP3akKm7jNjo5LTouo0jCGjNBRlN91+H80SHj7AlZ2QFtFWoidCAtfp35vDEjOLNx0qsahV7YFGea88J2o1e7PZ1J2SRdxVd/RQfISlTHzyrACoLlD7kv7e/ZV8b2o7zucT7OpKwU1wPmiJXccOFwk4b5cqWxHAy1QSgY2wp2tSqIrMoJX9Knmu/sJPTdsC7UsKnjMR7jGnx8yJx1P8+3Kj4B8XjCafBiVTf2gX19Q9F1f0aa8607Keq79ZJg1S5LfoBrBuCR03C22Nv7gAQOrYUeLLZ54QwEdXI9UAY2PTdxYo7IEJ/HyUvumLyBIvHq1ayYLPmCfPSUIrm9epstdIDS5c6dKuOSOeKmh1+iJdA/uy8hmpatTh/GJS4hEJjAis7DsDhUhyEp9nUJOTLTzftpAcGTJpEH8LYbCvqdjsqyf6Mgta249zsYTBBzaT77ujDxT35MN69BRSooUj9DI4nu9mLuQinbEYIx7Lr1V9bqitPKro 13VNnQjm uLkhe3vYGU02VGaFVZqIndvvuJ6qzDA89k38KZSquMXofb8so8CsLFyt4/ldHpBBGPRhR55WsynBfti6ND0y2luUdzLfUpWLM18BVL4+WlHr6XiPnhPtDip1FH+AJrf+SEdOF6uLl5z2q6XC2NscOuCO14itsvBIkRTuvSKFpDZ+3+kkWmn3d+NAeeDCunHf6JDNBuPN8LLI2Mk6bv2aB6w0DifmlEr5mjyNcF6825fnmI32UKRdUhAWP/fWbgQtqe42d6qZWSlxjabc3ycfyT3c7qqfHkHMhy/h44rrp3FFLXAV86AH/2sF9qGjg1tyBgEew 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, 16 Jan 2023 at 21:47, 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 > 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. There is a number of stack corruptions reported for ntfs3: https://lore.kernel.org/all/000000000000bdf37505f1a7fc09@google.com/ https://lore.kernel.org/all/0000000000004b7b3a05f0bc25f8@google.com/ https://lore.kernel.org/all/000000000000b7bd0405f059129a@google.com/ It seems that it somehow very badly corrupts memory and that's not caught by KASAN. > 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. > >