lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lib: stackinit: Convert to KUnit
On Thu, Feb 24, 2022 at 11:43:40AM -0800, Daniel Latypov wrote:
> On Wed, Feb 23, 2022 at 9:51 PM Kees Cook <keescook@chromium.org> wrote:
> >
>
> <snip>
>
>
> > /* Userspace headers. */
> > +#define _GNU_SOURCE
> > #include <stdio.h>
> > #include <stdint.h>
> > +#include <stdlib.h>
> > #include <string.h>
> > #include <stdbool.h>
> > #include <errno.h>
> > #include <sys/types.h>
> >
> > /* Linux kernel-ism stubs for stand-alone userspace build. */
>
> This is neat and esp. so that it works.
> But may I ask, what's the value of using this vs UML?

Mainly it's been for giving a single stand-alone file for testing to
compiler devs, packagers, and distro maintainers instead of asking them
to pull down the entire kernel, etc, etc. :)

> Given this has changed into mainly just a KUnit-compatibility layer,
> it feels like it can maybe live as a standalone file, if there's ever
> interest in doing this for other tests.

That's a terrifying and lovely idea!

> It feels like something that will never quite be "supported", but I
> find it neat enough I'd have fun sending some patches to make it more
> realistic.

Right, and as you found, I took some short-cuts that were specific to
how this code used KUnit. :P

I'll ponder this and go through your other suggestions. Thanks!

-Kees

--
Kees Cook

\
 
 \ /
  Last update: 2022-02-25 02:17    [W:0.062 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site