Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp435747ybg; Wed, 10 Jun 2020 04:50:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNfHCBR8l0bx7fMZvrVmeJRLCGQIBelbOmtj0KiIOuG5fop8YW3uLhp/3aiMskmeVwXbJy X-Received: by 2002:a17:906:2409:: with SMTP id z9mr2869469eja.442.1591789823422; Wed, 10 Jun 2020 04:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591789823; cv=none; d=google.com; s=arc-20160816; b=WpVXyVMwI54iwdM4lYrAGTHXOo0xtZp0ferMq9uh0I1JN9aTR4gN0I39e6jC3NtPaA J7T94BikZ/BL+6VYtNCz63T/zUQYDUg9Ys8i3AM3jT5xVjFbe/YklTpGJoPzutciuBZS YkjEUmH7ufW7CEZIi9poo9dWHFvpo652lCdc7MiUkwNAtnubiTwOsQNSPHCtL9Gz0aby k+V9tktmLxvPVm08inc5qWaGydwr6/pjBa3E7GhdszV1h7zA7ziNbU3OAZKklc4YZeah p/yRVQc3NBKW2qFHeOtdSairsoeODJKakP6VOsgnMTyAqXfWokMjdiflqOyK1ivMbNix kGhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=CKeMQytC1ZeUu/DMFHA1ZbpmQ0lz4hvpVtwp6ag+z/Q=; b=mLnY1TICaFlb40Vn/4BXV4ZBikbJZlAUPyV6mb5BNZb3uxcvdXqPnRvde/z8Dr/sJi vsUGGT//1wYckWqv3nn+PO6kA16INMPmfTEmtOP0wlqX700HJ5Iv20sYoqUnXeMbhbRh BY0hr/b64ijrxXvq/nKrnLP7i8jGjk1THqxrI4+NzVytpWRLusmj2U2vAcybHgKaqS7r q6lfR5/FuDnFAa5GnXo8l+E/pSSDB+Cl3GFPtnAVkaODr9qUd4CezaWYo8XZAoZwHTSK TYhZDJ2EY9cKPeQZNahO3QEbNkpmFDQxssxJqjFm5fRi6UthDE/6GZYCGeudUG8+u/NU 2aUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j27si744285eja.627.2020.06.10.04.50.00; Wed, 10 Jun 2020 04:50:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728614AbgFJLox (ORCPT + 99 others); Wed, 10 Jun 2020 07:44:53 -0400 Received: from raptor.unsafe.ru ([5.9.43.93]:49996 "EHLO raptor.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728562AbgFJLow (ORCPT ); Wed, 10 Jun 2020 07:44:52 -0400 Received: from comp-core-i7-2640m-0182e6 (ip-89-102-33-211.net.upcbroadband.cz [89.102.33.211]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by raptor.unsafe.ru (Postfix) with ESMTPSA id 6B800203BD; Wed, 10 Jun 2020 11:44:46 +0000 (UTC) Date: Wed, 10 Jun 2020 13:44:41 +0200 From: Alexey Gladkov To: Tetsuo Handa Cc: viro@zeniv.linux.org.uk, syzbot , adobriyan@gmail.com, ebiederm@xmission.com, keescook@chromium.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: general protection fault in proc_kill_sb Message-ID: <20200610114441.mw42cph3gmto7gsh@comp-core-i7-2640m-0182e6> References: <0000000000002d7ca605a7b8b1c5@google.com> <10cd85a7-2958-57a8-aa7e-0075194fc788@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10cd85a7-2958-57a8-aa7e-0075194fc788@I-love.SAKURA.ne.jp> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.1 (raptor.unsafe.ru [5.9.43.93]); Wed, 10 Jun 2020 11:44:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 10, 2020 at 08:23:33PM +0900, Tetsuo Handa wrote: > On 2020/06/10 19:56, syzbot wrote: > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit: 7ae77150 Merge tag 'powerpc-5.8-1' of git://git.kernel.org.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=16e12212100000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=d195fe572fb15312 > > dashboard link: https://syzkaller.appspot.com/bug?extid=4abac52934a48af5ff19 > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > > > Unfortunately, I don't have any reproducer for this crash yet. > > The report says proc_sb_info(sb) == NULL at proc_kill_sb() which was called via > fs->kill_sb(s) from deactivate_locked_super(). The console log says that memory > allocation for proc_sb_info(sb) failed due to memory allocation fault injection. > > [ 1492.052802][ T6840] FAULT_INJECTION: forcing a failure. > [ 1492.052802][ T6840] name failslab, interval 1, probability 0, space 0, times 0 > [ 1492.077153][ T6840] CPU: 0 PID: 6840 Comm: syz-executor.2 Not tainted 5.7.0-syzkaller #0 > [ 1492.085449][ T6840] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > [ 1492.095511][ T6840] Call Trace: > [ 1492.098811][ T6840] dump_stack+0x188/0x20d > [ 1492.103157][ T6840] should_fail.cold+0x5/0xa > [ 1492.107686][ T6840] ? fault_create_debugfs_attr+0x140/0x140 > [ 1492.107721][ T6840] ? idr_replace+0xee/0x160 > [ 1492.127210][ T6840] should_failslab+0x5/0xf > [ 1492.131638][ T6840] kmem_cache_alloc_trace+0x2d0/0x7d0 > [ 1492.137020][ T6840] ? up_write+0x148/0x470 > [ 1492.141367][ T6840] proc_fill_super+0x79/0x5c0 > [ 1492.146052][ T6840] ? proc_parse_param+0x8a0/0x8a0 > [ 1492.151092][ T6840] vfs_get_super+0x12e/0x2d0 > [ 1492.155694][ T6840] vfs_get_tree+0x89/0x2f0 > [ 1492.160126][ T6840] do_mount+0x1306/0x1b40 > [ 1492.164467][ T6840] ? copy_mount_string+0x40/0x40 > [ 1492.169411][ T6840] ? __might_fault+0x190/0x1d0 > [ 1492.174188][ T6840] ? _copy_from_user+0x13c/0x1a0 > [ 1492.179138][ T6840] ? memdup_user+0x7c/0xd0 > [ 1492.183575][ T6840] __x64_sys_mount+0x18f/0x230 > [ 1492.188351][ T6840] do_syscall_64+0xf6/0x7d0 > [ 1492.192861][ T6840] entry_SYSCALL_64_after_hwframe+0x49/0xb3 > [ 1492.198759][ T6840] RIP: 0033:0x45ca69 > > That is, proc_kill_sb() was assuming "s->s_fs_info = fs_info;" is always > called from proc_fill_super() which is called via fill_super(sb, fc); from > vfs_get_super(). Yes. If fill_super() fails before filling up fs_info, deactivate_locked_super() will be called and sb->s_fs_info may be NULL. -- Rgrds, legion