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 X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECD60C433E6 for ; Thu, 11 Feb 2021 11:22:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 54A0264DD8 for ; Thu, 11 Feb 2021 11:22:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54A0264DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DBFA16B00C8; Thu, 11 Feb 2021 06:22:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D70306B00C9; Thu, 11 Feb 2021 06:22:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE9456B00CA; Thu, 11 Feb 2021 06:22:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id A18706B00C8 for ; Thu, 11 Feb 2021 06:22:53 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6BC35180AD807 for ; Thu, 11 Feb 2021 11:22:53 +0000 (UTC) X-FDA: 77805749826.11.level34_180417327618 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 42ED9180F8B82 for ; Thu, 11 Feb 2021 11:22:53 +0000 (UTC) X-HE-Tag: level34_180417327618 X-Filterd-Recvd-Size: 7610 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 11 Feb 2021 11:22:52 +0000 (UTC) Received: by mail-qv1-f43.google.com with SMTP id y10so2360937qvo.6 for ; Thu, 11 Feb 2021 03:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yKLbOoiR4DLnAkhjQMVpKv3hHURQRcFkn3rJSpSJFOo=; b=kRnssf0BSDMjeFW1Rx1lmwg6OyPtjRUZ9OzkepqOVK7hpF4WNTroF53JkwLdgjxH7F d9HY+leE2NOjUGuy62Qun5IGCyfCZ3Pi0svX0d5XtlH0VNA8eN8xKpMIGYJfiMvnrkDS iODTSdOsBGWJRBwSWF4m4PmY0tL8FDut2wQUDpytrkzQla1z4LcG6+yVqP98sScpLfj0 w4IvcDqfXQXMID4zx57iZWboReP22jT0aYSlcUluSAu9eEtNsSTIzLx+/NhFywZsnW2W 4odigVTDU/YOB9N2x3zHxneVTnhnxQLq6qm/Fjtk3PWSBDhPoRm+vf5w/S2PVlNIh83t +jbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yKLbOoiR4DLnAkhjQMVpKv3hHURQRcFkn3rJSpSJFOo=; b=qH/PNO3NNxS3BuwASx8RK4kJlkJafwZ+UrNMc9E9hVTcEWDCWsVb44IRHaUxy2213S BPEZ2d6p3K4EnaPI+QTNiaRteyWASsrMOKbBhK5UcD67R1TYBH95dtzOF7NIOQv3V8Rd 4LZzi6SClBPBaNmIH+RqxPEpKPrX7CN14WbU8mBNK1Svde6XSAYlZQqjZ+4qUnVpFA4S 1qBox1dpynfVLTIdAefLSXZwzW9OVzItuF4orP3DDU2DoV7qhNuWK4O3oEtKh4JyLSxX +upR3klSHjw6+L+FaVSHT9TW0AyLNWqWGbvMf2CsVHbfPja2A02Nrv4o1vPbFbNWlFf2 nB8w== X-Gm-Message-State: AOAM533UxmIvq1p5VGPjgq3WqmXW9qm1Qq6kAO/4DMehEAfBZoaOh8E2 wobhbQ6TjWynbDxuGJCnyBhvZ3DgypUErDrPcUmBew== X-Google-Smtp-Source: ABdhPJyuSY9nn2/UDdc2xuExOyTCI2a2uj2sp3RG/dTHiWL43AlWc1oWQRuN0ZU+IzvlgvNZ0sgVSYE+iKChCNZ8xkw= X-Received: by 2002:a0c:8365:: with SMTP id j92mr7284032qva.19.1613042571526; Thu, 11 Feb 2021 03:22:51 -0800 (PST) MIME-Version: 1.0 References: <000000000000563a0205bafb7970@google.com> <20210211104947.GL19070@quack2.suse.cz> In-Reply-To: <20210211104947.GL19070@quack2.suse.cz> From: Dmitry Vyukov Date: Thu, 11 Feb 2021 12:22:39 +0100 Message-ID: Subject: Re: possible deadlock in start_this_handle (2) To: Jan Kara Cc: syzbot , Jan Kara , linux-ext4@vger.kernel.org, LKML , syzkaller-bugs , "Theodore Ts'o" , Michal Hocko , Linux-MM Content-Type: text/plain; charset="UTF-8" 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 Thu, Feb 11, 2021 at 11:49 AM Jan Kara wrote: > > Hello, > > added mm guys to CC. > > On Wed 10-02-21 05:35:18, syzbot wrote: > > HEAD commit: 1e0d27fc Merge branch 'akpm' (patches from Andrew) > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=15cbce90d00000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=bd1f72220b2e57eb > > dashboard link: https://syzkaller.appspot.com/bug?extid=bfdded10ab7dcd7507ae > > userspace arch: i386 > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+bfdded10ab7dcd7507ae@syzkaller.appspotmail.com > > > > ====================================================== > > WARNING: possible circular locking dependency detected > > 5.11.0-rc6-syzkaller #0 Not tainted > > ------------------------------------------------------ > > kswapd0/2246 is trying to acquire lock: > > ffff888041a988e0 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xf81/0x1380 fs/jbd2/transaction.c:444 > > > > but task is already holding lock: > > ffffffff8be892c0 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:5195 > > > > which lock already depends on the new lock. > > > > the existing dependency chain (in reverse order) is: > > > > -> #2 (fs_reclaim){+.+.}-{0:0}: > > __fs_reclaim_acquire mm/page_alloc.c:4326 [inline] > > fs_reclaim_acquire+0x117/0x150 mm/page_alloc.c:4340 > > might_alloc include/linux/sched/mm.h:193 [inline] > > slab_pre_alloc_hook mm/slab.h:493 [inline] > > slab_alloc_node mm/slub.c:2817 [inline] > > __kmalloc_node+0x5f/0x430 mm/slub.c:4015 > > kmalloc_node include/linux/slab.h:575 [inline] > > kvmalloc_node+0x61/0xf0 mm/util.c:587 > > kvmalloc include/linux/mm.h:781 [inline] > > ext4_xattr_inode_cache_find fs/ext4/xattr.c:1465 [inline] > > ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1508 [inline] > > ext4_xattr_set_entry+0x1ce6/0x3780 fs/ext4/xattr.c:1649 > > ext4_xattr_ibody_set+0x78/0x2b0 fs/ext4/xattr.c:2224 > > ext4_xattr_set_handle+0x8f4/0x13e0 fs/ext4/xattr.c:2380 > > ext4_xattr_set+0x13a/0x340 fs/ext4/xattr.c:2493 > > ext4_xattr_user_set+0xbc/0x100 fs/ext4/xattr_user.c:40 > > __vfs_setxattr+0x10e/0x170 fs/xattr.c:177 > > __vfs_setxattr_noperm+0x11a/0x4c0 fs/xattr.c:208 > > __vfs_setxattr_locked+0x1bf/0x250 fs/xattr.c:266 > > vfs_setxattr+0x135/0x320 fs/xattr.c:291 > > setxattr+0x1ff/0x290 fs/xattr.c:553 > > path_setxattr+0x170/0x190 fs/xattr.c:572 > > __do_sys_setxattr fs/xattr.c:587 [inline] > > __se_sys_setxattr fs/xattr.c:583 [inline] > > __ia32_sys_setxattr+0xbc/0x150 fs/xattr.c:583 > > do_syscall_32_irqs_on arch/x86/entry/common.c:77 [inline] > > __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:139 > > do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:164 > > entry_SYSENTER_compat_after_hwframe+0x4d/0x5c > > This stacktrace should never happen. ext4_xattr_set() starts a transaction. > That internally goes through start_this_handle() which calls: > > handle->saved_alloc_context = memalloc_nofs_save(); > > and we restore the allocation context only in stop_this_handle() when > stopping the handle. And with this fs_reclaim_acquire() should remove > __GFP_FS from the mask and not call __fs_reclaim_acquire(). > > Now I have no idea why something here didn't work out. Given we don't have > a reproducer it will be probably difficult to debug this. I'd note that > about year and half ago similar report happened (got autoclosed) so it may > be something real somewhere but it may also be just some HW glitch or > something like that. HW glitch is theoretically possible. But if we are considering such causes, I would say a kernel memory corruption is way more likely, we have hundreds of known memory-corruption-capable bugs open. In most cases they are caught by KASAN before doing silent damage. But KASAN can miss some cases. I see at least 4 existing bugs with similar stack: https://syzkaller.appspot.com/bug?extid=bfdded10ab7dcd7507ae https://syzkaller.appspot.com/bug?extid=a7ab8df042baaf42ae3c https://syzkaller.appspot.com/bug?id=c814a55a728493959328551c769ede4c8ff72aab https://syzkaller.appspot.com/bug?id=426ad9adca053dafcd698f3a48ad5406dccc972b All in all, I would not assume it's a memory corruption. When we had bugs that actually caused silent memory corruption, that caused a spike of random one-time crashes all over the kernel. This does not look like it.