linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@google.com>
To: Dmitry Vyukov <dvyukov@google.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: syzkaller <syzkaller@googlegroups.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Petr Mladek <pmladek@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ondrej Mosnacek <omosnace@redhat.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v2] twist: allow converting pr_devel()/pr_debug() into snprintf()
Date: Mon, 8 Jun 2020 13:31:13 +0200	[thread overview]
Message-ID: <CAAeHK+x+rcxLdN+xw-QGi8-3T+89X+WHpZUUsOco3u58t=Z15A@mail.gmail.com> (raw)
In-Reply-To: <CACT4Y+Z58Z8u1g8SBy-i1WxLMrdmXvggsLFAhfbLc8D=uffPyA@mail.gmail.com>

On Mon, Jun 8, 2020 at 9:48 AM 'Dmitry Vyukov' via syzkaller
<syzkaller@googlegroups.com> wrote:
>
> On Fri, May 29, 2020 at 3:27 PM Tetsuo Handa
> <penguin-kernel@i-love.sakura.ne.jp> wrote:
> >
> > Hello, Dmitry.
> >
> > Linus is asking me to avoid build-time switching based on kernel config options,
> > and is suggesting me to use boot-time switching based on boot-config file feature
> > (which is available since 5.6). I have several concerns about use of boot-config file
> > feature in syzkaller.
> >
> > (1) To use boot-config file, syzkaller will need to add "bootconfig" option
> >     to the kernel command line. This will be doable by patching
> >     https://github.com/google/syzkaller/tree/master/dashboard/config/ *.cmdline
> >     files.
>
> Hello Tetsuo,
>
> Yes, command line arguments are easily changeable. Please send pull
> requests to syzkaller, if you want to change something.
>
>
> > (2) The boot-config file is embedded into initramfs file. Since syzkaller builds
> >     kernels with almost-allyesconfig, booting syzkaller kernels do not require
> >     initramfs for loading kernel modules needed for mounting the root partition.
> >     In fact, according to "unexpected kernel reboot" report which contains boot messages,
> >     I can't find "Unpacking initramfs..." message. It seems that syzkaller kernels do not
> >     use initramfs file.
> >
> >     Is it possible for syzkaller to enforce performing steps for creating an initramfs,
> >     embedding the boot-config file
> >     ( https://www.kernel.org/doc/html/latest/admin-guide/bootconfig.html#boot-kernel-with-a-boot-config),
> >     and loading that initramfs whenever booting the syzkaller kernels?
> >     By the way, I do worry that people forget to perform these steps when they do
> >     their tests without asking syzbot...
>
> I think we have some confusion between syzkaller and syzbot here.
> syzkaller itself does not enforce/require any kernel configuration,
> hardware nor use or not use of initramfs. In fact, qemu VM type
> supports initramfs today. Or syzkaller can work with bare machines
> where all setup is up to the user.
> syzbot is just one deployment of syzkaller with a particular
> configuration/hardware.
>
> If this feature is useful for any linux kernel fuzzing, then we need
> to have a plan for all users and setups.
>
> And, yes, an additional context is kernel developers reproducing bugs.
> Not all of them may be happy about any additional steps, nor will
> follow them.
>
> Answering your question, syzkaller can do some sanity checking of the
> provided machine/kernel and reject working with it. If you tell me
> what exactly needs to be checked, I can think where this code should
> go.
> However, again, I am not sure if one is using, say, Android phones and
> they don't envision use of initramfs, then what?
>
> For syzbot, the build happens here:
> https://github.com/google/syzkaller/blob/7751efd04aebb07bc82b5c0e8eeaca07be1ae112/pkg/build/linux.go#L72
> I don't know if initramfs is supported with GCE machines and what
> exactly is required.
>
>
> > (3) Since syzkaller keeps track of "kernel tree", "commit of the kernel tree", and
> >     "commit of the syzkaller tree" in order to guarantee reproducibility, it would be
> >     possible to identify the "your-config" file used for tools/bootconfig/bootconfig
> >     command. But since "#syz test" command currently accepts only "kernel tree" and
> >     "commit of the kernel tree" arguments, we might fail to use intended "your-config"
> >     file when doing reproducibility test. Can syzbot solve this concern?
>
> Most likely it's possible.

FTR, there's https://github.com/google/syzkaller/issues/1611 filed for this.

>
> > (4) Of course, "your-config" file would not change so frequently, but "#syz test" command
> >     relies on external file in "syzkaller tree" makes it impossible to try different
> >     configuration when I have to ask syzbot to test. (Since I don't have hardware which
> >     syzbot is reporting problems, I have to ask syzbot when I can't reproduce the problem
> >     in my environment.)
> >
> >     https://syzkaller.appspot.com/text?tag=Patch&x=135f254a100000 is an example of
> >     need to enforce CONFIG_DEBUG_INFO_BTF=n in order to workaround build failure during
> >     "#syz test" command. If we bring "which twist options should be enabled" to an external
> >     boot-config file, I can't ask syzbot to try different twist options (except directly
> >     patching the kernel source which handles "which twist options should be enabled").
> >     Can syzbot solve this concern?
>
> The CONFIG_DEBUG_INFO_BTF relates to build config. This can't be
> solved during boot, right? So what is the relation?
>
> > (5) Anything else?
>
> Reading:
> https://www.kernel.org/doc/html/latest/admin-guide/bootconfig.html#boot-kernel-with-a-boot-config
> It seems that boot config is just a more complex way to provide
> command line arguments. syzbot already supports command line
> arguments, and it looks much simpler and no additional work required.
> Why do we want to use boot config?
>
> Next quarter we will be additionally busy with interns, so I can't
> promise any time availability for syzbot improvements. But pull
> requests are welcome.
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/CACT4Y%2BZ58Z8u1g8SBy-i1WxLMrdmXvggsLFAhfbLc8D%3DuffPyA%40mail.gmail.com.

  parent reply	other threads:[~2020-06-08 11:31 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 14:50 [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG) Tetsuo Handa
2020-05-24 17:38 ` Joe Perches
2020-05-24 19:18   ` Ondrej Mosnacek
2020-05-25  5:03     ` Tetsuo Handa
2020-05-25  6:07       ` Joe Perches
2020-05-25  7:38         ` Dmitry Vyukov
2020-05-25  8:42 ` Petr Mladek
2020-05-25  9:11   ` Sergey Senozhatsky
2020-05-25 10:43     ` Tetsuo Handa
2020-05-27  8:37       ` Petr Mladek
2020-05-27 10:13         ` Tetsuo Handa
2020-05-27 15:55           ` Petr Mladek
2020-05-27 23:33             ` Tetsuo Handa
2020-05-28  6:56               ` [PATCH v2] twist: allow converting pr_devel()/pr_debug() into snprintf() Tetsuo Handa
2020-05-28 11:06                 ` Petr Mladek
2020-05-28 15:16                   ` Tetsuo Handa
2020-05-28 19:10                     ` Andrew Morton
2020-05-28 19:50                     ` Linus Torvalds
2020-05-28 20:01                       ` Linus Torvalds
2020-05-29  0:07                         ` Tetsuo Handa
2020-05-29  0:28                           ` Linus Torvalds
2020-05-29  2:13                             ` Tetsuo Handa
2020-05-29  2:24                               ` Linus Torvalds
2020-05-29  4:47                                 ` Tetsuo Handa
2020-05-29 13:26                                   ` Tetsuo Handa
2020-06-03 11:03                                     ` twist: allow disabling reboot request Tetsuo Handa
2020-06-03 12:44                                       ` Petr Mladek
2020-06-03 13:35                                         ` Tetsuo Handa
2020-06-04 10:21                                           ` Petr Mladek
2020-06-08  7:48                                     ` [PATCH v2] twist: allow converting pr_devel()/pr_debug() into snprintf() Dmitry Vyukov
2020-06-08 10:30                                       ` Tetsuo Handa
2020-06-08 11:31                                       ` Andrey Konovalov [this message]
2020-05-29  8:17                       ` Petr Mladek
2020-06-08 16:39                 ` Geert Uytterhoeven
2020-05-28 10:59               ` [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG) Petr Mladek
2020-05-28 11:33                 ` Tetsuo Handa
2020-05-28 12:14                   ` Petr Mladek
2020-05-28 14:13                     ` Tetsuo Handa
2020-05-28 17:08                     ` Joe Perches
2020-05-29  2:04       ` Sergey Senozhatsky
2020-05-29  5:06         ` Tetsuo Handa
2020-05-27  9:59 ` kbuild test robot
2020-05-27 13:41   ` Tetsuo Handa
2020-05-27 12:37 ` kbuild test robot

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='CAAeHK+x+rcxLdN+xw-QGi8-3T+89X+WHpZUUsOco3u58t=Z15A@mail.gmail.com' \
    --to=andreyknvl@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omosnace@redhat.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=syzkaller@googlegroups.com \
    --cc=torvalds@linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).