Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1047185rdh; Fri, 27 Oct 2023 03:17:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbzbBPhLeLwgDUE7NkgeU+HSi/K57mKFNCCnS7trpPTzMoAnBNPuHDW61YFucUTkT2zdKO X-Received: by 2002:a25:d38d:0:b0:d90:c424:53ee with SMTP id e135-20020a25d38d000000b00d90c42453eemr2115705ybf.9.1698401824450; Fri, 27 Oct 2023 03:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698401824; cv=none; d=google.com; s=arc-20160816; b=uk4UtWQmmw27IUm9YiYzlhJhatscGDTjSVB+5hUk7YgPUSq+3s+/1lZe0WdbSP1i2R n2X+2kUM3VUfjVVt5bmlL3QYmxwtjPLXOuYJYPTicgqtNBVlEX+r6df7HAIuijRUnj0K LmtEzAYshD8Cf8DovbD4j3faMk+eahL8ObJrGqji96Ejv+mQEbFuUsq2lXBRykhI2S2z HCj8uZQcKhrMWIMWaKJky+qw7VekoC2K+jckZ5UKWdzMh7sOH9wqrn0LV9sO1pgV8XSd OCY+YgoxGVmlgHTNTb8aCoC8O+6VpkEriDZhDUwAK7ONePBIO6sbE7XINL7WlZaNAN1p O+tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id:dkim-signature; bh=QUkeruQWIYVp7XgnkDdOY4u2ihcYqLI93q0PC0WEGtE=; fh=AIsZdsoOT8p/j7ELRy/+wcjGEYbb8ubzR42ugu0IxN0=; b=lRjsaN2/awsrOSiAWDSpwiGlalHhX7K7VhlyPvqpd3oC25KsZoCMNcQiKIfzYlR2+k xcO6AOPiJVCiaHM2rraY9jp89j6XaDNWmGQJ2IOzCxOkkLHwy3hs20raQhQXaYJVmDGs DaSA6iE+bJL8Ixp2dOie/vjrswrcWcTH5MeGhj0pnS+kU4duk2Ev5YOmbKx0/pz5rHuX c/m95I3QLs/OmRqHaXfRz5tgZpXVXMdeItZWTYNFXkIYw0z739+LRneY+KBliJIE5iWe KJumiTrYdpP+foHspvacqYIpBvOM8D5/lQRr8ZYd93fg0jOnUltEdHkk1FMqqYOOKL0S +Niw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BwDm/Z6c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id n138-20020a25d690000000b00da0c75b05a3si1952096ybg.630.2023.10.27.03.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 03:17:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BwDm/Z6c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5A8E9821631B; Fri, 27 Oct 2023 03:17:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345596AbjJ0KQ1 (ORCPT + 99 others); Fri, 27 Oct 2023 06:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345722AbjJ0KQW (ORCPT ); Fri, 27 Oct 2023 06:16:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C5F196; Fri, 27 Oct 2023 03:16:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0672C433C8; Fri, 27 Oct 2023 10:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698401779; bh=4fUwCmh3aJLtidgC+TUbXK1gRF+kVmTye+QZ20QsJ80=; h=Subject:From:To:Date:In-Reply-To:References:From; b=BwDm/Z6ckHYn0M0+TrPfEdhK1nBIlaIliRl0Ybg91eHjVixIdLevpPaRKvmftAMEm IZrOGxqJNms0OnEXycIJT9OrYkbf89Zjeata2QfkzPvocEUugZlMm8CjsRuu40OOdv lMD2DAJ6qaeKrhOOggYbz68O1ezKbBPQAxfTaYC74mK7m15f0nqOgJ21S9o6cUCN19 6aInWdx0Wnk7kwuk/YhKkBmD3PX6R7yApQ6QS0qcBps44pF7Ny6wUueybPSF3n5hWz lVgR2HidXjBFbDkyteUop+808/7NofOCQYUdlr2Oprmyc6awq8XT/2wlRBOFQasSwK 0GM3Po/r0uNWg== Message-ID: <6b12ba28a4bd276ecd6ffbd97af76de46c72788a.camel@kernel.org> Subject: Re: [syzbot] [ext4?] general protection fault in locks_remove_posix From: Jeff Layton To: syzbot , adilger.kernel@dilger.ca, brauner@kernel.org, chuck.lever@oracle.com, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tytso@mit.edu, viro@zeniv.linux.org.uk Date: Fri, 27 Oct 2023 06:16:17 -0400 In-Reply-To: <000000000000ef757e0608aba23d@google.com> References: <000000000000ef757e0608aba23d@google.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 27 Oct 2023 03:17:01 -0700 (PDT) On Thu, 2023-10-26 at 22:05 -0700, syzbot wrote: > Hello, >=20 > syzbot found the following issue on: >=20 > HEAD commit: 2030579113a1 Add linux-next specific files for 20231020 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=3D14e7573968000= 0 > kernel config: https://syzkaller.appspot.com/x/.config?x=3D37404d76b3c88= 40e > dashboard link: https://syzkaller.appspot.com/bug?extid=3Dba2c35eb32f5a85= 137f8 > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for D= ebian) 2.40 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=3D125607f5680= 000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=3D12a22e9368000= 0 >=20 > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/a99a981e5d78/dis= k-20305791.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/073a5ba6a2a6/vmlinu= x-20305791.xz > kernel image: https://storage.googleapis.com/syzbot-assets/c7c1a7107f7b/b= zImage-20305791.xz > mounted in repro: https://storage.googleapis.com/syzbot-assets/81394ce585= 9f/mount_0.gz >=20 > IMPORTANT: if you fix the issue, please add the following tag to the comm= it: > Reported-by: syzbot+ba2c35eb32f5a85137f8@syzkaller.appspotmail.com >=20 > general protection fault, probably for non-canonical address 0xdffffc001f= fff11a: 0000 [#1] PREEMPT SMP KASAN > KASAN: probably user-memory-access in range [0x00000000ffff88d0-0x0000000= 0ffff88d7] > CPU: 1 PID: 5052 Comm: udevd Not tainted 6.6.0-rc6-next-20231020-syzkalle= r #0 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS G= oogle 09/06/2023 > RIP: 0010:list_empty include/linux/list.h:373 [inline] > RIP: 0010:locks_remove_posix+0x100/0x510 fs/locks.c:2555 > Code: 4d 8b ae 20 02 00 00 4d 85 ed 0f 84 0c 02 00 00 e8 15 60 7d ff 49 8= d 55 50 48 b9 00 00 00 00 00 fc ff df 48 89 d6 48 c1 ee 03 <80> 3c 0e 00 0f= 85 ae 03 00 00 49 8b 45 50 48 39 c2 0f 84 db 01 00 > RSP: 0018:ffffc90003d6f948 EFLAGS: 00010202 > RAX: 0000000000000000 RBX: ffff8880271cca00 RCX: dffffc0000000000 > RDX: 00000000ffff88d0 RSI: 000000001ffff11a RDI: ffff8880796982e0 > RBP: 1ffff920007adf2b R08: 0000000000000003 R09: 0000000000004000 > R10: 0000000000000000 R11: dffffc0000000000 R12: ffffc90003d6f988 > R13: 00000000ffff8880 R14: ffff8880796980c0 R15: ffff8880271ccb90 > FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000= 000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 00007fc227c3e000 CR3: 000000002000e000 CR4: 00000000003506f0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > Call Trace: > > filp_flush+0x11b/0x1a0 fs/open.c:1554 > filp_close+0x1c/0x30 fs/open.c:1563 > close_files fs/file.c:432 [inline] > put_files_struct fs/file.c:447 [inline] > put_files_struct+0x1df/0x360 fs/file.c:444 > exit_files+0x82/0xb0 fs/file.c:464 > do_exit+0xa51/0x2ac0 kernel/exit.c:866 > do_group_exit+0xd3/0x2a0 kernel/exit.c:1021 > get_signal+0x2391/0x2760 kernel/signal.c:2904 > arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:309 > exit_to_user_mode_loop kernel/entry/common.c:168 [inline] > exit_to_user_mode_prepare+0x11c/0x240 kernel/entry/common.c:204 > __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] > syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 > do_syscall_64+0x4b/0x110 arch/x86/entry/common.c:88 > entry_SYSCALL_64_after_hwframe+0x63/0x6b > RIP: 0033:0x7fc2276be3cd > Code: Unable to access opcode bytes at 0x7fc2276be3a3. > RSP: 002b:00007ffd929ccc20 EFLAGS: 00000246 ORIG_RAX: 00000000000000ea > RAX: 0000000000000000 RBX: 00007fc227b0bc80 RCX: 00007fc2276be3cd > RDX: 0000000000000006 RSI: 00000000000013bc RDI: 00000000000013bc > RBP: 00000000000013bc R08: 0000000000000000 R09: 0000000000000002 > R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000006 > R13: 00007ffd929cce30 R14: 0000000000001000 R15: 0000000000000000 > > Modules linked in: > ---------------- > Code disassembly (best guess): > 0: 4d 8b ae 20 02 00 00 mov 0x220(%r14),%r13 > 7: 4d 85 ed test %r13,%r13 > a: 0f 84 0c 02 00 00 je 0x21c > 10: e8 15 60 7d ff call 0xff7d602a > 15: 49 8d 55 50 lea 0x50(%r13),%rdx > 19: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx > 20: fc ff df > 23: 48 89 d6 mov %rdx,%rsi > 26: 48 c1 ee 03 shr $0x3,%rsi > * 2a: 80 3c 0e 00 cmpb $0x0,(%rsi,%rcx,1) <-- trapping instru= ction > 2e: 0f 85 ae 03 00 00 jne 0x3e2 > 34: 49 8b 45 50 mov 0x50(%r13),%rax > 38: 48 39 c2 cmp %rax,%rdx > 3b: 0f .byte 0xf > 3c: 84 db test %bl,%bl > 3e: 01 00 add %eax,(%rax) >=20 Hrm, this is a curious one. The relevant code is here: = =20 ctx =3D locks_inode_context(inode); = =20 if (!ctx || list_empty(&ctx->flc_posix)) =20 return; =20 So in this case, ctx was non-NULL, but apparently the i_flctx pointer was bogus (or maybe the list in it was corrupt? Not certain here). That pointer is initialized to NULL in inode_init_always, and it's only ever set via cmpxchg in locks_get_lock_context. The assembly looks really weird, but I found this mail from Linus that explains some of what we're seeing (but in the context of a percpu var problem): https://lkml.org/lkml/2023/10/8/295 I'm stumped. I don't see how this could happen right offhand, so I'm left to wonder if maybe we have some sort of generic memory corruption here? Could this be a KASAN bug of some sort? --=20 Jeff Layton