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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A239C433EF for ; Fri, 18 Feb 2022 20:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239485AbiBRUeI (ORCPT ); Fri, 18 Feb 2022 15:34:08 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234170AbiBRUeF (ORCPT ); Fri, 18 Feb 2022 15:34:05 -0500 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6693833354 for ; Fri, 18 Feb 2022 12:33:48 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id o10so5578874ilh.0 for ; Fri, 18 Feb 2022 12:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ezvsvchx2nUrNXjulTpQnqP/UL35iteRMo/MbI6yggw=; b=Ckqkc00JrGDi6HmRG7q8ohNa40xUmPGtlIEGIUdRjd7XoKtniFSNtK8AxLSIlyWG2i s5rMFyMDsQrML/vf9ED51fT7QBdErMVL7TRrrJDC5uy0nWG+tkuv6lxiT5LQRqlaunLY xQO1ojYeS2oxyelFVB2HTVoOuAjNYxQxLOQbPGTKDFRLjcTHKnlc0tkRTu20Sb2rV6RC te9LSFj0kBXSZ79xXCJ8bsiDXlmRmWPfXTR+2xcnkfNi7E+Zar2pykR6fdqf37+z/ob1 wFhYb4IIe1pe5dJ9J0h55+JfdTR5pWB7VZXW4Hvvym5Z9E/W1lOhGL1YRY9F76gJL/YA L7jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ezvsvchx2nUrNXjulTpQnqP/UL35iteRMo/MbI6yggw=; b=3JtHExeKf8KF+xzsfJpf22s5oLQYELNqzYS88aj9R6pkCLd5XQpvPiOBE64MJQR6t2 yG5yHJ5K0CZzlxtaNvIsSGFcv9+Y+OpCpWE+MWPU9XmzQaeezKV3+e8WRzrfIeeaUNZK 5HgkovBb22RQaWqO3s4Y6Si5tUmYOYx3h+50YSUXWQ/M9x/xTQxj/duK+7YfMYostNLt 2eyeax1ql8HyQNBbQYONRj0B5C5qrklXl3cVlf9zTbQ4qIG7qqqcF6FLltVAPhn+LIwY SRMQjLYxQMb6fnCmEG7jSLFQ8e0SNeM+xhZSKSPNF3Z4OEpTkJfIIw0WPON8lF/yjJsz oQ9A== X-Gm-Message-State: AOAM530TOmIfJw5HMU377sNyPzc+oqqAkmMc9qRwgfs+sYwKtYypsG+w xHXCutN0HxgigNRn2R1vySXQOBBUw33n3C45K0ihFw== X-Google-Smtp-Source: ABdhPJygk7EeWASgvdvSr9hY38K732LIuASEbSD6NpXpWPiwBwk91jovTWJpGC613wrC33QTB7/iXiFtoQsx5B+DmwI= X-Received: by 2002:a05:6e02:b27:b0:2c1:a9cd:e300 with SMTP id e7-20020a056e020b2700b002c1a9cde300mr3069058ilu.44.1645216427582; Fri, 18 Feb 2022 12:33:47 -0800 (PST) MIME-Version: 1.0 References: <00000000000038779505d5d8b372@google.com> In-Reply-To: From: Aleksandr Nogikh Date: Fri, 18 Feb 2022 21:33:36 +0100 Message-ID: Subject: Re: [syzbot] riscv/fixes boot error: can't ssh into the instance To: Alexandre Ghiti Cc: Dmitry Vyukov , Alexandre Ghiti , linux-riscv@lists.infradead.org, kasan-dev , Palmer Dabbelt , syzbot , LKML , syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On Fri, Feb 18, 2022 at 2:45 PM Alexandre Ghiti wrote: > > Hi Aleksandr, > > On Thu, Feb 17, 2022 at 6:08 PM Aleksandr Nogikh wrote: > > > > Hi Alex, > > > > On Thu, Feb 17, 2022 at 5:53 PM Alexandre Ghiti > > wrote: > > > > > > Aleksandr, > > > > > > On Wed, Feb 16, 2022 at 5:58 PM Alexandre Ghiti > > > wrote: > > > > > > > > First, thank you for working on this. > > > > > > > > On Wed, Feb 16, 2022 at 5:17 PM Aleksandr Nogikh wrote: > > > > > > > > > > If I use just defconfig + DEBUG_VIRTUAL, without any KASAN, it begins > > > > > to boot, but overwhelms me with tons of `virt_to_phys used for > > > > > non-linear address:` errors. > > > > > > > > > > Like that > > > > > > > > > > [ 2.701271] virt_to_phys used for non-linear address: > > > > > 00000000b59e31b6 (0xffffffff806c2000) > > > > > [ 2.701727] WARNING: CPU: 0 PID: 1 at arch/riscv/mm/physaddr.c:16 > > > > > __virt_to_phys+0x7e/0x86 > > > > > [ 2.702207] Modules linked in: > > > > > [ 2.702393] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W > > > > > 5.17.0-rc1 #1 > > > > > [ 2.702806] Hardware name: riscv-virtio,qemu (DT) > > > > > [ 2.703051] epc : __virt_to_phys+0x7e/0x86 > > > > > [ 2.703298] ra : __virt_to_phys+0x7e/0x86 > > > > > [ 2.703547] epc : ffffffff80008448 ra : ffffffff80008448 sp : > > > > > ffff8f800021bde0 > > > > > [ 2.703977] gp : ffffffff80ed9b30 tp : ffffaf8001230000 t0 : > > > > > ffffffff80eea56f > > > > > [ 2.704704] t1 : ffffffff80eea560 t2 : 0000000000000000 s0 : > > > > > ffff8f800021be00 > > > > > [ 2.705153] s1 : ffffffff806c2000 a0 : 000000000000004f a1 : > > > > > ffffffff80e723d8 > > > > > [ 2.705555] a2 : 0000000000000010 a3 : fffffffffffffffe a4 : > > > > > 0000000000000000 > > > > > [ 2.706027] a5 : 0000000000000000 a6 : 0000000000000005 a7 : > > > > > ffffffffffffffff > > > > > [ 2.706474] s2 : ffffffff80b80b08 s3 : 00000000000000c2 s4 : > > > > > ffffffff806c2000 > > > > > [ 2.706891] s5 : ffffffff80edba10 s6 : ffffffff80edb960 s7 : > > > > > 0000000000000001 > > > > > [ 2.707290] s8 : 00000000000000ff s9 : ffffffff80b80b40 s10: > > > > > 00000000000000cc > > > > > [ 2.707689] s11: ffffaf807e1fcf00 t3 : 0000000000000076 t4 : > > > > > ffffffffffffffff > > > > > [ 2.708092] t5 : 00000000000001f2 t6 : ffff8f800021bb48 > > > > > [ 2.708433] status: 0000000000000120 badaddr: 0000000000000000 > > > > > cause: 0000000000000003 > > > > > [ 2.708919] [] free_reserved_area+0x72/0x19a > > > > > [ 2.709296] [] free_initmem+0x6c/0x7c > > > > > [ 2.709648] [] kernel_init+0x3a/0x10a > > > > > [ 2.709993] [] ret_from_exception+0x0/0xc > > > > > [ 2.710310] ---[ end trace 0000000000000000 ]--- > > > > > > > > > > > > > I was able to reproduce this: the first one regarding init_zero_pfn is > > > > legit but not wrong, I have to check when it was introduced and how to > > > > fix this. > > > > Regarding the huge batch that follows, at first sight, I would say > > > > this is linked to my sv48 patchset but that does not seem important as > > > > the address is a kernel mapping address so the use of virt_to_phys is > > > > right. > > > > > > > > > On Wed, Feb 16, 2022 at 5:09 PM Aleksandr Nogikh wrote: > > > > > > > > > > > > On Wed, Feb 16, 2022 at 12:56 PM Dmitry Vyukov wrote: > > > > > > > > > > > > > > On Wed, 16 Feb 2022 at 12:47, Aleksandr Nogikh wrote: > > > > > > > > > > > > > > > > On Wed, Feb 16, 2022 at 11:37 AM Aleksandr Nogikh wrote: > > > > > > > > > > > > > > > > > > Hi Alex, > > > > > > > > > > > > > > > > > > On Wed, Feb 16, 2022 at 5:14 AM Alexandre Ghiti wrote: > > > > > > > > > > > > > > > > > > > > Hi Dmitry, > > > > > > > > > > > > > > > > > > > > On 2/15/22 18:12, Dmitry Vyukov wrote: > > > > > > > > > > > On Wed, 2 Feb 2022 at 14:18, Alexandre Ghiti > > > > > > > > > > > wrote: > > > > > > > > > > >> Hi Aleksandr, > > > > > > > > > > >> > > > > > > > > > > >> On Wed, Feb 2, 2022 at 12:08 PM Aleksandr Nogikh wrote: > > > > > > > > > > >>> Hello, > > > > > > > > > > >>> > > > > > > > > > > >>> syzbot has already not been able to fuzz its RISC-V instance for 97 > > > > > > > > > > >> That's a longtime, I'll take a look more regularly. > > > > > > > > > > >> > > > > > > > > > > >>> days now because the compiled kernel cannot boot. I bisected the issue > > > > > > > > > > >>> to the following commit: > > > > > > > > > > >>> > > > > > > > > > > >>> commit 54c5639d8f507ebefa814f574cb6f763033a72a5 > > > > > > > > > > >>> Author: Alexandre Ghiti > > > > > > > > > > >>> Date: Fri Oct 29 06:59:27 2021 +0200 > > > > > > > > > > >>> > > > > > > > > > > >>> riscv: Fix asan-stack clang build > > > > > > > > > > >>> > > > > > > > > > > >>> Apparently, the problem appears on GCC-built RISC-V kernels with KASAN > > > > > > > > > > >>> enabled. In the previous message syzbot mentions > > > > > > > > > > >>> "riscv64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU > > > > > > > > > > >>> Binutils for Debian) 2.35.2", but the issue also reproduces finely on > > > > > > > > > > >>> a newer GCC compiler: "riscv64-linux-gnu-gcc (Debian 11.2.0-10) > > > > > > > > > > >>> 11.2.0, GNU ld (GNU Binutils for Debian) 2.37". > > > > > > > > > > >>> For convenience, I also duplicate the .config file from the bot's > > > > > > > > > > >>> message: https://syzkaller.appspot.com/x/.config?x=522544a2e0ef2a7d > > > > > > > > > > >>> > > > > > > > > > > >>> Can someone with KASAN and RISC-V expertise please take a look? > > > > > > > > > > >> I'll take a look at that today. > > > > > > > > > > >> > > > > > > > > > > >> Thanks for reporting the issue, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I took a quick look, not enough to fix it but I know the issue comes > > > > > > > > > > from the inline instrumentation, I have no problem with the outline > > > > > > > > > > instrumentation. I need to find some cycles to work on this, my goal is > > > > > > > > > > to fix this for 5.17. > > > > > > > > > > > > > > > > > > Thanks for the update! > > > > > > > > > > > > > > > > > > Can you please share the .config with which you tested the outline > > > > > > > > > instrumentation? > > > > > > > > > I updated the syzbot config to use KASAN_OUTLINE instead of KASAN_INLINE, > > > > > > > > > but it still does not boot :( > > > > > > > > > > > > > > > > > > Here's what I used: > > > > > > > > > https://gist.github.com/a-nogikh/279c85c2d24f47efcc3e865c08844138 > > > > > > > > > > > > > > > > Update: it doesn't boot with that big config, but boots if I generate > > > > > > > > a simple one with KASAN_OUTLINE: > > > > > > > > > > > > > > > > make defconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > > > ./scripts/config -e KASAN -e KASAN_OUTLINE > > > > > > > > make olddefconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > > > > > > > > > > > And it indeed doesn't work if I use KASAN_INLINE. > > > > > > > > > > > > > > It may be an issue with code size. Full syzbot config + KASAN + KCOV > > > > > > > produce hugely massive .text. It may be hitting some limitation in the > > > > > > > bootloader/kernel bootstrap code. > > > > > > > > I took a quick glance and it traps on a KASAN address that is not > > > > mapped, either because it is too soon or because the mapping failed > > > > somehow. > > > > > > > > I'll definitely dive into that tomorrow, sorry for being slow here and > > > > thanks again for all your work, that helps a lot. > > > > > > > > Thanks, > > > > > > > > Alex > > > > > > > > > > > > > > > > I bisected the difference between the config we use on syzbot and the > > > > > > simple one that was generated like I described above. > > > > > > Turns out that it's the DEBUG_VIRTUAL config that makes the difference. > > > > > > > > > > > > make defconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > ./scripts/config -e KASAN -e KASAN_OUTLINE -e DEBUG_VIRTUAL > > > > > > make olddefconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > > > > > > > And the resulting kernel does not boot. > > > > > > My env: the `riscv/fixes` branch, commit > > > > > > 6df2a016c0c8a3d0933ef33dd192ea6606b115e3, qemu 6.2.0. > > > > > > I fixed a few things today: KASAN + SPARSE_VMEMMAP, DEBUG_VIRTUAL and > > > maybe KASAN + KCOV. > > > > > > With those small fixes, I was able to boot your large dotconfig with > > > KASAN_OUTLINE, the inline version still fails, this is my next target > > > :) > > > I'll push that tomorrow! > > > > Awesome, thank you very much! > > Looking forward to finally seeing the instance run :) > > I sent a patchset which should fix your config with *outline* instrumentation. > > However, as you'll see in the cover letter, I have an issue with > another KASAN config and if you can take a look at the stacktrace and > see if that rings a bell, that would be great. > > Don't hesitate next time to ping me when the riscv syzbot instance fails :) > > Alex > Thank you very much for the patch series and for the update! I'll try to take a closer look on Monday. To be honest, I don't really have expertise in KASAN internals, so it's rather unlikely that I could be of much help here :( > > > > > -- > > Best Regards, > > Aleksandr > > > > > > > > Thanks again, > > > > > > Alex > > -- > You received this message because you are subscribed to the Google Groups "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/CA%2BzEjCtB0rTuNAJkrM2q3JQL7D-9fAXBo0Ud0w__gy9CAfo_Ag%40mail.gmail.com. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2C4DC433EF for ; Fri, 18 Feb 2022 20:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aQUI+lx9VaewHymM//nchKCjD2ZyU9gRhLugHYmTiYQ=; b=KxW0vB6jVC11B9 y8m9xBXOtLV8VlF1LZqFs8IS/U2edoGVVz7q3Q+iQO2OTRqc5YYHibYRHdjL0N5/kzhnzfdb+CzcI Mmiq4cUIf9gkm6zH0mHqw+xQAi0/50NMjplT4fzIkYRxUEpuCzqgsoJ4JfYotSNaYTHHASk/xzi6C H+XKp/UP3cG1wW7RfGtDFgwBUXsUd22VoT1osj4qr4o/z+QmpUUZAcDpLZY6I62xr7abTKdTmwH4e fciskm4P4qVMvSWWU1FsjPf6cTgCYTyKP66Sk3WHYOWI0Cbqx85C9w9odkXJNRf4JksEAB32N2KD+ 3yTR+AyovnLb3GeDvRcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nL9wx-00FhAK-7J; Fri, 18 Feb 2022 20:33:55 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nL9wt-00Fh9N-TY for linux-riscv@lists.infradead.org; Fri, 18 Feb 2022 20:33:54 +0000 Received: by mail-il1-x134.google.com with SMTP id 9so4824065ily.11 for ; Fri, 18 Feb 2022 12:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ezvsvchx2nUrNXjulTpQnqP/UL35iteRMo/MbI6yggw=; b=Ckqkc00JrGDi6HmRG7q8ohNa40xUmPGtlIEGIUdRjd7XoKtniFSNtK8AxLSIlyWG2i s5rMFyMDsQrML/vf9ED51fT7QBdErMVL7TRrrJDC5uy0nWG+tkuv6lxiT5LQRqlaunLY xQO1ojYeS2oxyelFVB2HTVoOuAjNYxQxLOQbPGTKDFRLjcTHKnlc0tkRTu20Sb2rV6RC te9LSFj0kBXSZ79xXCJ8bsiDXlmRmWPfXTR+2xcnkfNi7E+Zar2pykR6fdqf37+z/ob1 wFhYb4IIe1pe5dJ9J0h55+JfdTR5pWB7VZXW4Hvvym5Z9E/W1lOhGL1YRY9F76gJL/YA L7jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ezvsvchx2nUrNXjulTpQnqP/UL35iteRMo/MbI6yggw=; b=mSTuKljJ3AfBBY2h7qi8myIxG1Juo517A6aCX5WXErWK7icqGqq76TENxzlEKH20Z3 Xh1HXtBa5puRgphiIzSLX/P4wJD60Biyxy+Chc7xJ3C/8FBeF13HGTNKlCT+wNZv3WaE E9Cz2j5/rQzVSJVPdZOEXoFm1Y+z72UvbqlXkEC1DXY7o+oguaNUQMeRyBHG5sLHN/5F ahWxN+c77yvThLhYQvPNc/autqGggkhHJyMMVd+kaM6Fr/SzRGRcBUJm7akezdmhYd92 mGZiJUWtDyUQkjfZ6JOWbW/YPXXuuFbEWBQNxmKBzWnpihi810bXCtSeUgEEf0v9quFz 69VQ== X-Gm-Message-State: AOAM531/ZqJ/yfkG0N/DX2LuxM0T9+FDabcjoCB9utCDbdTPG+maAwf5 ijI6+z7RiXrj3I+GBuTfMsC4+xHes4vm57ofGRQf9A== X-Google-Smtp-Source: ABdhPJygk7EeWASgvdvSr9hY38K732LIuASEbSD6NpXpWPiwBwk91jovTWJpGC613wrC33QTB7/iXiFtoQsx5B+DmwI= X-Received: by 2002:a05:6e02:b27:b0:2c1:a9cd:e300 with SMTP id e7-20020a056e020b2700b002c1a9cde300mr3069058ilu.44.1645216427582; Fri, 18 Feb 2022 12:33:47 -0800 (PST) MIME-Version: 1.0 References: <00000000000038779505d5d8b372@google.com> In-Reply-To: From: Aleksandr Nogikh Date: Fri, 18 Feb 2022 21:33:36 +0100 Message-ID: Subject: Re: [syzbot] riscv/fixes boot error: can't ssh into the instance To: Alexandre Ghiti Cc: Dmitry Vyukov , Alexandre Ghiti , linux-riscv@lists.infradead.org, kasan-dev , Palmer Dabbelt , syzbot , LKML , syzkaller-bugs@googlegroups.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220218_123352_010374_6C3C24B1 X-CRM114-Status: GOOD ( 61.11 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Alex, On Fri, Feb 18, 2022 at 2:45 PM Alexandre Ghiti wrote: > > Hi Aleksandr, > > On Thu, Feb 17, 2022 at 6:08 PM Aleksandr Nogikh wrote: > > > > Hi Alex, > > > > On Thu, Feb 17, 2022 at 5:53 PM Alexandre Ghiti > > wrote: > > > > > > Aleksandr, > > > > > > On Wed, Feb 16, 2022 at 5:58 PM Alexandre Ghiti > > > wrote: > > > > > > > > First, thank you for working on this. > > > > > > > > On Wed, Feb 16, 2022 at 5:17 PM Aleksandr Nogikh wrote: > > > > > > > > > > If I use just defconfig + DEBUG_VIRTUAL, without any KASAN, it begins > > > > > to boot, but overwhelms me with tons of `virt_to_phys used for > > > > > non-linear address:` errors. > > > > > > > > > > Like that > > > > > > > > > > [ 2.701271] virt_to_phys used for non-linear address: > > > > > 00000000b59e31b6 (0xffffffff806c2000) > > > > > [ 2.701727] WARNING: CPU: 0 PID: 1 at arch/riscv/mm/physaddr.c:16 > > > > > __virt_to_phys+0x7e/0x86 > > > > > [ 2.702207] Modules linked in: > > > > > [ 2.702393] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W > > > > > 5.17.0-rc1 #1 > > > > > [ 2.702806] Hardware name: riscv-virtio,qemu (DT) > > > > > [ 2.703051] epc : __virt_to_phys+0x7e/0x86 > > > > > [ 2.703298] ra : __virt_to_phys+0x7e/0x86 > > > > > [ 2.703547] epc : ffffffff80008448 ra : ffffffff80008448 sp : > > > > > ffff8f800021bde0 > > > > > [ 2.703977] gp : ffffffff80ed9b30 tp : ffffaf8001230000 t0 : > > > > > ffffffff80eea56f > > > > > [ 2.704704] t1 : ffffffff80eea560 t2 : 0000000000000000 s0 : > > > > > ffff8f800021be00 > > > > > [ 2.705153] s1 : ffffffff806c2000 a0 : 000000000000004f a1 : > > > > > ffffffff80e723d8 > > > > > [ 2.705555] a2 : 0000000000000010 a3 : fffffffffffffffe a4 : > > > > > 0000000000000000 > > > > > [ 2.706027] a5 : 0000000000000000 a6 : 0000000000000005 a7 : > > > > > ffffffffffffffff > > > > > [ 2.706474] s2 : ffffffff80b80b08 s3 : 00000000000000c2 s4 : > > > > > ffffffff806c2000 > > > > > [ 2.706891] s5 : ffffffff80edba10 s6 : ffffffff80edb960 s7 : > > > > > 0000000000000001 > > > > > [ 2.707290] s8 : 00000000000000ff s9 : ffffffff80b80b40 s10: > > > > > 00000000000000cc > > > > > [ 2.707689] s11: ffffaf807e1fcf00 t3 : 0000000000000076 t4 : > > > > > ffffffffffffffff > > > > > [ 2.708092] t5 : 00000000000001f2 t6 : ffff8f800021bb48 > > > > > [ 2.708433] status: 0000000000000120 badaddr: 0000000000000000 > > > > > cause: 0000000000000003 > > > > > [ 2.708919] [] free_reserved_area+0x72/0x19a > > > > > [ 2.709296] [] free_initmem+0x6c/0x7c > > > > > [ 2.709648] [] kernel_init+0x3a/0x10a > > > > > [ 2.709993] [] ret_from_exception+0x0/0xc > > > > > [ 2.710310] ---[ end trace 0000000000000000 ]--- > > > > > > > > > > > > > I was able to reproduce this: the first one regarding init_zero_pfn is > > > > legit but not wrong, I have to check when it was introduced and how to > > > > fix this. > > > > Regarding the huge batch that follows, at first sight, I would say > > > > this is linked to my sv48 patchset but that does not seem important as > > > > the address is a kernel mapping address so the use of virt_to_phys is > > > > right. > > > > > > > > > On Wed, Feb 16, 2022 at 5:09 PM Aleksandr Nogikh wrote: > > > > > > > > > > > > On Wed, Feb 16, 2022 at 12:56 PM Dmitry Vyukov wrote: > > > > > > > > > > > > > > On Wed, 16 Feb 2022 at 12:47, Aleksandr Nogikh wrote: > > > > > > > > > > > > > > > > On Wed, Feb 16, 2022 at 11:37 AM Aleksandr Nogikh wrote: > > > > > > > > > > > > > > > > > > Hi Alex, > > > > > > > > > > > > > > > > > > On Wed, Feb 16, 2022 at 5:14 AM Alexandre Ghiti wrote: > > > > > > > > > > > > > > > > > > > > Hi Dmitry, > > > > > > > > > > > > > > > > > > > > On 2/15/22 18:12, Dmitry Vyukov wrote: > > > > > > > > > > > On Wed, 2 Feb 2022 at 14:18, Alexandre Ghiti > > > > > > > > > > > wrote: > > > > > > > > > > >> Hi Aleksandr, > > > > > > > > > > >> > > > > > > > > > > >> On Wed, Feb 2, 2022 at 12:08 PM Aleksandr Nogikh wrote: > > > > > > > > > > >>> Hello, > > > > > > > > > > >>> > > > > > > > > > > >>> syzbot has already not been able to fuzz its RISC-V instance for 97 > > > > > > > > > > >> That's a longtime, I'll take a look more regularly. > > > > > > > > > > >> > > > > > > > > > > >>> days now because the compiled kernel cannot boot. I bisected the issue > > > > > > > > > > >>> to the following commit: > > > > > > > > > > >>> > > > > > > > > > > >>> commit 54c5639d8f507ebefa814f574cb6f763033a72a5 > > > > > > > > > > >>> Author: Alexandre Ghiti > > > > > > > > > > >>> Date: Fri Oct 29 06:59:27 2021 +0200 > > > > > > > > > > >>> > > > > > > > > > > >>> riscv: Fix asan-stack clang build > > > > > > > > > > >>> > > > > > > > > > > >>> Apparently, the problem appears on GCC-built RISC-V kernels with KASAN > > > > > > > > > > >>> enabled. In the previous message syzbot mentions > > > > > > > > > > >>> "riscv64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU > > > > > > > > > > >>> Binutils for Debian) 2.35.2", but the issue also reproduces finely on > > > > > > > > > > >>> a newer GCC compiler: "riscv64-linux-gnu-gcc (Debian 11.2.0-10) > > > > > > > > > > >>> 11.2.0, GNU ld (GNU Binutils for Debian) 2.37". > > > > > > > > > > >>> For convenience, I also duplicate the .config file from the bot's > > > > > > > > > > >>> message: https://syzkaller.appspot.com/x/.config?x=522544a2e0ef2a7d > > > > > > > > > > >>> > > > > > > > > > > >>> Can someone with KASAN and RISC-V expertise please take a look? > > > > > > > > > > >> I'll take a look at that today. > > > > > > > > > > >> > > > > > > > > > > >> Thanks for reporting the issue, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I took a quick look, not enough to fix it but I know the issue comes > > > > > > > > > > from the inline instrumentation, I have no problem with the outline > > > > > > > > > > instrumentation. I need to find some cycles to work on this, my goal is > > > > > > > > > > to fix this for 5.17. > > > > > > > > > > > > > > > > > > Thanks for the update! > > > > > > > > > > > > > > > > > > Can you please share the .config with which you tested the outline > > > > > > > > > instrumentation? > > > > > > > > > I updated the syzbot config to use KASAN_OUTLINE instead of KASAN_INLINE, > > > > > > > > > but it still does not boot :( > > > > > > > > > > > > > > > > > > Here's what I used: > > > > > > > > > https://gist.github.com/a-nogikh/279c85c2d24f47efcc3e865c08844138 > > > > > > > > > > > > > > > > Update: it doesn't boot with that big config, but boots if I generate > > > > > > > > a simple one with KASAN_OUTLINE: > > > > > > > > > > > > > > > > make defconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > > > ./scripts/config -e KASAN -e KASAN_OUTLINE > > > > > > > > make olddefconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > > > > > > > > > > > And it indeed doesn't work if I use KASAN_INLINE. > > > > > > > > > > > > > > It may be an issue with code size. Full syzbot config + KASAN + KCOV > > > > > > > produce hugely massive .text. It may be hitting some limitation in the > > > > > > > bootloader/kernel bootstrap code. > > > > > > > > I took a quick glance and it traps on a KASAN address that is not > > > > mapped, either because it is too soon or because the mapping failed > > > > somehow. > > > > > > > > I'll definitely dive into that tomorrow, sorry for being slow here and > > > > thanks again for all your work, that helps a lot. > > > > > > > > Thanks, > > > > > > > > Alex > > > > > > > > > > > > > > > > I bisected the difference between the config we use on syzbot and the > > > > > > simple one that was generated like I described above. > > > > > > Turns out that it's the DEBUG_VIRTUAL config that makes the difference. > > > > > > > > > > > > make defconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > ./scripts/config -e KASAN -e KASAN_OUTLINE -e DEBUG_VIRTUAL > > > > > > make olddefconfig ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- > > > > > > > > > > > > And the resulting kernel does not boot. > > > > > > My env: the `riscv/fixes` branch, commit > > > > > > 6df2a016c0c8a3d0933ef33dd192ea6606b115e3, qemu 6.2.0. > > > > > > I fixed a few things today: KASAN + SPARSE_VMEMMAP, DEBUG_VIRTUAL and > > > maybe KASAN + KCOV. > > > > > > With those small fixes, I was able to boot your large dotconfig with > > > KASAN_OUTLINE, the inline version still fails, this is my next target > > > :) > > > I'll push that tomorrow! > > > > Awesome, thank you very much! > > Looking forward to finally seeing the instance run :) > > I sent a patchset which should fix your config with *outline* instrumentation. > > However, as you'll see in the cover letter, I have an issue with > another KASAN config and if you can take a look at the stacktrace and > see if that rings a bell, that would be great. > > Don't hesitate next time to ping me when the riscv syzbot instance fails :) > > Alex > Thank you very much for the patch series and for the update! I'll try to take a closer look on Monday. To be honest, I don't really have expertise in KASAN internals, so it's rather unlikely that I could be of much help here :( > > > > > -- > > Best Regards, > > Aleksandr > > > > > > > > Thanks again, > > > > > > Alex > > -- > You received this message because you are subscribed to the Google Groups "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/CA%2BzEjCtB0rTuNAJkrM2q3JQL7D-9fAXBo0Ud0w__gy9CAfo_Ag%40mail.gmail.com. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv