Skip to content

Commit 6f6cd79

Browse files
Bump containerd to v1.6.28 runc v.1.1.12 (#4398) (#4400)
1 parent 218ced9 commit 6f6cd79

8 files changed

+139
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
echo "v1.6.15"
3+
echo "v1.6.28"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From 5351ef6f5b592472e077512714b2516cdbae1b51 Mon Sep 17 00:00:00 2001
2+
From: Angelos Kolaitis <[email protected]>
3+
Date: Thu, 1 Feb 2024 11:23:08 +0200
4+
Subject: [PATCH 2/3] setns_init_linux: set the NNP flag after changing the
5+
apparmor profile
6+
7+
With the current version of the AppArmor kernel module, it's not
8+
possible to switch the AppArmor profile if the NoNewPrivileges flag is
9+
set. So, we invert the order of the two operations.
10+
11+
Adjusts the previous patch for runc version v1.1.12
12+
13+
Co-Authored-By: Alberto Mardegan <[email protected]>
14+
---
15+
libcontainer/setns_init_linux.go | 10 +++++-----
16+
1 file changed, 5 insertions(+), 5 deletions(-)
17+
18+
diff --git a/libcontainer/setns_init_linux.go b/libcontainer/setns_init_linux.go
19+
index d1bb122..00407ce 100644
20+
--- a/libcontainer/setns_init_linux.go
21+
+++ b/libcontainer/setns_init_linux.go
22+
@@ -56,11 +56,6 @@ func (l *linuxSetnsInit) Init() error {
23+
return err
24+
}
25+
}
26+
- if l.config.NoNewPrivileges {
27+
- if err := unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
28+
- return err
29+
- }
30+
- }
31+
if err := selinux.SetExecLabel(l.config.ProcessLabel); err != nil {
32+
return err
33+
}
34+
@@ -84,6 +79,11 @@ func (l *linuxSetnsInit) Init() error {
35+
if err := apparmor.ApplyProfile(l.config.AppArmorProfile); err != nil {
36+
return err
37+
}
38+
+ if l.config.NoNewPrivileges {
39+
+ if err := unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
40+
+ return err
41+
+ }
42+
+ }
43+
44+
// Check for the arg before waiting to make sure it exists and it is
45+
// returned as a create time error.
46+
--
47+
2.34.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
From 103a94a51ea334d25bf573f2f20cd4d9a099d827 Mon Sep 17 00:00:00 2001
2+
From: Alberto Mardegan <[email protected]>
3+
Date: Thu, 17 Jun 2021 14:31:35 +0300
4+
Subject: [PATCH 3/3] standard_init_linux: change AppArmor profile as late as
5+
possible
6+
7+
---
8+
libcontainer/standard_init_linux.go | 18 +++++++++---------
9+
1 file changed, 9 insertions(+), 9 deletions(-)
10+
11+
diff --git a/libcontainer/standard_init_linux.go b/libcontainer/standard_init_linux.go
12+
index d1d9435..7097571 100644
13+
--- a/libcontainer/standard_init_linux.go
14+
+++ b/libcontainer/standard_init_linux.go
15+
@@ -127,10 +127,6 @@ func (l *linuxStandardInit) Init() error {
16+
return &os.SyscallError{Syscall: "sethostname", Err: err}
17+
}
18+
}
19+
- if err := apparmor.ApplyProfile(l.config.AppArmorProfile); err != nil {
20+
- return fmt.Errorf("unable to apply apparmor profile: %w", err)
21+
- }
22+
-
23+
for key, value := range l.config.Config.Sysctl {
24+
if err := writeSystemProperty(key, value); err != nil {
25+
return err
26+
@@ -150,17 +146,21 @@ func (l *linuxStandardInit) Init() error {
27+
if err != nil {
28+
return fmt.Errorf("can't get pdeath signal: %w", err)
29+
}
30+
- if l.config.NoNewPrivileges {
31+
- if err := unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
32+
- return &os.SyscallError{Syscall: "prctl(SET_NO_NEW_PRIVS)", Err: err}
33+
- }
34+
- }
35+
// Tell our parent that we're ready to Execv. This must be done before the
36+
// Seccomp rules have been applied, because we need to be able to read and
37+
// write to a socket.
38+
if err := syncParentReady(l.pipe); err != nil {
39+
return fmt.Errorf("sync ready: %w", err)
40+
}
41+
+ if err := apparmor.ApplyProfile(l.config.AppArmorProfile); err != nil {
42+
+ return fmt.Errorf("apply apparmor profile: %w", err)
43+
+ }
44+
+ if l.config.NoNewPrivileges {
45+
+ if err := unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
46+
+ return fmt.Errorf("set nonewprivileges: %w", err)
47+
+ }
48+
+ }
49+
+
50+
if err := selinux.SetExecLabel(l.config.ProcessLabel); err != nil {
51+
return fmt.Errorf("can't set process label: %w", err)
52+
}
53+
--
54+
2.34.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From cc499086e2bbde59a349b52bdf7ce414b6fb3f0a Mon Sep 17 00:00:00 2001
2+
From: Alberto Mardegan <[email protected]>
3+
Date: Wed, 16 Jun 2021 15:04:16 +0300
4+
Subject: [PATCH] apparmor: change profile immediately, not on exec
5+
6+
---
7+
libcontainer/apparmor/apparmor_linux.go | 8 ++++----
8+
1 file changed, 4 insertions(+), 4 deletions(-)
9+
10+
diff --git a/libcontainer/apparmor/apparmor_linux.go b/libcontainer/apparmor/apparmor_linux.go
11+
index 8b1483c7..292cfa6d 100644
12+
--- a/libcontainer/apparmor/apparmor_linux.go
13+
+++ b/libcontainer/apparmor/apparmor_linux.go
14+
@@ -48,9 +48,9 @@ func setProcAttr(attr, value string) error {
15+
return err
16+
}
17+
18+
-// changeOnExec reimplements aa_change_onexec from libapparmor in Go
19+
-func changeOnExec(name string) error {
20+
- if err := setProcAttr("exec", "exec "+name); err != nil {
21+
+// changeProfile reimplements aa_change_profile from libapparmor in Go
22+
+func changeProfile(name string) error {
23+
+ if err := setProcAttr("current", "changeprofile "+name); err != nil {
24+
return fmt.Errorf("apparmor failed to apply profile: %w", err)
25+
}
26+
return nil
27+
@@ -64,5 +64,5 @@ func applyProfile(name string) error {
28+
return nil
29+
}
30+
31+
- return changeOnExec(name)
32+
+ return changeProfile(name)
33+
}
34+
--
35+
2.25.1
36+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
echo "v1.1.4"
3+
echo "v1.1.12"

0 commit comments

Comments
 (0)