[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202308170956.B7CA2B8BDB@keescook>
Date: Thu, 17 Aug 2023 09:57:12 -0700
From: Kees Cook <keescook@...omium.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Brendan Higgins <brendan.higgins@...ux.dev>,
David Gow <davidgow@...gle.com>,
Petr Skocik <pskocik@...il.com>,
Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jens Axboe <axboe@...nel.dk>, linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com,
Frederic Weisbecker <frederic@...nel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Mike Christie <michael.christie@...cle.com>,
Marco Elver <elver@...gle.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>,
"haifeng.xu" <haifeng.xu@...pee.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] [RFC] signal: Add KUnit tests
On Wed, Aug 16, 2023 at 11:08:21PM -0500, Eric W. Biederman wrote:
> Kees Cook <keescook@...omium.org> writes:
>
> > This is a continuation of the proposal[1] for mocking init_task for
> > KUnit testing. Changing the behavior of kill_something_info() is moving
> > forward[2] and I'd _really_ like to have some unit tests in place to
> > actually test the behavioral changes.
> >
> > I tried to incorporate feedback from Daniel and David, and I think the
> > result is fairly workable -- the only tricky part is building valid
> > task_struct instances. :)
> >
> > Notably, I haven't actually gotten as far as testing the actual proposed
> > behavioral change since I wanted to make sure this approach wasn't going
> > to totally crash and burn.
> >
> > Thoughts?
>
> Overall this looks like a nice start. More comments below.
>
> I do wonder though. Would it perhaps be easier to create a pid
> namespace with just the processes you want in it?
Do you have a short example of how I could do this correctly? It's not
obvious to me how to actually set all that up (and tear it down).
> I am wondering because you failed to mock find_vpid and so you
> are actually testing sending signals to kernel threads.
Hah. Eek.
--
Kees Cook
Powered by blists - more mailing lists