public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] main: Add a test for CVE-2025-22063 & -38147
@ 2026-10-01  7:29 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-10-01  7:29 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : main
            Commit : 479b983daa5bb0bfb7239feaeb4af3a1e0cfb66e
            Author : Ondrej Mosnáček <omosnacek@gmail.com>
            Date   : 2026-10-01T07:29:35+00:00
            Stats  : +107/-0 in 4 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/479b983daa5bb0bfb7239feaeb4af3a1e0cfb66e?branch=main

            Log:
            Add a test for CVE-2025-22063 & -38147

Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com>

---
diff --git a/kernel/CVE-2025-22063-38147/.gitignore b/kernel/CVE-2025-22063-38147/.gitignore
new file mode 100644
index 0000000..6263bf3
--- /dev/null
+++ b/kernel/CVE-2025-22063-38147/.gitignore
@@ -0,0 +1 @@
+reproducer

diff --git a/kernel/CVE-2025-22063-38147/main.fmf b/kernel/CVE-2025-22063-38147/main.fmf
new file mode 100644
index 0000000..e744d57
--- /dev/null
+++ b/kernel/CVE-2025-22063-38147/main.fmf
@@ -0,0 +1,44 @@
+summary: Test for CVE-2025-22063 and -38147
+description: |
+    Runs the reproducer for CVE-2025-22063 / CVE-2025-38147 (both are the
+    same issue).
+contact: Ondrej Mosnacek <omosnacek@gmail.com>
+component:
+  - kernel
+framework: beakerlib
+require:
+  - netlabel_tools
+  - gcc
+duration: 5m
+tier: 2
+check:
+  # The reproducer triggers a kernel BUG when the bug is present, so turn
+  # on the dmesg check.
+  - dmesg
+enabled: true
+link:
+  - relates: https://lore.kernel.org/linux-cve-announce/2025041607-CVE-2025-22063-dec0@gregkh/
+  - relates: https://lore.kernel.org/linux-cve-announce/2025070335-CVE-2025-38147-52a6@gregkh/
+  - relates: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=078aabd567de3d63d37d7673f714e309d369e6e2
+  - relates: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6e9f2df1c550ead7cecb3e450af1105735020c92
+  - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2025-22063
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257657
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257658
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257659
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257660
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257663
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257665
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257666
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257668
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257669
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257670
+  - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2025-38147
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257673
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257674
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257675
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257678
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257679
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257681
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257683
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257685
+  - verifies: https://redhat.atlassian.net/browse/RHEL-257686

diff --git a/kernel/CVE-2025-22063-38147/reproducer.c b/kernel/CVE-2025-22063-38147/reproducer.c
new file mode 100644
index 0000000..ac9c8b7
--- /dev/null
+++ b/kernel/CVE-2025-22063-38147/reproducer.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* 
+ * Copyright (c) 2026 Red Hat, Inc.
+ * Author: Ondrej Mosnacek <omosnacek@gmail.com>
+ */
+
+#include <stdlib.h>
+
+#include <arpa/inet.h>
+#include <sys/socket.h>
+
+int main(int argc, char **argv)
+{
+	struct sockaddr_in6 addr = {
+	    .sin6_family = AF_INET6,
+	    .sin6_port = htons(31337),
+	    .sin6_addr = in6addr_loopback,
+	};
+	int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+
+	connect(fd, (struct sockaddr *)&addr, sizeof(addr));
+	return 0;
+}

diff --git a/kernel/CVE-2025-22063-38147/runtest.sh b/kernel/CVE-2025-22063-38147/runtest.sh
new file mode 100755
index 0000000..e855495
--- /dev/null
+++ b/kernel/CVE-2025-22063-38147/runtest.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2026 Red Hat, Inc.
+# Author: Ondrej Mosnacek <omosnacek@gmail.com>
+
+# Include Beakerlib environment
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlRun "uname -r" 0 "Print kernel version"
+
+        rlRun "gcc -o reproducer reproducer.c" 0 "Compile the reproducer"
+
+        rlRun "netlabelctl calipso add pass doi:7" 0 "Set up CALIPSO"
+        rlRun "netlabelctl map del default" 0 "Delete default netlabel map"
+        rlRun "netlabelctl map add default address:0.0.0.0/0 protocol:unlbl" 0 \
+            "Set unlabeled traffic by default"
+        rlRun "netlabelctl map add default address:::/0 protocol:unlbl" 0 \
+            "Set unlabeled traffic by default"
+        rlRun "netlabelctl map add default address:0::1/128 protocol:calipso,7" 0 \
+            "Set up CALIPSO for localhost only"
+    rlPhaseEnd
+
+    rlPhaseStartTest
+        # Will trigger a kernel OOPS in dmesg or panic when vulnerable
+        rlRun "./reproducer" 0 "Run the reproducer"
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "netlabelctl map del default" 0 "Delete the CALIPSO map"
+        rlRun "netlabelctl calipso del doi:7" 0 "Unsetup CALIPSO"
+        rlRun "netlabelctl map add default protocol:unlbl" 0 "Re-add default netlabel map"
+
+        rlRun "rm -f reproducer" 0 "Delete the reproducer binary"
+    rlPhaseEnd
+rlJournalPrintText
+rlJournalEnd

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-01  7:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01  7:29 [tests/selinux] main: Add a test for CVE-2025-22063 & -38147 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox