From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0337310EF for ; Fri, 25 Feb 2022 01:17:04 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id em10-20020a17090b014a00b001bc3071f921so7132594pjb.5 for ; Thu, 24 Feb 2022 17:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=N4Y8/f5h2c+8qmPFONzyrb+xWyQQ0xn3lzmmRXMaZ0c=; b=ZaCIcK/AmAgJW8ORzlH2l0M239cWbI0Yy9USxUhedpS+8F5aQlItAz/eNqUI/SxeqG 6KewFCiWWDIzWWNjGm470yCRsMILiy4B1zeIccNO7G3ceF6tE4uZ4hoftfdCh1dcwIWy zKZOlNiOKExtdZ2mSm924KsAmV5cGENaAN1UY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=N4Y8/f5h2c+8qmPFONzyrb+xWyQQ0xn3lzmmRXMaZ0c=; b=Hyka7E615qq9R+2yqdZl+ovB+NlhyyvPkGvBYkq43+bXDizknUby6SsC/wNXWzUxsj kdA+ySfJWVqpk++676rdq7OFr4+dqbx89jO8eqHEKAPTW50nzbQJPdvuvYCSHSdljrpE DdVvpxKbG9mr34c3pxGxji26k1T43F/yIMBhEg4MsBJL2z5e3GkHQm41ZLawCdzskd7h B/GJA1O1f8CUs40Ke90w4CqJ62eBAPxxhbnbyG0Trv8NIwNIYYchqEMpXWP3EvZ1V78F D/FFdhmRjNk7VVlXQFR/qOAAKKLnGtVFI0kQYB1QLdaqbafvu7SP/KpjgtSz/0tMZ3/T bm2Q== X-Gm-Message-State: AOAM533HSJw5OPLO8b0oVFlP9vXK72iFVE3jZrB1uBHhGnklg/ki6wWv f94H8Iq38mqrXlv0ZqY4Y5FGjA== X-Google-Smtp-Source: ABdhPJxUSI6d5OVKHvIHPJlIQ1IS0ljtDIF332/NI8MGgqJDszVUoVyDKrcpaQleuuGzbWYXWI3d8Q== X-Received: by 2002:a17:902:760e:b0:14f:d760:51d0 with SMTP id k14-20020a170902760e00b0014fd76051d0mr5089535pll.5.1645751824444; Thu, 24 Feb 2022 17:17:04 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q93-20020a17090a4fe600b001b9ba2a1dc3sm7262773pjh.25.2022.02.24.17.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 17:17:04 -0800 (PST) Date: Thu, 24 Feb 2022 17:17:03 -0800 From: Kees Cook To: Daniel Latypov Cc: David Gow , Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, KUnit Development , llvm@lists.linux.dev, linux-hardening@vger.kernel.org Subject: Re: [PATCH] lib: stackinit: Convert to KUnit Message-ID: <202202241714.DC112086@keescook> References: <20220224055145.1853657-1-keescook@chromium.org> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 24, 2022 at 11:43:40AM -0800, Daniel Latypov wrote: > On Wed, Feb 23, 2022 at 9:51 PM Kees Cook wrote: > > > > > > > > /* Userspace headers. */ > > +#define _GNU_SOURCE > > #include > > #include > > +#include > > #include > > #include > > #include > > #include > > > > /* 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