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=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 8408BC433E0 for ; Tue, 19 Jan 2021 10:06:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 119B322241 for ; Tue, 19 Jan 2021 10:06:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 119B322241 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=1T38V3cMiO9KuenG9DSRntQIT0bPahopedf9b0Vn5oA=; b=m8FGTAAIB8g5bJnsgWaZQONE5 IwczO7ML9ZXWkZNZr5pUaVvigi1U2dQ/gp5AX1wOR0EwkAgYdfkFHvwWgSEoNlKC+sV2FO4D1tB8J 814BXqMqErY4mxEUHi0Y+GMQ/6WWMefxDCKgf2GKVIW6iGy7hxVTSfalTl+jj7xmHfjosAzTsYxOB 3nvgoPFwmwSPkthCCc8puDbYv0OUgmLXkx4NYN4B4DGy11HDrYHdy4ck15D/ZnvOSf+3IayPLWkGB 0eAHtBhJLh+0SphgNmKMZ9HAaaWduconjgnvxBJUeShhdoaJg7cgx4J/BQiwP7HEVWHS0uoppV9i/ ph+miP+WQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1nsN-0002YT-7f; Tue, 19 Jan 2021 10:04:39 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1nsI-0002Xd-8u for linux-arm-kernel@lists.infradead.org; Tue, 19 Jan 2021 10:04:37 +0000 Received: by mail-qt1-x836.google.com with SMTP id v5so13244785qtv.7 for ; Tue, 19 Jan 2021 02:04:33 -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=njmUJy6w/va45NJBs7QBuv4pecmiAEDbCKlqcpoRuMo=; b=Xnak2wD8nXNmrurEfTbjEc/nCZH9/+Bz3XEwea7aQvPXXbwmX73njCMrvAEZYHq9gs 4HCB7u5YufksqJrPJFoOb0C7G2jShE6T8r73ehlSEEeRK0g5g9sBb1F/1BVYO7AC72V+ dNJln66zct2BLEQAmbQhNG1nVi9STsKuCQ96mWS0j0RMAlQlC8phIO+Kp8naxXVyeJFJ msgnQQWriez73V5CxVnzh3Teq5+/gZsCNYHm1IAXlmYwhvpNeihuHdd1sWpHR0m5L8Pg NpLeUvVsads427CMFp3mlN4+J24IdWsTi1o7iFVuWmNFHJ7Pt8P3l7hUqVC7m8LNtmiA CoDw== 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=njmUJy6w/va45NJBs7QBuv4pecmiAEDbCKlqcpoRuMo=; b=ThtP45UrCM4J+CrWdnEeGLmTGgKcf0DVv3ctdM+Wt76XnxZqyNTmZw5cdBLzoIWsbu EP3JNF8UhtA4l5lk0/qaybo8WThLGeiXrcKjOkZOVQUGS1ULZYg8RUK8JxaBacQp2zuL tHDy2iZM4DfL3y/5yVFvBJ59RX+X0/BKr601ADBk6UxZ6ru5JNRTUlMCIyk821W8qHLd c6uDVRQpxPu/9CJqf8Lgj6KkthxQEOt0lEL7nzl0iZQjEz+lNhdXtWGCRhFDz57ez9wM GCB/j2fF6Jm+vBdlYF2A4xdBi7oicrZ4RhGmgxIlhviNEWgGFxrfPWgdlPTtJGM4NsPb bKyQ== X-Gm-Message-State: AOAM532v2be9GPFsuELn6FJOojREOAHLJ4q/82qTAVqj8Zi9HM5RUYp1 ifcFmMIj0vDjWxjSwEpYUi35eKZVoLmpFRZ8tNPDMg== X-Google-Smtp-Source: ABdhPJx2u/pXK7doLjzU5tLszLRXqF1qU5yXlwV5AMROvp6x4YzmyQlz4ENqjS7DXAG5jzk0jTcMrYUqcSSo/0NaLTM= X-Received: by 2002:a05:622a:c9:: with SMTP id p9mr1703100qtw.337.1611050671877; Tue, 19 Jan 2021 02:04:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dmitry Vyukov Date: Tue, 19 Jan 2021 11:04:20 +0100 Message-ID: Subject: Re: Arm + KASAN + syzbot To: Krzysztof Kozlowski X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210119_050434_350783_48CB30F8 X-CRM114-Status: GOOD ( 38.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Linus Walleij , Russell King - ARM Linux , kasan-dev , syzkaller , liu.hailong6@zte.com.cn, Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jan 19, 2021 at 9:37 AM Krzysztof Kozlowski wrote: > > On Mon, 18 Jan 2021 at 17:31, Dmitry Vyukov wrote: > > > > Hello Arm maintainers, > > > > We are considering setting up an Arm 32-bit instance on syzbot for > > continuous testing using qemu emulation and I have several questions > > related to that. > > > > 1. Is there interest in this on your end? > > Sure, the more, the better. > > > What git tree/branch should > > be used for testing (contains latest development and is regularly > > updated with fixes)? > > Depends on your testing capabilities, whether you can deal with every > sub-maintainer's tree. 0-day kernel robot tests everything possible > and this allows each submaintanier to early receive feedback about his > tree. It can be around 30 Git trees, though... If you want only few, I > would start with: > - https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/ > - linux-next > - and Russell's for-next > (http://git.armlinux.org.uk/cgit/linux-arm.git/log/?h=for-next) Hi Krzysztof, We need to start with just 1 tree. What syzbot is doing is slightly different from 0-day. 0-day is unit testing, while syzbot is fuzzing. One caveat is that majority of bugs won't be arm-specific, hundreds of bugs will be just generic kernel bugs, so the tested tree needs to be regularly updated to pick up fixes for all these generic bugs. Otherwise the instance will be just re-hitting these known and already fixed bugs all the time without having time to discover any new arm-specific bugs. I see that for-next branch of git://git.armlinux.org.uk/~rmk/linux-arm.git is last updated on Dec 21, so it does not even include v5.11-rc11 created on Dec 27, and we are now on rc4. We could use linux-next, but sometimes it's broken or pulls in bugs that cause crashes all the time. So it's not ideal as well. Maybe we should just use the upstream tree? > > 2. I see KASAN has just become supported for Arm, which is very > > useful, but I can't boot a kernel with KASAN enabled. I am using > > v5.11-rc4 and this config without KASAN boots fine: > > https://gist.githubusercontent.com/dvyukov/12de2905f9479ba2ebdcc603c2fec79b/raw/c8fd3f5e8328259fe760ce9a57f3e6c6f5a95c8f/gistfile1.txt > > Maybe try first with a kernel based on vexpress defconfig. Yours looks > closer to multi_v7 which enables a lot of stuff also as modules and > this by itself brought up few issues (mostly with order of probes). The first config I provided above works fine, so there is no need to reduce it. The problem is with KASAN. syzbot also needs a number of debugging configs, a number of configs that allow to run in qemu, sandboxing/isolation configs, etc. Plus it enables configs for tested subsystems. All syzbot configs: https://github.com/google/syzkaller/tree/master/dashboard/config/linux are produced from the same fragments: https://github.com/google/syzkaller/tree/master/dashboard/config/linux/bits That's the plan for Arm as well, we don't want to do 100% custom things for each new tree/configuration. That's not scalable/maintainable. > You could also try other QEMU machine (I don't know many of them, some > time ago I was using exynos defconfig on smdkc210, but without KASAN). vexpress-a15 seems to be the most widely used and more maintained. It works without KASAN. Is there a reason to switch to something else? > > using the following qemu command line: > > qemu-system-arm \ > > -machine vexpress-a15 -cpu max -smp 2 -m 2G \ > > -device virtio-blk-device,drive=hd0 \ > > -drive if=none,format=raw,id=hd0,file=image-arm -snapshot \ > > -kernel arch/arm/boot/zImage \ > > -dtb arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dtb \ > > -nographic \ > > -netdev user,host=10.0.2.10,hostfwd=tcp::10022-:22,id=net0 -device > > virtio-net-device,netdev=net0 \ > > -append "root=/dev/vda earlycon earlyprintk=serial console=ttyAMA0 > > oops=panic panic_on_warn=1 panic=86400 vmalloc=512M" > > > > However, when I enable KASAN and get this config: > > https://gist.githubusercontent.com/dvyukov/a7e3edd35cc39a1b69b11530c7d2e7ac/raw/7cbda88085d3ccd11227224a1c9964ccb8484d4e/gistfile1.txt > > > > kernel does not boot, qemu only prints the following output and then silence: > > pulseaudio: set_sink_input_volume() failed > > pulseaudio: Reason: Invalid argument > > pulseaudio: set_sink_input_mute() failed > > pulseaudio: Reason: Invalid argument > > > > What am I doing wrong? > > No clue but I just tried KASAN on my ARMv7 Exynos5422 board (real > hardware) and it works (although kernel log appeared with a bigger > delay): > > [ 0.000000] Booting Linux on physical CPU 0x100 > [ 0.000000] Linux version > 5.11.0-rc3-next-20210115-00001-g77140600eeec (kozik@kozik-lap) > (arm-linux-gnueabi-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld > (GNU Binutils for Ubuntu) 2.34) #144 SMP PREEMPT Tue Jan 19 09:23:24 > CET 2021 > [ 0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d > ... > [ 0.000000] kasan: Truncating shadow for memory block at > 0x40000000-0xbea00000 to lowmem region at 0x70000000 > [ 0.000000] kasan: Mapping kernel virtual memory block: > c0000000-f0000000 at shadow: b7000000-bd000000 > [ 0.000000] kasan: Mapping kernel virtual memory block: > bf000000-c0000000 at shadow: b6e00000-b7000000 > [ 0.000000] kasan: Kernel address sanitizer initialized > > Best regards, > Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel