From: Cyril Hrubis <chrubis@suse.cz>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Richard Palethorpe <richard.palethorpe@suse.com>,
syzkaller <syzkaller@googlegroups.com>,
kernelci@groups.io, shuah <shuah@kernel.org>,
ltp@lists.linux.it, George Kennedy <george.kennedy@oracle.com>,
Cyril Hrubis <chrubis@suse.com>,
"open list : KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>,
automated-testing@yoctoproject.org
Subject: Re: [RFC PATCH] LTP Wrapper for Syzkaller reproducers
Date: Thu, 10 Oct 2019 15:22:49 +0200 [thread overview]
Message-ID: <20191010132249.GB9416@rei.lan> (raw)
In-Reply-To: <CACT4Y+ZARc3gK9rweQnLr26Aa_8j9OrpAs-wfTVP2owqmXm+kQ@mail.gmail.com>
Hi!
> > > > > > Indeed, it's removed recursively by the test library.
> > > > >
> > > > > :popcorn:
> > > > >
> > > > > It took me several years to figure out how to more or less reliably
> > > > > remove dirs after the fuzzer ;)
> > > > > (no, unlink won't do ;))
> > > >
> > > > I guess that there are things such as immutable file attributes that has
> > > > to be cleared and many more. Do you have piece of code somewhere that we
> > > > can look into to spare us from reinventing the wheel?
> > >
> > > Here is what we have:
> > > https://github.com/google/syzkaller/blob/c4b9981b5f5b70dc03eb3f76c618398510101a1d/executor/common_linux.h#L2358-L2461
> > > Maybe it can be simplified, but that's what we ended up with after
> > > some organic evolution. At least the comments may give some hints as
> > > to what may go wrong.
> >
> > Thanks a lot!
> >
> > Also I see that you are using namespaces, and much more, to sandbox the
> > fuzzer, I was wondering if we should do that, at least separate user and
> > pid namespace sounds like a good idea to me.
>
> I don't know how far you want to go. This sandboxing definitely helps
> us to isolate processes and make tests more repeatable by avoiding
> interference (I don't know if LTP, say, runs tests in parallel).
Not yet, but we are slowly getting to a point where LTP tests could be
run in parallel. It's a bit more complicated for functional tests, since
there are number of constraints, for which tests should not be run in
parallel. And for number of these sandboxing wouldn't help either, since
it's more of a matter of available resources than isolation.
I'm close to solving first half of the problem, i.e. propagating the
test constraints from tests to the testrunner. I also wrote a blog post
about this, you can read it at:
https://people.kernel.org/metan/towards-parallel-kernel-test-runs
But even without running tests in parallel there are resources that have
kernel persistence and will outlive the process, such as SysV IPC. So I
guess that at least some sandboxing has to be done even for non-parallel
runs.
> mount namespaces are useful to later drop all of test mounts at once,
> this would solve a significant part of the remote_dir logic. If the
> temp dir is on tmpfs in the mount namespace as well, then it will be
> automatically dropped altogether with all contents.
Again, thanks for the hint!
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2019-10-10 13:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 14:24 [RFC PATCH] LTP Wrapper for Syzkaller reproducers Richard Palethorpe
2019-10-09 14:40 ` Dmitry Vyukov
2019-10-09 14:54 ` Cyril Hrubis
2019-10-09 17:20 ` Dmitry Vyukov
2019-10-09 18:04 ` Cyril Hrubis
2019-10-09 18:21 ` Dmitry Vyukov
2019-10-10 9:30 ` Cyril Hrubis
2019-10-10 9:50 ` Dmitry Vyukov
2019-10-10 13:22 ` Cyril Hrubis [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=20191010132249.GB9416@rei.lan \
--to=chrubis@suse.cz \
--cc=automated-testing@yoctoproject.org \
--cc=chrubis@suse.com \
--cc=dvyukov@google.com \
--cc=george.kennedy@oracle.com \
--cc=kernelci@groups.io \
--cc=linux-kselftest@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=richard.palethorpe@suse.com \
--cc=shuah@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox