All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: 'Dmitry Vyukov' via syzkaller <syzkaller@googlegroups.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	kasan-dev <kasan-dev@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: Tue, 19 Jan 2021 13:00:10 +0000	[thread overview]
Message-ID: <20210119130010.GA2338@C02TD0UTHF1T.local> (raw)
In-Reply-To: <CACT4Y+aPPz-gf2VyZ6cXLeeajLyrWQi66xyr2aA8ZCS1ZruTSg@mail.gmail.com>

On Tue, Jan 19, 2021 at 11:34:33AM +0100, 'Dmitry Vyukov' via syzkaller wrote:
> On Tue, Jan 19, 2021 at 11:04 AM Mark Rutland <mark.rutland@arm.com> wrote:
> > On Mon, Jan 18, 2021 at 05:31:36PM +0100, 'Dmitry Vyukov' via syzkaller wrote:
> > It might be best to use `-machine virt` here instead; that way QEMU
> > won't need to emulate any of the real vexpress HW, and the kernel won't
> > need to waste any time poking it.
> 
> Hi Mark,
> 
> The whole point of setting up an Arm instance is getting as much
> coverage we can't get on x86_64 instances as possible. The instance
> will use qemu emulation (extremely slow) and limited capacity.
> I see some drivers and associated hardware support as one of the main
> such areas. That's why I tried to use vexpress-a15. And it boots
> without KASAN, so presumably it can be used in general.

Fair enough.

I had assumed that your first aim would to cover the arch code shared
across all arm platforms, to flush out any big/common problems first,
for which the virt platform is a good start, and has worked quite well
for arm64.

[...]

> > > 3. CONFIG_KCOV does not seem to fully work.
> > > It seems to work except for when the kernel crashes, and that's the
> > > most interesting scenario for us. When the kernel crashes for other
> > > reasons, crash handlers re-crashe in KCOV making all crashes
> > > unactionable and indistinguishable.
> > > Here are some samples (search for __sanitizer_cov_trace):
> > > https://gist.githubusercontent.com/dvyukov/c8a7ff1c00a5223c5143fd90073f5bc4/raw/c0f4ac7fd7faad7253843584fed8620ac6006338/gistfile1.txt
> >
> > Most of those are all small offsets from 0, which suggests an offset is
> > being added to a NULL pointer somewhere, which I suspect means
> > task_struct::kcov_area is NULL. We could hack-in a check for that, and
> > see if that's the case (though I can't see how from a quick scan of the
> > kcov code).
> 
> My first guess would be is that current itself if NULL.

I think if that were to happen (which'd imply corruption of thread_info)
the fault handling and logging would also blow up, so I suspect this
isn't the case. 

Do you have a reelvant vmlinux to hand? With that we could figure out
which access is faulting, how the address is being generated, and where
the bogus address is coming from, without having to guess. :)

> Accesses to current->kcov* are well tested on other arches, including
> using KCOV in interrupts, etc.

While that's generally true, architectures differ in a number of ways
that can affect this (e.g. how the vmalloc area is faulted, what
precisely is preemptible/interruptible), and we had to make preparatory
changes to make KCOV work on arm even though it was working perfectly
fine on arm64 and x86_64, e.g.

* c9484b986ef03492 ("kcov: ensure irq code sees a valid area")
* dc55daff9040a90a ("kcov: prefault the kcov_area")
* 0ed557aa813922f6 ("sched/core / kcov: avoid kcov_area during task switch")

... so I don't think we can rule out the possibility of a latent issue
here, even if we haven't triggered it elsewhere.

Thanks,
Mark.

_______________________________________________
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-19 13:02 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
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 [this message]

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=20210119130010.GA2338@C02TD0UTHF1T.local \
    --to=mark.rutland@arm.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.