Skip to content

Commit a411f98

Browse files
authored
Merge pull request #517 from bottlerocket-os/update_2026-08-04_6.12
kernel-6.12 : update to 6.12.95-124.187
2 parents 666bd36 + 983efb7 commit a411f98

5 files changed

Lines changed: 48 additions & 39 deletions

packages/kernel-6.12/1009-Revert-selinux-fix-overlayfs-mmap-and-mprotect-acces.patch

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
From 3caad90ec607313a1c05a6c33c0414094998ccdc Mon Sep 17 00:00:00 2001
1+
From fdae5c3fa77e6d74c112c3aa2804a2cd2decbe0a Mon Sep 17 00:00:00 2001
22
From: Piyush Jena <jepiyush@amazon.com>
33
Date: Mon, 13 Jul 2026 23:23:32 +0000
44
Subject: [PATCH] Revert "selinux: fix overlayfs mmap() and mprotect() access
55
checks"
66

77
This reverts commit 8bacd09f12c27710228562e4d13163e58c5f4a45.
88
---
9-
security/selinux/hooks.c | 242 ++++++++----------------------
9+
security/selinux/hooks.c | 248 ++++++++----------------------
1010
security/selinux/include/objsec.h | 11 --
11-
2 files changed, 64 insertions(+), 189 deletions(-)
11+
2 files changed, 64 insertions(+), 195 deletions(-)
1212

1313
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
14-
index 1b89c8d5f..8e31d3b60 100644
14+
index 23d680d..8e31d3b 100644
1515
--- a/security/selinux/hooks.c
1616
+++ b/security/selinux/hooks.c
1717
@@ -1724,72 +1724,49 @@ static inline int file_path_has_perm(const struct cred *cred,
@@ -92,11 +92,11 @@ index 1b89c8d5f..8e31d3b60 100644
9292
+ rc = 0;
9393
if (av)
9494
- return inode_has_perm(cred, inode, av, &ad);
95-
-
96-
- return 0;
97-
-}
9895
+ rc = inode_has_perm(cred, inode, av, &ad);
9996

97+
- return 0;
98+
-}
99+
-
100100
-/* Check whether a task can use an open file descriptor to
101101
- access an inode in a given way. Check access to the
102102
- descriptor itself, and then use dentry_has_perm to
@@ -132,13 +132,13 @@ index 1b89c8d5f..8e31d3b60 100644
132132
/*
133133
* Check whether a task has the ioctl permission and cmd
134134
* operation to an inode.
135-
@@ -3804,55 +3770,42 @@ static int selinux_file_ioctl_compat(struct file *file, unsigned int cmd,
135+
@@ -3804,57 +3770,42 @@ static int selinux_file_ioctl_compat(struct file *file, unsigned int cmd,
136136

137137
static int default_noexec __ro_after_init;
138138

139-
-static int __file_map_prot_check(const struct cred *cred,
140-
- const struct file *file, unsigned long prot,
141-
- bool shared, bool bf_user_file)
139+
-static int __file_map_prot_check(const struct file *file, unsigned long prot,
140+
- bool shared, bool mounter_check,
141+
- bool bf_user_file)
142142
+static int file_map_prot_check(struct file *file, unsigned long prot, int shared)
143143
{
144144
- struct inode *inode = NULL;
@@ -152,10 +152,10 @@ index 1b89c8d5f..8e31d3b60 100644
152152
- inode = file_inode(file);
153153
- }
154154
-
155-
- if (default_noexec && prot_exec &&
155+
- if (!mounter_check && default_noexec && prot_exec &&
156156
- (!file || IS_PRIVATE(inode) || (!shared && prot_write))) {
157157
- int rc;
158-
- u32 sid = cred_sid(cred);
158+
- u32 sid = current_sid();
159159
+ const struct cred *cred = current_cred();
160160
+ u32 sid = cred_sid(cred);
161161
+ int rc = 0;
@@ -180,6 +180,8 @@ index 1b89c8d5f..8e31d3b60 100644
180180
}
181181

182182
if (file) {
183+
- const struct cred *cred = mounter_check ?
184+
- file->f_cred : current_cred();
183185
- /* "read" always possible, "write" only if shared */
184186
+ /* read access is always possible with a mapping */
185187
u32 av = FILE__READ;
@@ -200,29 +202,31 @@ index 1b89c8d5f..8e31d3b60 100644
200202
- return 0;
201203
-}
202204
-
203-
-static inline int file_map_prot_check(const struct cred *cred,
204-
- const struct file *file,
205-
- unsigned long prot, bool shared)
205+
-static inline int file_map_prot_check(const struct file *file,
206+
- unsigned long prot, bool shared,
207+
- bool mounter_check)
206208
-{
207-
- return __file_map_prot_check(cred, file, prot, shared, false);
209+
- return __file_map_prot_check(file, prot, shared, mounter_check, false);
208210
+error:
209211
+ return rc;
210212
}
211213

212214
static int selinux_mmap_addr(unsigned long addr)
213-
@@ -3868,80 +3821,36 @@ static int selinux_mmap_addr(unsigned long addr)
215+
@@ -3870,84 +3821,36 @@ static int selinux_mmap_addr(unsigned long addr)
214216
return rc;
215217
}
216218

217-
-static int selinux_mmap_file_common(const struct cred *cred, struct file *file,
218-
- unsigned long prot, bool shared)
219+
-static int selinux_mmap_file_common(struct file *file, unsigned long prot,
220+
- bool shared, bool mounter_check)
219221
+static int selinux_mmap_file(struct file *file,
220222
+ unsigned long reqprot __always_unused,
221223
+ unsigned long prot, unsigned long flags)
222224
{
223225
- if (file) {
224226
- int rc;
225227
- struct common_audit_data ad;
228+
- const struct cred *cred = mounter_check ?
229+
- file->f_cred : current_cred();
226230
+ struct common_audit_data ad;
227231
+ int rc;
228232

@@ -236,15 +240,16 @@ index 1b89c8d5f..8e31d3b60 100644
236240
return rc;
237241
}
238242

239-
- return file_map_prot_check(cred, file, prot, shared);
243+
- return file_map_prot_check(file, prot, shared, mounter_check);
240244
-}
241245
-
242246
-static int selinux_mmap_file(struct file *file,
243247
- unsigned long reqprot __always_unused,
244248
- unsigned long prot, unsigned long flags)
245249
-{
246-
- return selinux_mmap_file_common(current_cred(), file, prot,
247-
- (flags & MAP_TYPE) == MAP_SHARED);
250+
- return selinux_mmap_file_common(file, prot,
251+
- (flags & MAP_TYPE) == MAP_SHARED,
252+
- false);
248253
-}
249254
-
250255
-/**
@@ -276,8 +281,9 @@ index 1b89c8d5f..8e31d3b60 100644
276281
- if (vma->vm_flags & VM_EXEC)
277282
- prot |= PROT_EXEC;
278283
-
279-
- return selinux_mmap_file_common(backing_file->f_cred, backing_file,
280-
- prot, vma->vm_flags & VM_SHARED);
284+
- return selinux_mmap_file_common(backing_file, prot,
285+
- vma->vm_flags & VM_SHARED,
286+
- true);
281287
+ return file_map_prot_check(file, prot,
282288
+ (flags & MAP_TYPE) == MAP_SHARED);
283289
}
@@ -302,7 +308,7 @@ index 1b89c8d5f..8e31d3b60 100644
302308
/*
303309
* We don't use the vma_is_initial_heap() helper as it has
304310
* a history of problems and is currently broken on systems
305-
@@ -3955,15 +3864,11 @@ static int selinux_file_mprotect(struct vm_area_struct *vma,
311+
@@ -3961,15 +3864,11 @@ static int selinux_file_mprotect(struct vm_area_struct *vma,
306312
vma->vm_end <= vma->vm_mm->brk) {
307313
rc = avc_has_perm(sid, sid, SECCLASS_PROCESS,
308314
PROCESS__EXECHEAP, NULL);
@@ -320,7 +326,7 @@ index 1b89c8d5f..8e31d3b60 100644
320326
/*
321327
* We are making executable a file mapping that has
322328
* had some COW done. Since pages might have been
323-
@@ -3971,29 +3876,13 @@ static int selinux_file_mprotect(struct vm_area_struct *vma,
329+
@@ -3977,29 +3876,13 @@ static int selinux_file_mprotect(struct vm_area_struct *vma,
324330
* modified content. This typically should only
325331
* occur for text relocations.
326332
*/
@@ -338,11 +344,11 @@ index 1b89c8d5f..8e31d3b60 100644
338344
}
339345
- }
340346
-
341-
- rc = __file_map_prot_check(cred, file, prot, shared, backing_file);
347+
- rc = __file_map_prot_check(file, prot, shared, false, backing_file);
342348
- if (rc)
343349
- return rc;
344350
- if (backing_file) {
345-
- rc = file_map_prot_check(file->f_cred, file, prot, shared);
351+
- rc = file_map_prot_check(file, prot, shared, true);
346352
if (rc)
347353
return rc;
348354
}
@@ -352,15 +358,15 @@ index 1b89c8d5f..8e31d3b60 100644
352358
}
353359

354360
static int selinux_file_lock(struct file *file, unsigned int cmd)
355-
@@ -7071,7 +6960,6 @@ static void selinux_bpf_token_free(struct bpf_token *token)
361+
@@ -7077,7 +6960,6 @@ static void selinux_bpf_token_free(struct bpf_token *token)
356362
struct lsm_blob_sizes selinux_blob_sizes __ro_after_init = {
357363
.lbs_cred = sizeof(struct task_security_struct),
358364
.lbs_file = sizeof(struct file_security_struct),
359365
- .lbs_backing_file = sizeof(struct backing_file_security_struct),
360366
.lbs_inode = sizeof(struct inode_security_struct),
361367
.lbs_ipc = sizeof(struct ipc_security_struct),
362368
.lbs_key = sizeof(struct key_security_struct),
363-
@@ -7277,11 +7165,9 @@ static struct security_hook_list selinux_hooks[] __ro_after_init = {
369+
@@ -7283,11 +7165,9 @@ static struct security_hook_list selinux_hooks[] __ro_after_init = {
364370

365371
LSM_HOOK_INIT(file_permission, selinux_file_permission),
366372
LSM_HOOK_INIT(file_alloc_security, selinux_file_alloc_security),
@@ -373,7 +379,7 @@ index 1b89c8d5f..8e31d3b60 100644
373379
LSM_HOOK_INIT(file_mprotect, selinux_file_mprotect),
374380
LSM_HOOK_INIT(file_lock, selinux_file_lock),
375381
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
376-
index dc42282a2..c88cae81e 100644
382+
index dc42282..c88cae8 100644
377383
--- a/security/selinux/include/objsec.h
378384
+++ b/security/selinux/include/objsec.h
379385
@@ -61,10 +61,6 @@ struct file_security_struct {
@@ -401,6 +407,6 @@ index dc42282a2..c88cae81e 100644
401407
static inline struct inode_security_struct *
402408
selinux_inode(const struct inode *inode)
403409
{
404-
--
410+
--
405411
2.53.0
406412

packages/kernel-6.12/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ path = "../packages.rs"
1313

1414
[[package.metadata.build-package.external-files]]
1515
# Use latest-kernel-srpm-url.sh to get this.
16-
url = "https://cdn.amazonlinux.com/al2023/blobstore/5f1a0fef7b8863f6e98bb5399868917d96115ee49e4feb5587b6450f7bffff84/kernel6.12-6.12.94-123.192.amzn2023.src.rpm"
17-
sha512 = "26df3a27888a2dfa84172d77bdf9c8315fd33a2392c53ffadb123449bdf0371731ecf123f904e9832e8c9a3f9fafd34d5d585d55ec9867bf87e31688d706bb10"
16+
url = "https://cdn.amazonlinux.com/al2023/blobstore/45af3375e37fd0b3b5e973eed92cf34c6c648b5aadad18efb6aac3f4f929c6ac/kernel6.12-6.12.95-124.187.amzn2023.src.rpm"
17+
sha512 = "0143ac5b52f35681295982b19e13b965d58e3ff6eea4b608d0a2b659bd3d1485970a25223e13b535837ec83f01ea0c7d4569d410664d19177da1f0aa045a8ae5"
1818
force-upstream = true
1919

2020
[[package.metadata.build-package.external-files]]

packages/kernel-6.12/config-full-bottlerocket-aarch64

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Automatically generated file; DO NOT EDIT.
3-
# Linux/arm64 6.12.94 Kernel Configuration
3+
# Linux/arm64 6.12.95 Kernel Configuration
44
#
55
CONFIG_CC_VERSION_TEXT="aarch64-bottlerocket-linux-gnu-gcc (Buildroot 2025.05.1) 13.4.0"
66
CONFIG_CC_IS_GCC=y
@@ -6241,6 +6241,8 @@ CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
62416241
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
62426242
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
62436243
CONFIG_HAVE_C_RECORDMCOUNT=y
6244+
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
6245+
CONFIG_BUILDTIME_MCOUNT_SORT=y
62446246
CONFIG_TRACER_MAX_TRACE=y
62456247
CONFIG_TRACE_CLOCK=y
62466248
CONFIG_RING_BUFFER=y
@@ -6291,6 +6293,7 @@ CONFIG_TRACE_EVAL_MAP_FILE=y
62916293
# CONFIG_FTRACE_RECORD_RECURSION is not set
62926294
# CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING is not set
62936295
# CONFIG_FTRACE_STARTUP_TEST is not set
6296+
# CONFIG_FTRACE_SORT_STARTUP_TEST is not set
62946297
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
62956298
# CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set
62966299
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set

packages/kernel-6.12/config-full-bottlerocket-x86_64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Automatically generated file; DO NOT EDIT.
3-
# Linux/x86 6.12.94 Kernel Configuration
3+
# Linux/x86 6.12.95 Kernel Configuration
44
#
55
CONFIG_CC_VERSION_TEXT="x86_64-bottlerocket-linux-gnu-gcc (Buildroot 2025.05.1) 13.4.0"
66
CONFIG_CC_IS_GCC=y

packages/kernel-6.12/kernel-6.12.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
%global neuron_inf1_ver 2.24.13
77

88
Name: %{_cross_os}kernel-%{kmajor}
9-
Version: 6.12.94
9+
Version: 6.12.95
1010
Release: 1%{?dist}
1111
Summary: The Linux kernel
1212
License: GPL-2.0 WITH Linux-syscall-note
1313
URL: https://www.kernel.org/
1414
# Use latest-kernel-srpm-url.sh to get this.
15-
Source0: https://cdn.amazonlinux.com/al2023/blobstore/5f1a0fef7b8863f6e98bb5399868917d96115ee49e4feb5587b6450f7bffff84/kernel6.12-6.12.94-123.192.amzn2023.src.rpm
15+
Source0: https://cdn.amazonlinux.com/al2023/blobstore/45af3375e37fd0b3b5e973eed92cf34c6c648b5aadad18efb6aac3f4f929c6ac/kernel6.12-6.12.95-124.187.amzn2023.src.rpm
1616
Source1: gpgkey-B21C50FA44A99720EAA72F7FE951904AD832C631.asc
1717

1818
# Custom Bottlerocket kernel configurations.

0 commit comments

Comments
 (0)