[PATCH] landlock: update expected string

bruce.ashfield at gmail.com bruce.ashfield at gmail.com
Sat Apr 30 05:42:10 UTC 2022


From: Bruce Ashfield <bruce.ashfield at gmail.com>

Test failures were picked up in the yocto 5.15.36 -stable testing.

Kernel commit:

  commit 3d4b396a616d0d67bf95d6823ad1197f6247292e
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   Mon Oct 11 15:37:04 2021 +0200

      landlock: Use square brackets around "landlock-ruleset"

      commit aea0b9f2486da8497f35c7114b764bf55e17c7ea upstream.

      Make the name of the anon inode fd "[landlock-ruleset]" instead of
      "landlock-ruleset". This is minor but most anon inode fds already
      carry square brackets around their name:

          [eventfd]
          [eventpoll]
          [fanotify]
          [fscontext]
          [io_uring]
          [pidfd]
          [signalfd]
          [timerfd]
          [userfaultfd]

      For the sake of consistency lets do the same for the landlock-ruleset anon
      inode fd that comes with landlock. We did the same in
      1cdc415f1083 ("uapi, fsopen: use square brackets around "fscontext" [ver #2]")
      for the new mount api.

      Cc: linux-security-module at vger.kernel.org
      Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
      Link: https://lore.kernel.org/r/20211011133704.1704369-1-brauner@kernel.org
      Cc: stable at vger.kernel.org
      Signed-off-by: Mickaël Salaün <mic at linux.microsoft.com>
      Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>

Changed the format of the landlock ruleset. We need to update the strace
expected string to match.

Signed-off-by: Bruce Ashfield <bruce.ashfield at gmail.com>
---

Hi,

I'm not sure how multiple kernel versions are handled for this type
of change. Obviously kernels without the commit I reference above will
have the old format, and hence would have the opposite result.

I wanted to send this along regardless, since as part of the yocto
project integration tests, the strace tests are run. We are getting
a failure as the expected and actual output aren't matching for this
case.

Cheers,

Bruce

 tests/landlock_create_ruleset-y.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/landlock_create_ruleset-y.c b/tests/landlock_create_ruleset-y.c
index a30966b09..50e19c2d5 100644
--- a/tests/landlock_create_ruleset-y.c
+++ b/tests/landlock_create_ruleset-y.c
@@ -1,4 +1,4 @@
-#define FD_PATH "<anon_inode:landlock-ruleset>"
+#define FD_PATH "<anon_inode:[landlock-ruleset]>"
 #define SKIP_IF_PROC_IS_UNAVAILABLE skip_if_unavailable("/proc/self/fd/")
 
 #include "landlock_create_ruleset.c"
-- 
2.19.1



More information about the Strace-devel mailing list