Skip to content

Commit 508342a

Browse files
authored
selinux-policy: Add checkpoint restore for getty. (#8879)
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
1 parent a2300b1 commit 508342a

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 46192c98e771f5120b62c6ab36dc1245424e7cd4 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
3+
Date: Thu, 28 Mar 2024 20:01:49 +0100
4+
Subject: [PATCH 41/41] getty: grant checkpoint_restore
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
Since Linux 6.7 checkpoint-restore functionality is guareded via the
10+
capability CAP_CHECKPOINT_RESTORE, with a fallback to CAP_SYS_ADMIN.
11+
Grant the new capability while keeping the old one for backwards
12+
compatibility.
13+
14+
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
15+
---
16+
policy/modules/system/getty.te | 1 +
17+
1 file changed, 1 insertion(+)
18+
19+
diff --git a/policy/modules/system/getty.te b/policy/modules/system/getty.te
20+
index bbc83a807..a900226bf 100644
21+
--- a/policy/modules/system/getty.te
22+
+++ b/policy/modules/system/getty.te
23+
@@ -34,6 +34,7 @@ files_tmp_file(getty_tmp_t)
24+
# Use capabilities.
25+
allow getty_t self:capability { chown dac_override fowner fsetid setgid sys_admin sys_resource sys_tty_config };
26+
dontaudit getty_t self:capability sys_tty_config;
27+
+allow getty_t self:capability2 checkpoint_restore;
28+
allow getty_t self:process { getpgid getsession setpgid signal_perms };
29+
allow getty_t self:fifo_file rw_fifo_file_perms;
30+
31+
--
32+
2.44.0
33+

SPECS/selinux-policy/selinux-policy.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Summary: SELinux policy
1010
Name: selinux-policy
1111
Version: %{refpolicy_major}.%{refpolicy_minor}
12-
Release: 5%{?dist}
12+
Release: 6%{?dist}
1313
License: GPLv2
1414
Vendor: Microsoft Corporation
1515
Distribution: Mariner
@@ -60,6 +60,7 @@ Patch38: 0038-systemd-Fix-run-systemd-shutdown-handling.patch
6060
Patch39: 0039-modutils-Temporary-fix-for-mkinitrd-dracut.patch
6161
Patch40: 0040-For-systemd-hostnamed-service-to-run.patch
6262
Patch41: 0041-docker-Silence-io.containerd.internal.v1.opt-opt-con.patch
63+
Patch42: 0042-getty-grant-checkpoint_restore.patch
6364
BuildRequires: bzip2
6465
BuildRequires: checkpolicy >= %{CHECKPOLICYVER}
6566
BuildRequires: m4
@@ -345,6 +346,9 @@ exit 0
345346
selinuxenabled && semodule -nB
346347
exit 0
347348
%changelog
349+
* Tue Apr 23 2024 Chris PeBenito <chpebeni@microsoft.com> - 2.20221101-6
350+
- Add getty fix for new check in kernel 6.7
351+
348352
* Tue Oct 17 2023 Chris PeBenito <chpebeni@microsoft.com> - 2.20221101-5
349353
- Silence noise in containerd io.containerd.internal.v1.opt plugin.
350354

0 commit comments

Comments
 (0)