From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=83.166.143.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796404053; b=NUMteVxKZTz+Tye7WQA6s+2rvLxah1EMhHAmJf9m/+P8bNwnGq6N9I1x2ZR8AjwSpg9b drLu71AqTX4fetOoxhGlxFHXkbHYpkJtsYpU+hFxFAIjjoRJqjaZgBr/zLWN9aDG7VEAP KNz+KUWyMhmF8IlzzE0oT/F91Pl/RZa3n0agheRAMsViiHe06fKWGAGlrNEwDs4qTvG0u AZJK3XhSNtzLTjw9mYDuYzjuXOOYBWTCQgD0aXFBhEW9FM2Y10HgH5aBaSGxXgmabcHue sGaWKbTDuwy9RC6AmDLKoeyqHSU7s4oLQvl5bNsVETkHGAFVJzLLty0O1g045W/NxwA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796404053; h=DMARC-Filter:Received:DKIM-Signature:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To: X-Infomaniak-Routing; bh=vYZZrnJfmJMYWSoIgRg9d03eqebdTaTKZrYFs0YdDPg=; b=w7PVf9vkD1ncSDvYnoLZt4dPzSO6SexAIKpt25sXWrHFBtqTGwy9EJBDdORhh/WDzdzO 9C6mWUZMc5TduYyx1FU2iVp21fiRa53Qw0wcN1Io7Nqmn9qwr7P6ZiCBW0lU8SPWjGbVg 36C6GukJTb8wEZ+PQ8vNwVi5EJBNRdJTvsUBWEgAGXYi1b/WrDzR82mO299AlNxe3wn/K MbiY6hC2ienCH7ucrIlhbKU207hZ17KIgiQEaXcOUl1XDPVm3xYiEBcxZDHns97Pm3Cgv UgN3pJreCMNH9+Hj4TxrRmWtzfxrck1YYSe2+BQ9DBInqBPchEgV83uJOX2vAP4RjBg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass header.d=digikod.net header.i=@digikod.net header.a=rsa-sha256 header.s=20191114 header.b=u4ONfnBR; arc=none smtp.remote-ip=83.166.143.175 Received: from smtp-8faf.mail.infomaniak.ch (smtp-8faf.mail.infomaniak.ch [83.166.143.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6444606A322 for ; Fri, 4 Dec 2026 17:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E6444606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.a=rsa-sha256 header.s=20191114 header.b=u4ONfnBR Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4jgybh27xJz12xG; Fri, 4 Dec 2026 18:07:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digikod.net; s=20191114; t=1796404048; bh=vYZZrnJfmJMYWSoIgRg9d03eqebdTaTKZrYFs0YdDPg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u4ONfnBR/Ev5ga8QtshoMOtcdscJTA3RNWq6yExQjB90c0fY7SJEJO1EtVVRAHynC 1O424jVHNSjwT6ts+LTr43qA2p/FvkIEDhQSkckP0nF4SnjYE7IR+mdlsZ5bc5yieA 7glx3PKWvugPDuNuxvpZYwlLcU4NG5hB98vDD+XY= Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4jgybg4752zrpq; Fri, 4 Dec 2026 18:07:27 +0100 (CET) Date: Fri, 4 Dec 2026 18:07:23 +0100 From: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= To: =?utf-8?Q?G=C3=BCnther?= Noack Cc: =?utf-8?Q?G=C3=BCnther?= Noack , Shuah Khan , linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 00/27] landlock: Selftest fixes and cleanups Message-ID: <20261204.wie6tei7Ahro@digikod.net> References: <20261104-selftests-refactor-v2-0-c52f23f7ce33@gmail.com> X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261104-selftests-refactor-v2-0-c52f23f7ce33@gmail.com> X-Infomaniak-Routing: alpha Thanks for these fixes. I'll take patches 1-10 and 13-23 now. I clarified the messages for patches 2, 10, and 20 and dropped the Fixes tag from 20. I also closed the audit ioctl FD in 15 and dropped the common.h hunk from 23 because it is already upstream. Patches 11, 12, and 24-27 still need discussion; see my replies on those patches. Please include only those six in v3. On Wed, Nov 04, 2026 at 10:08:46PM +0100, Günther Noack wrote: > A collection of Landlock Selftest fixes > ======================================= > > This patch set is bundled together to be slightly less spammy, > but the patches are mostly independent. The commits are ordered > such that the simpler and more orthogonal patches come earlier. > > The patch set is LLM-assisted (and that turned out to be very useful > for spotting errors). Needless to say, I have verified all commits by > hand, and reworked them where necessary. > > The last few patches are a bit more cross-cutting and probably more > prone to merge conflicts, as they correct cases where we have been > using EXPECT and ASSERT in the wrong way (details in the commit > messages). I believe that the rationale for each of these is > reasonable, but I am happy to discuss. > > Motivation > ========== > > LLMs (and humans ;-)) have an unfortunate tendency to pick up and > replicate bad coding style patterns, so I hope that a broader cleanup > of the test style will avoid this spreading further. > > –Günther > > --- > Changes in v2: > - Rebased onto master (v7.4-rc1-132-g05441d697f7f). > - Dropped the "Assisted-by: LLM" trailers (not required any more). > - Applied the same ASSERT/EXPECT rules to the test code that was added > in the meantime (cap_test.c and ns_test.c, plus new checks in > base_test.c and trace_test.c): > - "Assert tracefs_extract_field() results that are used": also the > new handled_permissions check in trace.create_ruleset. > - "Assert audit initialization in fixture setups": also the > cap_audit, ns_audit and ns_proc_open fixtures. > - "Assert audit_count_records() before using its result": also in > cap_test.c and ns_test.c. > - "Use ASSERT for syscall failures before errno checks": also in > cap_test.c and ns_test.c. > - "Use EXPECT for checks that later steps do not need": also the > errno and WEXITSTATUS() checks in cap_test.c and ns_test.c, and the > errno check in base_test.c's ruleset_with_unknown_permission. > - Dropped the note about depending on Wang Yan's snprintf() fix, which > has landed as commit 8e4c736cffdd ("selftests/landlock: Fix snprintf > truncation checks in test files"). > - Link to v1: https://patch.msgid.link/20261008142604.39107-2-gnoack3000@gmail.com > > To: Mickaël Salaün > To: Günther Noack > To: Shuah Khan > Cc: linux-security-module@vger.kernel.org > Cc: linux-kselftest@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > > --- > Günther Noack (27): > selftests/landlock: Propagate grandchild failures in unix_scoping > selftests/landlock: Propagate EXPECT failures from forked children > selftests/landlock: Check the thread result in audit.thread > selftests/landlock: Zero-initialize the buffer in inconsistent_attr > selftests/landlock: Fix the openat() success check in fs_bench > selftests/landlock: Fix the reported clock tick rate in fs_bench > selftests/landlock: Fix the ruleset_fd check in empty_or_same_ruleset > selftests/landlock: Handle a missing control message in recv_fd() > selftests/landlock: Assert tracefs_extract_field() results that are used > selftests/landlock: Assert audit initialization in fixture setups > selftests/landlock: Assert helper results that are used afterwards > selftests/landlock: Assert audit_count_records() before using its result > selftests/landlock: Fix memory leak in audit_init_filter_exe() > selftests/landlock: Make audit_message large enough for any exe filter > selftests/landlock: Close leaked file descriptors > selftests/landlock: Check errno for combined VERSION and ERRATA flags > selftests/landlock: Fix SIGURG handler setup in scoped_signal_test > selftests/landlock: Fix regex_escape() error handling in matches_log_fs_extra() > selftests/landlock: Fix off-by-one in regex_escape() > selftests/landlock: Fix the snprintf() error check in matches_log_fs_extra() > selftests/landlock: Use _exit() in the named_pipe_ioctl child > selftests/landlock: Fix messages and comments in helper programs > selftests/landlock: Fix stale comments in common.h and audit.h > selftests/landlock: Use ASSERT for syscall failures before errno checks > selftests/landlock: Assert WIFEXITED() before checking the exit status > selftests/landlock: Use EXPECT for closing FDs and stopping threads > selftests/landlock: Use EXPECT for checks that later steps do not need > > tools/testing/selftests/landlock/audit.h | 20 +- > tools/testing/selftests/landlock/audit_test.c | 56 +- > tools/testing/selftests/landlock/base_test.c | 192 +-- > tools/testing/selftests/landlock/cap_test.c | 70 +- > tools/testing/selftests/landlock/common.h | 32 +- > tools/testing/selftests/landlock/fs_bench.c | 5 +- > tools/testing/selftests/landlock/fs_test.c | 1300 ++++++++++---------- > tools/testing/selftests/landlock/net_test.c | 64 +- > tools/testing/selftests/landlock/ns_test.c | 124 +- > tools/testing/selftests/landlock/ptrace_test.c | 44 +- > .../selftests/landlock/sandbox-and-launch.c | 6 +- > .../selftests/landlock/scoped_abstract_unix_test.c | 45 +- > .../selftests/landlock/scoped_signal_test.c | 23 +- > tools/testing/selftests/landlock/scoped_test.c | 2 +- > tools/testing/selftests/landlock/trace_fs_test.c | 8 +- > tools/testing/selftests/landlock/trace_test.c | 28 +- > tools/testing/selftests/landlock/tsync_test.c | 22 +- > .../testing/selftests/landlock/wait-pipe-sandbox.c | 16 +- > tools/testing/selftests/landlock/wait-pipe.c | 2 +- > 19 files changed, 1051 insertions(+), 1008 deletions(-) > --- > base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d > change-id: 20261104-selftests-refactor-4741be042e4f > > Best regards, > -- > Günther Noack > >