From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F18AB606A31C for ; Mon, 30 Nov 2026 10:11:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YzQyjGV/ Received: by kanga.kvack.org (Postfix) id 0EA3C6B05B0; Mon, 30 Nov 2026 05:11:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09BE76B05B1; Mon, 30 Nov 2026 05:11:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF3366B05B2; Mon, 30 Nov 2026 05:11:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CA4556B05B0 for ; Mon, 30 Nov 2026 05:11:10 -0500 (EST) Received: from smtpin15.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4CA601C43ED for ; Mon, 30 Nov 2026 10:11:10 +0000 (UTC) X-FDA: 85491367500.15.16E13AC Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf28.hostedemail.com (Postfix) with ESMTP id A97DAC0010 for ; Mon, 30 Nov 2026 10:11:08 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b="YzQyjGV/"; spf=pass (imf28.hostedemail.com: domain of jarkko@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=jarkko@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796033468; b=o2hUZJp8wL6VnkppsCwpnov4zGdPxFrvJ3AtzeUI00LUAXioSAzfXgBYNtBvGNg8/eLW2l vT/46bFGAL5cKxj1Erb+r+O94pax8j3NbWS6uVWLkmLEvLqSazmVua02Tt+qiHv569a89j 7TK6AS1t9DChfW5WeNk3ecf9SfgpV48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796033468; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zAgG/+yspsokeAfWiv2bYM5arPE+3xOuj36WClXPxpI=; b=Sn0oilkek8lefuK3hqJJAgPiH6beqd8LWRZZdAL9aJJIGk5/UBK+nIxLlwDpl+Ul6PHyg2 dit4sO/PoWqmnFAmQ0ZXV29fsMTRkiQ/o8FHfGIJgVcsFf4X2qFEcUgmKllYLDPiml79l7 iYttaL8ElsSTxzQzYObEPV3XRCyawL8= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b="YzQyjGV/"; spf=pass (imf28.hostedemail.com: domain of jarkko@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=jarkko@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with UTF8SMTP id C700561C7D; Mon, 30 Nov 2026 10:11:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id 69FEB1F00934; Mon, 30 Nov 2026 10:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796033467; bh=zAgG/+yspsokeAfWiv2bYM5arPE+3xOuj36WClXPxpI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=YzQyjGV/d94RasbwJKgzxbULUjRFtkiFzfnjfA/6AhU9674Q0yv6Riqy/WsKzomR+ L9tmzXwJtZQ8HzQd1oEsXE/UgrkWzFogqkheUQo7sXdI+wLF/BzrlakaXJUcrCBDO2 KXvnac24OyXJh5z8T5KQ9FrUlN1WUY1DeRjAk4NZnVEeirh0W9iJLA87nxGz91EB5c hXNvE3aTm+t2QqUWcAF3DzOPqjo+O/lL3Fzc2rhWzWGl3zgtBqSNNdo04Ri9oSdcYi Kzy086/CmfrwygTjvE9uIx16GTyDLjzL3EdLLcvhv/z8d5Bge4udaeyg5cM3JJU1vX gJYK3nFNEHTGQ== Date: Mon, 30 Nov 2026 12:11:03 +0200 From: Jarkko Sakkinen To: fsdevel@vger.kernel.org Cc: bpf@vger.kernel.org, containers@lists.linux.dev, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, Aleksa Sarai , Alexander Mikhalitsyn , Alexander Viro , Andy Lutomirski , Arnd Bergmann , Christian Brauner , David Howells , Eric Biggers , Georgia Garcia , Giuseppe Scrivano , Hugh Dickins , James Morris , Jan Kara , Jeff Layton , John Johansen , Jonathan Corbet , Josef Bacik , Kees Cook , KP Singh , Lennart Poettering , Matt Bobrowski , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Neal Gompa , Oleg Nesterov , Paul Moore , Pavel Tikhomirov , Serge Hallyn , Shuah Khan , Stephen Smalley , Zygmunt Krynicki Subject: Re: [RFC PATCH v8 28/29] selftests/userland: Add userland test suite Message-ID: References: <20261128235808.2369970-1-jarkko@kernel.org> <20261128235808.2369970-29-jarkko@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Queue-Id: A97DAC0010 X-Stat-Signature: ibtt93o8uopf6tio3o7nuadf7zm19zww X-Rspamd-Server: rspam12 X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1796033468-756617 X-HE-Meta: U2FsdGVkX18s8h2M1HmCnCseN63kQG0RwiyfnZDd7aG0CZ5U8vmkocxuGRc1JWyp8+MKl51bWUlwtqTnh17s5/zDOiROD1j5RZK8bXmXUMDVjMBZP3pInwSfxv/KCSIPtRkhtZAILLkXlOYJeaw9p/VOM5MmV/2QrXI0khusiTXzPT7e550aZ7lCPp1mSDlf730QmeFvqzq3Joqh6hyjxr/UJ9lyp63gK++JdPYf7+et7gZCXstKL2MjmJyo5YmINWW2azT0QhBTEGDEeG29b6BUiCdwwQnCyajcb06izUApujGnex4JKtjlLzaDBcxG4toaglFUSOj7HwSAYIYBmS5+sEqXa8xpu8WHVqkfP0cYLOslQAyloJrfZqOw0nsq0D/RLG5xIzlzvw/HTJ9JvufPtjFrmJlgBdKLAwKen4Bjf9hlh4aIbhmgY6OMUzaTtOedfgCJRRKRvkcOclaE+XnfWZi8h1GZcVnW/SXK/+lYQOFvD8Pt15luYMGrvZ1KOMw+xPh39zAfLJ9ZltsIin3XSGLhuAdE/mn0cDnUeorg/aYszKJGhmoalD0Iqw97FI/qwuq+/Eruy7tc/1kmh9dk1V8sM2jHMfpXb0eSI5kpYL3XRaBHuMO/YpFzgP1dwl1uEI6U+Htvhxvqv+fo7DusuNPHdK5ZcIkSevdHk2OgoEC3X5jkQcgQecMsZVLRH+RZRH9MNnCWd9KOhlKOwY402Fccg+C0xrURlKf3RoXqm34Z11cQMECMP1tR5UjA0x3G2Twi3j2S2K4fRp7ix0OvT6R0u6aPa64pMg57XQ6olwgqe4FTed/TfO4wW4bVP/Etem9ih7r6OPCgmvy+nUA9ji2h55aHfaJC1nqpg7FG/B9hfgY2LeeBhrmUw3iSODkSq7OFz0sU/uP3lwArlCJL58O72uJcDUbRoBgzP3+R6fJh8MsCW2EcX6oURGG/T6EupmQqk9ZA/iXLugU pM2VVX3o bxB5FbM82lviUFclAGoQOhE3rrojPXl2N13y/VD7hR/3/ApJeDnY0Ymn14gMIDdSawZDBGjQMk4W28NxlA78hYCk6XXArjDFWJr2JA6r3kC1OEGRP4cw5giHVYmSOUAQrBrX+KJhE+sDFYufFoeBrzTCagX6IxyqN+KOAh+yLIJDqEpQav2s771Lz5GK59OfkdMs9Kq0MK0cEMVaCltxJn05/IScMTNQ2gebvCMI5jDCJv8WxvyZJkd7yf963jBIerzZoU9Z0sx5UcMZCKSjFWpfzPpe5ywjaP7js+yqNCer7669Z9aixnZL/eqscAo12JeiqPnk6D+gwOytJ2W6jctf52D0afZ1Vi4Qg0T5a53YLS/vQYd9E/8eXMNbDkZJw0C+Ay01mX68Y+TAaBPNYHP1H/VRgLb5WRbenG2gvVa+hJy/bOS+s9Sxfgk6vb3G6ZDq6uOWEOdem3bRRz3hGhbeqzTYtjo8ghDElyANakFezrmsgldATnk8zb3jTLYcMaegcytTsI5k9S26vZoF5R07rhf4IOSIxdNxmI13l8vMdyho/HjhayAuVbw== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, Nov 30, 2026 at 09:01:34AM +0200, Jarkko Sakkinen wrote: > On Mon, Nov 30, 2026 at 08:49:42AM +0200, Jarkko Sakkinen wrote: > > On Mon, Nov 30, 2026 at 04:39:42AM +0200, Jarkko Sakkinen wrote: > > > On Mon, Nov 30, 2026 at 03:34:23AM +0200, Jarkko Sakkinen wrote: > > > > On Sun, Nov 29, 2026 at 01:58:07AM +0200, Jarkko Sakkinen wrote: > > > > > Verify the userland_open() control object, namespace sharing, > > > > > mount-namespace configuration, waitid(P_USERLAND), pidfd_send_signal(), > > > > > and userns_set_idmap() uAPI and security invariants across privileged, > > > > > unprivileged, SCM_RIGHTS delegation, and edge-case scenarios. > > > > > > > > > > Signed-off-by: Jarkko Sakkinen > > > > > > > > > > > > At https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd-test.git/: > > > > > > > > $ make > > > > make help Show this help > > > > make list List available defconfigs > > > > make download Prime the download cache > > > > make sdk Build and cache SDK toolchains > > > > make configure Force configuration > > > > make savedefconfig Save minimal defconfig > > > > make linux-update-defconfig Save minimal kernel defconfig > > > > make build Incrementally build (FORCE=1 to run again) > > > > make userland Build with userland trees (FORCE=1 to run again) > > > > make ssh Open an SSH session to > > > > make burn Write existing image to DEVICE (does not build) > > > > make clean Remove build artifacts > > > > make clean-sdk Remove cached SDK toolchains > > > > make lint Run linters > > > > > > > > "userland" target builds a a hybrid ISO containing a bootc/composefs > > > > based OS build, and having Userland-patched Linux, SystemD, Bubblewrap > > > > and Podman. My kernel testing suite has developed into a Silverblue'ish > > > > environment because I needed something like that for testing lockdown > > > > hibernate patches. > > > > > > > > Here's virsh hosted "tpmdd_amd64.iso" built with "make userland > > > > BOARD=tpmdd_amd64" running the kselftest: > > > > > > > > TAP version 13 > > > > 1..1 > > > > kselftest: Running tests in userland > > > > # timeout set to 45 > > > > # selftests: userland: test_smoke.sh > > > > # TAP version 13 > > > > # 1..17 > > > > # ok 1 UserlandUapiTest.test_cell_broadcast_kill > > > > # ok 2 UserlandUapiTest.test_cell_lifecycle_exec_and_hot_mount > > > > # ok 3 UserlandUapiTest.test_clone_flags_and_pidns_ancestry > > > > # ok 3 UserlandUapiTest.test_clone_flags_and_pidns_ancestry > > > > # ok 3 UserlandUapiTest.test_clone_flags_and_pidns_ancestry > > > > # ok 3 UserlandUapiTest.test_clone_flags_and_pidns_ancestry > > > > # ok 3 UserlandUapiTest.test_clone_flags_and_pidns_ancestry > > > > # ok 4 UserlandUapiTest.test_concurrent_bootstrap > > > > # ok 5 UserlandUapiTest.test_create_flags > > > > # ok 6 UserlandUapiTest.test_get_nsfd > > > > # # UserlandUapiTest.test_landlock_namespace_use: Landlock not enabled > > > > # ok 7 UserlandUapiTest.test_landlock_namespace_use # SKIP > > > > # ok 8 UserlandUapiTest.test_mount_and_fsconfig_validation > > > > # ok 9 UserlandUapiTest.test_pivot_root_and_standalone_mntns_hot_mount > > > > # ok 10 UserlandUapiTest.test_proc_submount_and_nested_namespaces > > > > # ok 11 UserlandUapiTest.test_send_signal_and_kill_on_close > > > > # ok 12 UserlandUapiTest.test_setns_owner_vs_foreign > > > > # ok 13 UserlandUapiTest.test_share_nsfd > > > > # ok 14 UserlandUapiTest.test_unprivileged_without_entering_userns > > > > # ok 15 UserlandUapiTest.test_userns_set_idmap > > > > # ok 16 UserlandUapiTest.test_userns_set_idmap_delegation > > > > # ok 17 UserlandUapiTest.test_wait_poll_and_clone_dead > > > > # # 1 skipped test(s) detected. Consider enabling relevant config options to improve coverage. > > > > # # Totals: pass:16 fail:0 xfail:0 xpass:0 skip:1 error:0 > > > > ok 1 selftests: userland: test_smoke.sh > > > > # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 > > > > > > > > Yes, I should "CONFIG_LANDLOCK=y". It's the next thing on the list. > > > > > > > > Generally I plan to make it model based stochastic test with seed > > > > printed at start so that failures can be replayed. > > > > > > > > I've used model based testing lately very successfully in my Landstrip > > > > stateless parametric agent sandbox (compatible with Anthtropic's policy > > > > format): https://github.com/landstrip/landstrip > > > > > > > > It feels like right way to go so that the syscall interface can be > > > > actually stressed. > > > > > > It's also "crypto-ready" architecture. I.e. given that entities are > > > inspired by confidential computing workloads, there's a clean staging > > > phase, and that provides integration points for having cryptograhic > > > measurement, if that is ever wanted. Obviously, that would be still > > > non-trivial problem but architecture is doing best effort on helping > > > to resolve it. > > > > This could be useful actually in lockdown-hibernate. It could have > > more zeroing host OS state mode as long as boostrap can decrypt > > the container after powering up back from S4. > > > > Unconsidered idea, and partly off-topic but had to write this down > > as lockdown-hibernate is active review process. > > > > I.e., possibly in addition to PCR 5 trampoline, it should have > > "container mode". > > In container-S4-wakeup the same trampoline would be used but I'm > thinking could you only sign a critical portion of the RAM and > forget rest and wake up rest of the state from a container. > > Might be a bad idea but highlights how important it would be for a > container abstraction to be relatively opaque object so that other > things like authentication and power management have also room for > consideration. > > I think where the design is going wrong all the time is to consider this > as Linux namespaces feature while container is actually more like "soft > arch" and the feature that I've been doing can be imagined as "soft > kexec". I have now rudimentary model-based test. Initially it just generates a test case per category but before I push this I'll make it generate a bunch of test cases per category; each randomized per run. I also pixel-perfected Cells-emulator quite a lot and it is much more comparable than the one in this patch set. These obviously exercise also kselftest/cells/userland stack. The test is now in fact in good shape enough that it would be easy to to make it even cross patch set compatible. Example output: TAP version 13 1..1 # timeout set to 120 # selftests: userland: test_smoke.sh # TAP version 13 # 1..6 # # seed 0xdeac25bb4153280d (replay: USERLAND_SEED=0xdeac25bb4153280d) # ok 1 reproduce # ok 2 lifecycle # ok 3 idmap # ok 4 mounts # ok 5 cells # # landlock: Landlock not enabled # ok 6 landlock # SKIP # # 1 skipped test(s) detected. Consider enabling relevant config options to improve coverage. # # Totals: pass:5 fail:0 xfail:0 xpass:0 skip:1 error:0 ok 1 selftests: userland: test_smoke.sh # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 Yep, it's again landlock ;-) Br, Jarkko