Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1015066pxb; Wed, 16 Feb 2022 09:05:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoBy7vB1c83FHQjyzlUS0K4A6KOjCmI2cx6dE1kQU0J8M+7VYdWFWMe5OTHlWF2vpxK76l X-Received: by 2002:a50:ee14:0:b0:410:7a88:4b0c with SMTP id g20-20020a50ee14000000b004107a884b0cmr4038257eds.37.1645031138715; Wed, 16 Feb 2022 09:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645031138; cv=none; d=google.com; s=arc-20160816; b=xftJpL9PJ3X++Mu/ulBkqzppA0S/genZjPpljj0lqF/urOOlIqxKwfw8u66bkUcwS6 hyC1OYewrf4wQdKR4Z3Jo91UDrJWGK5aQ+h/OdHkZjDgbNwDcIX3BSqWMO+6PxT5YN6V okERVOuGAcxCk+9NSTCciF0I02GCSQ0WSNQT/q9cAihxpimwfr7vwfeYqJKhesx7tBHh 7LReUTovbP6uV61WN25vaq/yd06085G8ZiyWXoEI7PYweOb1QRF1ZhCc7IC/BB1ebHvb AbTtmQZ9Xa0T0qFOizbjFiUEXjgpB738Ez/aS4nf5EEsZb9bqGi3IebCfCs3UOh7y6dY YSmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=X1DbyhBVBvnUPYaFyX9FKtS0pYUg5/jmB2DYqrFTT5U=; b=SLxASgWnjxV5Zk0Epi1EXhyGyYSpC75E7DiSI61Tmi51+zBpa4YoGJKTPbS/9RH5rV otpmYc3SNlDdEGd06tcnkw5WeyfdT8G9Z8QEsPYXBfLNFxaL9FaUsmWGadNivbGIRaNH 84+lM6SHGgWdRMYJ1mhQOagyldqnx1cCfcuuBbsIEiQ9dyFbwLpl1tpJyQz1YNvd2oiG 23ec/ddi3fed5t6QTlcxbP9IioacOXhg99RikIg6bHOPeDhjiMEKWKdHrZsL0Q5dcmaQ ra9CmMhAZrdBXEQqsj/k1DqCDfHw9XRYSGWyRwo1sOD2juKd/m+qIeZU0SiPC3wCXxqu k78A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=J+IlJwKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga31si220543ejc.811.2022.02.16.09.05.07; Wed, 16 Feb 2022 09:05:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=J+IlJwKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236023AbiBPQJ3 (ORCPT + 99 others); Wed, 16 Feb 2022 11:09:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236013AbiBPQJ3 (ORCPT ); Wed, 16 Feb 2022 11:09:29 -0500 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1D3BD2CD for ; Wed, 16 Feb 2022 08:09:15 -0800 (PST) Received: by mail-il1-x134.google.com with SMTP id n5so110239ilk.12 for ; Wed, 16 Feb 2022 08:09:15 -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=X1DbyhBVBvnUPYaFyX9FKtS0pYUg5/jmB2DYqrFTT5U=; b=J+IlJwKwqNmOWrnf9XmZjoqXa0NqIoyKOJfIcTZrmFWEeZLQaOlywhGandqivrs4pJ B89cnA5e/+9qJQzIowUnlXGsCr65LTNHTGRRyzH5tTmj1I2LpsNBTLDSMItBBmKJuPVZ f4twJbUofcE5FHVhwVxSjSLIeQ71xPPXnfWFL1Tv0cdLNLR5Ou5czua9VLjsjBWmcJUr XCGwJtkNEmHkcsMwl0WkstoebpSHASn+bBGPtRt7JDqF46ZWwteM9qav+cGSv74qfNvJ e+5a+XgdW2fSFzlxfQ2ruUrOLVuaB/neINyCjXDMLwnj41WMvQXFGlS19PYvPvu6hqBL buXQ== 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=X1DbyhBVBvnUPYaFyX9FKtS0pYUg5/jmB2DYqrFTT5U=; b=kBD7UXYPtc5Ljdmn8t2lFErT+deCzPUzJIoVQNja6l2uRkPBrj0+9jR70fdeh4lvTo xTy0Zzz+6GKrEKzRsgPO+Og3g/fmzONiW5jaOGhabCcXm+4GONiqdsbs9BIQW6pzT1gV +8FcQ2rZWfsqgGgQ12zFcujwCa4VMRYFg5McBg8iplTnUOlgIwP81P0OWQrPTe+8REHg tfOXaqV+YYClUQ885zGXU3tAocK6ocUdrikMSEcAFiRqltrJbO6aelttp2ozfq8wjSlO i1g0uez9ASNtJq2xE+aGAbSayRqrqUFEo+SWVF1kKepowgysWIXHINfThwh9uGIu8m7P JhHQ== X-Gm-Message-State: AOAM5305v1SKhlhp5DSW9X90Vh8D8AxO4yebKxqs35/+1NpTUnNQYCgx CT5V+4woqn+scTV83HTERC4vc5Yj8W4AIewQ7Jc/e5iqBKMhXxpj X-Received: by 2002:a05:6e02:1a26:b0:2bc:2e01:ae73 with SMTP id g6-20020a056e021a2600b002bc2e01ae73mr2263040ile.44.1645027754573; Wed, 16 Feb 2022 08:09:14 -0800 (PST) MIME-Version: 1.0 References: <00000000000038779505d5d8b372@google.com> In-Reply-To: From: Aleksandr Nogikh Date: Wed, 16 Feb 2022 17:09:03 +0100 Message-ID: Subject: Re: [syzbot] riscv/fixes boot error: can't ssh into the instance To: Dmitry Vyukov Cc: Alexandre Ghiti , Alexandre Ghiti , linux-riscv@lists.infradead.org, kasan-dev , Palmer Dabbelt , syzbot , LKML , syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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.