lkml.org 
[lkml]   [2023]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [RFC] signal: Add KUnit tests
On Wed, Aug 16, 2023 at 11:08:21PM -0500, Eric W. Biederman wrote:
> Kees Cook <keescook@chromium.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

\
 
 \ /
  Last update: 2023-08-17 18:58    [W:0.046 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site