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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 70DF5C433F5 for ; Tue, 14 Sep 2021 13:04:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ECDD0610D1 for ; Tue, 14 Sep 2021 13:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ECDD0610D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5D792900002; Tue, 14 Sep 2021 09:04:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 587076B0071; Tue, 14 Sep 2021 09:04:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FFD7900002; Tue, 14 Sep 2021 09:04:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id 2F4C06B006C for ; Tue, 14 Sep 2021 09:04:20 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 64A6B16476 for ; Tue, 14 Sep 2021 13:04:19 +0000 (UTC) X-FDA: 78586197438.22.4CF68F3 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf08.hostedemail.com (Postfix) with ESMTP id D3D5A30000A9 for ; Tue, 14 Sep 2021 13:04:18 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9813A220F1; Tue, 14 Sep 2021 13:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1631624657; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XfNo/PB+wP3vn9suwpWMDBy00tnfx8VX3IMklC5CpLQ=; b=LCOmLV2MicEy9/PuQjD0ZapzaYt912LyVe4jlXbrGAcKpHMzwCoPy0f2uhPYg3Jo2F4UoQ yFnwKz7LntjtdyiC8Yu12S7h6WH0LhWU46ANjgcr9PEMsK+qCTX5jEe5zYJ3mOEKLuyCD0 gvQ1VG6K2mhVvQ1daXdLOkVrklp1z8I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1631624657; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XfNo/PB+wP3vn9suwpWMDBy00tnfx8VX3IMklC5CpLQ=; b=O81SMGbSpgfKBez3HfyxKpKfoFJoY18wr5itI6rLiuP4U4OV6mRL6la7P6N/bLHkMAcG9K 0U7RWpldPPxS3qAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7D16B13B88; Tue, 14 Sep 2021 13:04:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IIjGHdGdQGE3QQAAMHmgww (envelope-from ); Tue, 14 Sep 2021 13:04:17 +0000 Message-ID: Date: Tue, 14 Sep 2021 15:04:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [syzbot] riscv/fixes boot error: BUG: unable to handle kernel NULL pointer dereference in corrupted Content-Language: en-US To: Tetsuo Handa , syzbot , syzkaller-bugs@googlegroups.com, linux-mm , Michal Hocko , Andrew Morton References: <000000000000c81e6305cbf2319c@google.com> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=LCOmLV2M; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=O81SMGbS; spf=pass (imf08.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Stat-Signature: kgumzkw691uf7pjfj8az3h7es6u65fbf X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D3D5A30000A9 X-HE-Tag: 1631624658-4508 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 9/14/21 12:55, Tetsuo Handa wrote: > Hmm, I feel that something is wrong with slub... Any idea? Weird. > #syz dup: BUG: unable to handle kernel paging request in tomoyo_encode2 > > On 2021/09/14 19:39, syzbot wrote: >> Hello, >> >> syzbot found the following issue on: >> >> HEAD commit: 7d2a07b76933 Linux 5.14 >> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes >> console output: https://syzkaller.appspot.com/x/log.txt?x=15cb131b300000 >> kernel config: https://syzkaller.appspot.com/x/.config?x=f8211b06020972e8 >> dashboard link: https://syzkaller.appspot.com/bug?extid=2a1797e8845b57b4a3c2 >> compiler: riscv64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.1 >> userspace arch: riscv64 >> >> IMPORTANT: if you fix the issue, please add the following tag to the commit: >> Reported-by: syzbot+2a1797e8845b57b4a3c2@syzkaller.appspotmail.com >> >> Unable to handle kernel NULL pointer dereference at virtual address 0000000000000d48 >> Oops [#1] >> Modules linked in: >> CPU: 1 PID: 2924 Comm: kworker/u4:5 Not tainted 5.14.0-syzkaller #0 >> Hardware name: riscv-virtio,qemu (DT) >> epc : slab_alloc_node mm/slub.c:2900 [inline] That's this line: tid = this_cpu_read(s->cpu_slab->tid); This would mean something's off with the percpu variable s->cpu_slab. Looking at the original report: https://lore.kernel.org/all/000000000000bae2cf05cad87aff@google.com/ That's even more weird, we passed this line but crashed a bit later in this_cpu_cmpxchg_double() which also accesses s->cpu_slab. Did the "s" pointer itself get corrupted? >> epc : slab_alloc mm/slub.c:2967 [inline] >> epc : __kmalloc+0xce/0x388 mm/slub.c:4111 >> ra : slab_pre_alloc_hook mm/slab.h:494 [inline] >> ra : slab_alloc_node mm/slub.c:2880 [inline] >> ra : slab_alloc mm/slub.c:2967 [inline] >> ra : __kmalloc+0x6e/0x388 mm/slub.c:4111 >> epc : ffffffff803e3568 ra : ffffffff803e3508 sp : ffffffe008c6f780 >> gp : ffffffff83f967d8 tp : ffffffe00b71df00 t0 : ffffffc400b37600 >> t1 : 0000000000000001 t2 : 0000000000000000 s0 : ffffffe008c6f820 >> s1 : ffffffe005601500 a0 : 0000000000000000 a1 : ffffffe008c6fb6c >> a2 : 1ffffffc016e3d07 a3 : 0000000000000d48 a4 : 0000000000000001 >> a5 : ffffffff82e4b290 a6 : 0000000000f00000 a7 : ffffffff8038ca52 >> s2 : ffffffff83f96adc s3 : 0000000000000d40 s4 : 0000000000000019 >> s5 : ffffffff8080a860 s6 : ffffffff83f9a0d0 s7 : 0000000000000000 >> s8 : 0000000000000d40 s9 : 0000000000000001 s10: ffffffe005aeb6e0 >> s11: 000000000000002f t3 : 4f89673883b77f00 t4 : ffffffc40118df07 >> t5 : ffffffc40118df09 t6 : ffffffe0059baffe >> status: 0000000000000120 badaddr: 0000000000000d48 cause: 000000000000000d >> [] slab_alloc_node mm/slub.c:2900 [inline] >> [] slab_alloc mm/slub.c:2967 [inline] >> [] __kmalloc+0xce/0x388 mm/slub.c:4111 >> [] kmalloc include/linux/slab.h:596 [inline] >> [] kzalloc include/linux/slab.h:721 [inline] >> [] tomoyo_encode2.part.0+0xf0/0x262 security/tomoyo/realpath.c:45 >> [] tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] >> [] tomoyo_encode security/tomoyo/realpath.c:80 [inline] >> [] tomoyo_realpath_from_path+0x14c/0x3f4 security/tomoyo/realpath.c:288 >> [] tomoyo_init_log+0x7a2/0x13aa security/tomoyo/audit.c:263 >> [] tomoyo_supervisor+0x1bc/0xb0c security/tomoyo/common.c:2097 >> [] tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] >> [] tomoyo_env_perm+0x100/0x120 security/tomoyo/environ.c:63 >> [] tomoyo_environ security/tomoyo/domain.c:672 [inline] >> [] tomoyo_find_next_domain+0xd24/0x109a security/tomoyo/domain.c:879 >> [] tomoyo_bprm_check_security security/tomoyo/tomoyo.c:101 [inline] >> [] tomoyo_bprm_check_security+0xdc/0x136 security/tomoyo/tomoyo.c:91 >> [] security_bprm_check+0x44/0x96 security/security.c:866 >> [] search_binary_handler fs/exec.c:1709 [inline] >> [] exec_binprm fs/exec.c:1762 [inline] >> [] bprm_execve fs/exec.c:1831 [inline] >> [] bprm_execve+0x4ba/0x10a6 fs/exec.c:1793 >> [] kernel_execve+0x204/0x288 fs/exec.c:1974 >> [] call_usermodehelper_exec_async+0x1bc/0x2d8 kernel/umh.c:112 >> [] ret_from_exception+0x0/0x14 >> ---[ end trace 77235688c0a8656b ]--- >> >> >> --- >> 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. >> > >