All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Vyukov <dvyukov@google.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Hailong Liu <liu.hailong6@zte.com.cn>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: Arm + KASAN + syzbot
Date: Thu, 21 Jan 2021 14:59:06 +0100	[thread overview]
Message-ID: <CACT4Y+YdJoNTqnBSELcEbcbVsKBtJfYUc7_GSXbUQfAJN3JyRg@mail.gmail.com> (raw)
In-Reply-To: <20210119194827.GL1551@shell.armlinux.org.uk>

On Tue, Jan 19, 2021 at 8:48 PM Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
>
> On Tue, Jan 19, 2021 at 07:57:16PM +0100, Dmitry Vyukov wrote:
> > Using "-kernel arch/arm/boot/zImage -dtb
> > arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dtb" fully works.
>
> Good.
>
> > Using just "-kernel arch/arm/boot/zImage" does not work, not output
> > from qemu whatsoever (expected).
>
> Yep.
>
> > But using just "-kernel arch/arm/boot/zImage.dtb" gives an interesting
> > effect. Kernel starts booting, I see console output up to late init
> > stages, but then it can't find the root device.
> > So appended dtb works... but only in half. Is names of block devices
> > something that's controlled by dtb?
>
> My knowledge about this is limited to qemu being used for KVM.
>
> Firstly, there is are no block devices except for MTD, USB, or CF
> based block devices in the Versatile Express hardware. So, the DTB
> contains no block devices.
>
> In your first case above, it is likely that QEMU modifies the passed
> DTB to add PCIe devices to describe a virtio block device.
>
> In this case, because QEMU has no visibility of the appended DTB, it
> can't modify it, so the kernel only knows about devices found on the
> real hardware. Hence, any of the "special" virtio devices that QEMU
> use likely won't be found.
>
> I'm not sure how QEMU adds those (you're probably in a better position
> than I to boot using your first method, grab a copy of the DTB that
> the booted kernel used from /sys/firmware/fdt, and use dtc to turn it
> back into a dts and see what the changes are.
>
> I suspect you'll find that there's a new PCIe controller been added
> by QEMU, behind which will be a load of virtio devices for things like
> network and the "vda" block device.

Thanks, Russell. This makes perfect sense.

I think allowing qemu to modify dtb on the fly (rather than appending
it to the kernel) may be useful for testing purposes. In future we
will probably want to make qemu emulate as many devices as possible to
increase testing coverage. Passing dtb separately will allow qemu to
emulate all kinds of devices that are not originally on the board.

However, I hit the next problem.
If I build a kernel with KASAN, binaries built from Go sources don't
work. dhcpd/sshd/etc start fine, but any Go binaries just consume 100%
of CPU and do nothing. The process state is R and it manages to create
2 child threads and mmap ~800MB of virtual memory, which I suspect may
be the root cause (though, actual memory consumption is much smaller,
dozen of MB or so). The binary cannot be killed with kill -9. I tried
to give VM 2GB and 8GB, so it should have plenty of RAM. These
binaries run fine on non-KASAN kernel...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-01-21 14:01 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 16:31 Arm + KASAN + syzbot Dmitry Vyukov
2021-01-19  8:36 ` Krzysztof Kozlowski
2021-01-19  8:46   ` Linus Walleij
2021-01-19 10:04   ` Dmitry Vyukov
2021-01-19 10:17     ` Linus Walleij
2021-01-19 10:23       ` Dmitry Vyukov
2021-01-19 10:28         ` Linus Walleij
2021-01-19 10:53           ` Dmitry Vyukov
2021-01-19 11:05             ` Dmitry Vyukov
2021-01-19 11:13               ` Russell King - ARM Linux admin
2021-01-19 11:17                 ` Dmitry Vyukov
2021-01-19 11:43                   ` Russell King - ARM Linux admin
2021-01-19 12:05                     ` Dmitry Vyukov
2021-01-19 12:36                       ` Russell King - ARM Linux admin
2021-01-19 18:57                         ` Dmitry Vyukov
2021-01-19 19:48                           ` Russell King - ARM Linux admin
2021-01-21 13:14                             ` Russell King - ARM Linux admin
2021-01-21 13:49                               ` Dmitry Vyukov
2021-01-21 14:04                                 ` Arnd Bergmann
2021-01-21 13:59                             ` Dmitry Vyukov [this message]
2021-01-21 14:52                               ` Linus Walleij
2021-01-26 21:24                                 ` Dmitry Vyukov
2021-01-27  8:24                                   ` Linus Walleij
2021-01-27  9:39                                     ` Dmitry Vyukov
2021-01-27  9:57                                       ` Linus Walleij
2021-01-27 10:12                                         ` Dmitry Vyukov
2021-01-27 10:19                                     ` Russell King - ARM Linux admin
2021-03-11 10:54                                       ` Dmitry Vyukov
2021-03-11 13:42                                         ` Russell King - ARM Linux admin
2021-03-11 18:05                                           ` Dmitry Vyukov
2021-03-11 13:55                                         ` Linus Walleij
2021-03-11 14:09                                           ` Russell King - ARM Linux admin
2021-03-11 14:37                                             ` Linus Walleij
2021-03-11 14:55                                             ` Arnd Bergmann
2021-03-11 18:08                                               ` Dmitry Vyukov
2021-03-15 14:01                                               ` Linus Walleij
2021-03-15 19:03                                                 ` Russell King - ARM Linux admin
2021-01-19 13:22                       ` Linus Walleij
2021-01-19  8:41 ` Linus Walleij
2021-01-19  8:43   ` Linus Walleij
2021-01-19 10:18   ` Dmitry Vyukov
2021-01-19 10:27     ` Linus Walleij
2021-01-19 10:36       ` Dmitry Vyukov
2021-01-19 10:03 ` Mark Rutland
2021-01-19 10:34   ` Dmitry Vyukov
2021-01-19 10:55     ` Russell King - ARM Linux admin
2021-01-19 13:00     ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACT4Y+YdJoNTqnBSELcEbcbVsKBtJfYUc7_GSXbUQfAJN3JyRg@mail.gmail.com \
    --to=dvyukov@google.com \
    --cc=arnd@arndb.de \
    --cc=kasan-dev@googlegroups.com \
    --cc=krzk@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=liu.hailong6@zte.com.cn \
    --cc=syzkaller@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.