From 8fab6386c1a14695ff22d7ad4991798475fc50e9 Mon Sep 17 00:00:00 2001 From: "bottlerocket-kernels[bot]" <190893109+bottlerocket-kernels[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 20:11:31 +0000 Subject: [PATCH] kernel-6.18: update to 6.18.54 Rebase to Amazon Linux upstream version 6.18.54-121.166.amzn2023. Signed-off-by: bottlerocket-kernels[bot] <190893109+bottlerocket-kernels[bot]@users.noreply.github.com> --- ...ix-overlayfs-mmap-and-mprotect-acces.patch | 240 +++++++++++++++--- ...le-LZ4-rolling-decompression-for-now.patch | 174 +------------ ...rgs-total-for-parent-pointer-updates.patch | 94 ------- packages/kernel-6.18/Cargo.toml | 4 +- ...onfig-full-bottlerocket-aarch64-on-aarch64 | 3 +- ...config-full-bottlerocket-aarch64-on-x86_64 | 3 +- ...config-full-bottlerocket-x86_64-on-aarch64 | 6 +- .../config-full-bottlerocket-x86_64-on-x86_64 | 6 +- packages/kernel-6.18/kernel-6.18.spec | 6 +- 9 files changed, 235 insertions(+), 301 deletions(-) delete mode 100644 packages/kernel-6.18/1008-xfs-initialise-args-total-for-parent-pointer-updates.patch diff --git a/packages/kernel-6.18/1006-Revert-selinux-fix-overlayfs-mmap-and-mprotect-acces.patch b/packages/kernel-6.18/1006-Revert-selinux-fix-overlayfs-mmap-and-mprotect-acces.patch index 869a7ec2..243e77f1 100644 --- a/packages/kernel-6.18/1006-Revert-selinux-fix-overlayfs-mmap-and-mprotect-acces.patch +++ b/packages/kernel-6.18/1006-Revert-selinux-fix-overlayfs-mmap-and-mprotect-acces.patch @@ -5,16 +5,65 @@ Subject: [PATCH] Revert "selinux: fix overlayfs mmap() and mprotect() access checks" This reverts commit d844702198395d3f80222777030f69db6be6b709. + +[vyaghras: +Ported to work with the changes introduced in +d127c7e1f3e1231d8ac8b2738e3f00bea12afe74 and +9d99b770e7b67b00bdef9005b928aad13e1d679b. +] +Signed-off-by: Shikha vyaghra --- - security/selinux/hooks.c | 248 ++++++++---------------------- - security/selinux/include/objsec.h | 11 -- - 2 files changed, 64 insertions(+), 195 deletions(-) + security/selinux/hooks.c | 388 ++++++------------------------ + security/selinux/include/objsec.h | 19 -- + 2 files changed, 76 insertions(+), 331 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c -index af188e19c130..5efd444674ef 100644 +index eef75bde6..5efd44467 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c -@@ -1739,72 +1739,49 @@ static inline int file_path_has_perm(const struct cred *cred, +@@ -1665,32 +1665,26 @@ static int cred_has_capability(const struct cred *cred, + return rc; + } + +-/* +- * Check whether a SID has a particular permission to an inode. The 'adp' +- * parameter is optional and allows other audit data to be passed (e.g. the +- * dentry). +- */ +-static int inode_sid_has_perm(u32 sid, struct inode *inode, u32 perms, +- struct common_audit_data *adp) ++/* Check whether a task has a particular permission to an inode. ++ The 'adp' parameter is optional and allows other audit ++ data to be passed (e.g. the dentry). */ ++static int inode_has_perm(const struct cred *cred, ++ struct inode *inode, ++ u32 perms, ++ struct common_audit_data *adp) + { + struct inode_security_struct *isec; ++ u32 sid; + + if (unlikely(IS_PRIVATE(inode))) + return 0; + ++ sid = cred_sid(cred); + isec = selinux_inode(inode); + + return avc_has_perm(sid, isec->sid, isec->sclass, perms, adp); + } + +-static int inode_has_perm(const struct cred *cred, +- struct inode *inode, +- u32 perms, +- struct common_audit_data *adp) +-{ +- return inode_sid_has_perm(cred_sid(cred), inode, perms, adp); +-} +- + /* Same as inode_has_perm, but pass explicit audit data containing + the dentry to help the auditing code to more easily generate the + pathname if needed. */ +@@ -1745,72 +1739,49 @@ static inline int file_path_has_perm(const struct cred *cred, static int bpf_fd_pass(const struct file *file, u32 sid); #endif @@ -92,11 +141,11 @@ index af188e19c130..5efd444674ef 100644 + rc = 0; if (av) - return inode_has_perm(cred, inode, av, &ad); -+ rc = inode_has_perm(cred, inode, av, &ad); - +- - return 0; -} -- ++ rc = inode_has_perm(cred, inode, av, &ad); + -/* Check whether a task can use an open file descriptor to - access an inode in a given way. Check access to the - descriptor itself, and then use dentry_has_perm to @@ -114,28 +163,132 @@ index af188e19c130..5efd444674ef 100644 } /* -@@ -3822,17 +3799,6 @@ static int selinux_file_alloc_security(struct file *file) +@@ -3828,74 +3799,6 @@ static int selinux_file_alloc_security(struct file *file) return 0; } +-static inline u32 selinux_file_user_sid(const struct file *file) +-{ +- if (unlikely(file->f_mode & FMODE_BACKING)) +- return selinux_backing_file(file)->uf_sid; +- return selinux_file(file)->sid; +-} +- -static int selinux_backing_file_alloc(struct file *backing_file, - const struct file *user_file) -{ - struct backing_file_security_struct *bfsec; +- const struct backing_file_security_struct *ubfsec; +- struct backing_file_security_layer *layer; +- u32 i; - - bfsec = selinux_backing_file(backing_file); -- bfsec->uf_sid = selinux_file(user_file)->sid; +- bfsec->uf_sid = selinux_file_user_sid(user_file); +- if (!(user_file->f_mode & FMODE_BACKING)) +- return 0; +- +- ubfsec = selinux_backing_file(user_file); +- /* a wrapped count would make kmalloc_array() return ZERO_SIZE_PTR */ +- if (unlikely(ubfsec->layer_count == U32_MAX)) +- return -EOVERFLOW; +- +- /* +- * The final VMA only retains the lowest backing file, so record the +- * whole chain here rather than in the mmap hook, where concurrent +- * mappings would have to be serialized. Size it dynamically: erofs +- * inode sharing adds a backing file without bumping s_stack_depth. +- */ +- bfsec->layers = kmalloc_array(ubfsec->layer_count + 1, +- sizeof(*bfsec->layers), GFP_KERNEL); +- if (!bfsec->layers) +- return -ENOMEM; +- +- for (i = 0; i < ubfsec->layer_count; i++) { +- layer = &bfsec->layers[i]; +- *layer = ubfsec->layers[i]; +- path_get(&layer->path); +- } +- +- /* f_path, not file_user_path(): this layer, not the top-level file */ +- layer = &bfsec->layers[i]; +- layer->path = user_file->f_path; +- layer->mounter_sid = cred_sid(user_file->f_cred); +- layer->fd_sid = selinux_file(user_file)->sid; +- path_get(&layer->path); +- bfsec->layer_count = ubfsec->layer_count + 1; - - return 0; -} +- +-static void selinux_backing_file_free(struct file *backing_file) +-{ +- struct backing_file_security_struct *bfsec; +- +- /* security_backing_file_free() may be called twice after an error */ +- if (!backing_file_security(backing_file)) +- return; +- +- bfsec = selinux_backing_file(backing_file); +- while (bfsec->layer_count) +- path_put(&bfsec->layers[--bfsec->layer_count].path); +- kfree(bfsec->layers); +- bfsec->layers = NULL; +-} - /* * Check whether a task has the ioctl permission and cmd * operation to an inode. -@@ -3950,57 +3916,42 @@ static int selinux_file_ioctl_compat(struct file *file, unsigned int cmd, +@@ -4013,100 +3916,42 @@ static int selinux_file_ioctl_compat(struct file *file, unsigned int cmd, static int default_noexec __ro_after_init; +-static u32 file_map_prot_to_av(unsigned long prot, bool shared) +-{ +- u32 av = FILE__READ; +- +- if (shared && (prot & PROT_WRITE)) +- av |= FILE__WRITE; +- if (prot & PROT_EXEC) +- av |= FILE__EXECUTE; +- +- return av; +-} +- +-static int backing_mounters_has_perm(const struct file *file, u32 av) +-{ +- const struct backing_file_security_struct *bfsec; +- const struct backing_file_security_layer *layer; +- struct common_audit_data ad; +- struct inode *inode; +- u32 i; +- int rc; +- +- if (WARN_ON_ONCE(!(file->f_mode & FMODE_BACKING))) +- return -EIO; +- +- bfsec = selinux_backing_file(file); +- for (i = 0; i < bfsec->layer_count; i++) { +- layer = &bfsec->layers[i]; +- inode = d_inode(layer->path.dentry); +- +- ad.type = LSM_AUDIT_DATA_PATH; +- ad.u.path = layer->path; +- +- if (layer->mounter_sid != layer->fd_sid) { +- rc = avc_has_perm(layer->mounter_sid, layer->fd_sid, +- SECCLASS_FD, FD__USE, &ad); +- if (rc) +- return rc; +- } +- +- rc = inode_sid_has_perm(layer->mounter_sid, inode, av, &ad); +- if (rc) +- return rc; +- } +- +- return 0; +-} +- -static int __file_map_prot_check(const struct file *file, unsigned long prot, - bool shared, bool mounter_check, - bool bf_user_file) @@ -182,37 +335,36 @@ index af188e19c130..5efd444674ef 100644 if (file) { - const struct cred *cred = mounter_check ? - file->f_cred : current_cred(); -- /* "read" always possible, "write" only if shared */ + /* read access is always possible with a mapping */ - u32 av = FILE__READ; -- if (shared && prot_write) -+ ++ u32 av = FILE__READ; + +- return __file_has_perm(cred, file, +- file_map_prot_to_av(prot, shared), +- bf_user_file); +- } + /* write access only matters if the mapping is shared */ + if (shared && (prot & PROT_WRITE)) - av |= FILE__WRITE; -- if (prot_exec) -+ -+ if (prot & PROT_EXEC) - av |= FILE__EXECUTE; - -- return __file_has_perm(cred, file, av, bf_user_file); -+ return file_has_perm(cred, file, av); - } ++ av |= FILE__WRITE; - return 0; -} -- ++ if (prot & PROT_EXEC) ++ av |= FILE__EXECUTE; + -static inline int file_map_prot_check(const struct file *file, - unsigned long prot, bool shared, - bool mounter_check) -{ - return __file_map_prot_check(file, prot, shared, mounter_check, false); ++ return file_has_perm(cred, file, av); ++ } ++ +error: + return rc; } static int selinux_mmap_addr(unsigned long addr) -@@ -4016,84 +3967,36 @@ static int selinux_mmap_addr(unsigned long addr) +@@ -4122,85 +3967,36 @@ static int selinux_mmap_addr(unsigned long addr) return rc; } @@ -295,6 +447,7 @@ index af188e19c130..5efd444674ef 100644 - int rc; const struct cred *cred = current_cred(); u32 sid = cred_sid(cred); +- u32 av; - const struct file *file = vma->vm_file; - bool backing_file; - bool shared = vma->vm_flags & VM_SHARED; @@ -308,7 +461,7 @@ index af188e19c130..5efd444674ef 100644 /* * We don't use the vma_is_initial_heap() helper as it has * a history of problems and is currently broken on systems -@@ -4107,15 +4010,11 @@ static int selinux_file_mprotect(struct vm_area_struct *vma, +@@ -4214,15 +4010,11 @@ static int selinux_file_mprotect(struct vm_area_struct *vma, vma->vm_end <= vma->vm_mm->brk) { rc = avc_has_perm(sid, sid, SECCLASS_PROCESS, PROCESS__EXECHEAP, NULL); @@ -326,7 +479,7 @@ index af188e19c130..5efd444674ef 100644 /* * We are making executable a file mapping that has * had some COW done. Since pages might have been -@@ -4123,29 +4022,13 @@ static int selinux_file_mprotect(struct vm_area_struct *vma, +@@ -4230,37 +4022,13 @@ static int selinux_file_mprotect(struct vm_area_struct *vma, * modified content. This typically should only * occur for text relocations. */ @@ -335,6 +488,10 @@ index af188e19c130..5efd444674ef 100644 - if (rc) - return rc; - if (backing_file) { +- rc = backing_mounters_has_perm(file, +- FILE__EXECMOD); +- if (rc) +- return rc; - rc = file_has_perm(file->f_cred, file, - FILE__EXECMOD); - if (rc) @@ -348,6 +505,10 @@ index af188e19c130..5efd444674ef 100644 - if (rc) - return rc; - if (backing_file) { +- av = file_map_prot_to_av(prot, shared); +- rc = backing_mounters_has_perm(file, av); +- if (rc) +- return rc; - rc = file_map_prot_check(file, prot, shared, true); if (rc) return rc; @@ -358,7 +519,7 @@ index af188e19c130..5efd444674ef 100644 } static int selinux_file_lock(struct file *file, unsigned int cmd) -@@ -7275,7 +7158,6 @@ struct lsm_blob_sizes selinux_blob_sizes __ro_after_init = { +@@ -7390,7 +7158,6 @@ struct lsm_blob_sizes selinux_blob_sizes __ro_after_init = { .lbs_cred = sizeof(struct cred_security_struct), .lbs_task = sizeof(struct task_security_struct), .lbs_file = sizeof(struct file_security_struct), @@ -366,11 +527,12 @@ index af188e19c130..5efd444674ef 100644 .lbs_inode = sizeof(struct inode_security_struct), .lbs_ipc = sizeof(struct ipc_security_struct), .lbs_key = sizeof(struct key_security_struct), -@@ -7499,11 +7381,9 @@ static struct security_hook_list selinux_hooks[] __ro_after_init = { +@@ -7614,12 +7381,9 @@ static struct security_hook_list selinux_hooks[] __ro_after_init = { LSM_HOOK_INIT(file_permission, selinux_file_permission), LSM_HOOK_INIT(file_alloc_security, selinux_file_alloc_security), - LSM_HOOK_INIT(backing_file_alloc, selinux_backing_file_alloc), +- LSM_HOOK_INIT(backing_file_free, selinux_backing_file_free), LSM_HOOK_INIT(file_ioctl, selinux_file_ioctl), LSM_HOOK_INIT(file_ioctl_compat, selinux_file_ioctl_compat), LSM_HOOK_INIT(mmap_file, selinux_mmap_file), @@ -379,21 +541,29 @@ index af188e19c130..5efd444674ef 100644 LSM_HOOK_INIT(file_mprotect, selinux_file_mprotect), LSM_HOOK_INIT(file_lock, selinux_file_lock), diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h -index fcb46793898f..816fde5a5896 100644 +index bbb04f26b..816fde5a5 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h -@@ -86,10 +86,6 @@ struct file_security_struct { +@@ -86,18 +86,6 @@ struct file_security_struct { u32 pseqno; /* Policy seqno at the time of file open */ }; +-struct backing_file_security_layer { +- struct path path; /* this layer's real path */ +- u32 mounter_sid; /* SID of the mounter that opened it */ +- u32 fd_sid; /* SID of its open file description */ +-}; +- -struct backing_file_security_struct { -- u32 uf_sid; /* associated user file fsec->sid */ +- u32 uf_sid; /* top-level user file fsec->sid */ +- u32 layer_count; /* number of intermediate backing files */ +- struct backing_file_security_layer *layers; -}; - struct superblock_security_struct { u32 sid; /* SID of file system superblock */ u32 def_sid; /* default SID for labeling */ -@@ -194,13 +190,6 @@ static inline struct file_security_struct *selinux_file(const struct file *file) +@@ -202,13 +190,6 @@ static inline struct file_security_struct *selinux_file(const struct file *file) return file->f_security + selinux_blob_sizes.lbs_file; } @@ -408,5 +578,5 @@ index fcb46793898f..816fde5a5896 100644 selinux_inode(const struct inode *inode) { -- -2.47.0 +2.50.1 diff --git a/packages/kernel-6.18/1007-erofs-disable-LZ4-rolling-decompression-for-now.patch b/packages/kernel-6.18/1007-erofs-disable-LZ4-rolling-decompression-for-now.patch index 3d784139..5ee66ded 100644 --- a/packages/kernel-6.18/1007-erofs-disable-LZ4-rolling-decompression-for-now.patch +++ b/packages/kernel-6.18/1007-erofs-disable-LZ4-rolling-decompression-for-now.patch @@ -54,17 +54,17 @@ Signed-off-by: Gao Xiang [doebel: Adjust to 6.18 contextual changes] Signed-off-by: Bjoern Doebel +[vyaghras: +Ported to work with the changes introduced in +82e664cf1219c459c33aae931b222cf951af9cb7. +] +Signed-off-by: Shikha vyaghra + diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c +index 48a0c84ce..ce7813f06 100644 --- a/fs/erofs/decompressor.c +++ b/fs/erofs/decompressor.c -@@ -7,22 +7,17 @@ - #include "compress.h" - #include - --#define LZ4_MAX_DISTANCE_PAGES (DIV_ROUND_UP(LZ4_DISTANCE_MAX, PAGE_SIZE) + 1) -- - static int z_erofs_load_lz4_config(struct super_block *sb, - struct erofs_super_block *dsb, void *data, int size) +@@ -12,7 +12,6 @@ static int z_erofs_load_lz4_config(struct super_block *sb, { struct erofs_sb_info *sbi = EROFS_SB(sb); struct z_erofs_lz4_cfgs *lz4 = data; @@ -72,164 +72,14 @@ diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c if (lz4) { if (size < sizeof(struct z_erofs_lz4_cfgs)) { - erofs_err(sb, "invalid lz4 cfgs, size=%u", size); - return -EINVAL; - } -- distance = le16_to_cpu(lz4->max_distance); -- - sbi->lz4.max_pclusterblks = le16_to_cpu(lz4->max_pclusterblks); - if (!sbi->lz4.max_pclusterblks) { - sbi->lz4.max_pclusterblks = 1; /* reserved case */ -@@ -33,48 +28,28 @@ static int z_erofs_load_lz4_config(struct super_block *sb, +@@ -29,7 +28,6 @@ static int z_erofs_load_lz4_config(struct super_block *sb, return -EINVAL; } } else { - distance = le16_to_cpu(dsb->u1.lz4_max_distance); sbi->lz4.max_pclusterblks = 1; } - -- sbi->lz4.max_distance_pages = distance ? -- DIV_ROUND_UP(distance, PAGE_SIZE) + 1 : -- LZ4_MAX_DISTANCE_PAGES; return z_erofs_gbuf_growsize(sbi->lz4.max_pclusterblks); - } - - /* -- * Fill all gaps with bounce pages if it's a sparse page list. Also check if -- * all physical pages are consecutive, which can be seen for moderate CR. -+ * Fill all gaps with bounce pages if it's a sparse page list (for example some -+ * folios are already uptodate and thus can be mapped into userspace). Also -+ * check if pages are physically consecutive, which can be seen for moderate CR. - */ --static int z_erofs_lz4_prepare_dstpages(struct z_erofs_decompress_req *rq, -- struct page **pagepool) -+static int z_erofs_oneshot_prepare_dstpages(struct z_erofs_decompress_req *rq, -+ struct page **pagepool) - { -- struct page *availables[LZ4_MAX_DISTANCE_PAGES] = { NULL }; -- unsigned long bounced[DIV_ROUND_UP(LZ4_MAX_DISTANCE_PAGES, -- BITS_PER_LONG)] = { 0 }; -- unsigned int lz4_max_distance_pages = -- EROFS_SB(rq->sb)->lz4.max_distance_pages; - void *kaddr = NULL; -- unsigned int i, j, top; -- -- top = 0; -- for (i = j = 0; i < rq->outpages; ++i, ++j) { -- struct page *const page = rq->out[i]; -- struct page *victim; -+ unsigned int i; - -- if (j >= lz4_max_distance_pages) -- j = 0; -- -- /* 'valid' bounced can only be tested after a complete round */ -- if (!rq->fillgaps && test_bit(j, bounced)) { -- DBG_BUGON(i < lz4_max_distance_pages); -- DBG_BUGON(top >= lz4_max_distance_pages); -- availables[top++] = rq->out[i - lz4_max_distance_pages]; -- } -+ for (i = 0; i < rq->outpages; ++i) { -+ struct page *page, *victim; - -+ page = rq->out[i]; - if (page) { -- __clear_bit(j, bounced); - if (!PageHighMem(page)) { - if (!i) { - kaddr = page_address(page); -@@ -86,21 +61,14 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_decompress_req *rq, - continue; - } - } -- kaddr = NULL; -- continue; -- } -- kaddr = NULL; -- __set_bit(j, bounced); -- -- if (top) { -- victim = availables[--top]; - } else { - victim = __erofs_allocpage(pagepool, rq->gfp, true); - if (!victim) - return -ENOMEM; - set_page_private(victim, Z_EROFS_SHORTLIVED_PAGE); -+ rq->out[i] = victim; - } -- rq->out[i] = victim; -+ kaddr = NULL; - } - return kaddr ? 1 : 0; - } -@@ -272,7 +240,7 @@ static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq, - dst_maptype = 0; - } else { - /* general decoding path which can be used for all cases */ -- ret = z_erofs_lz4_prepare_dstpages(rq, pagepool); -+ ret = z_erofs_oneshot_prepare_dstpages(rq, pagepool); - if (ret < 0) - return ret; - if (ret > 0) { -diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h ---- a/fs/erofs/internal.h -+++ b/fs/erofs/internal.h -@@ -70,12 +70,8 @@ struct erofs_dev_context { - bool flatdev; - }; - --/* all filesystem-wide lz4 configurations */ - struct erofs_sb_lz4_info { -- /* # of pages needed for EROFS lz4 rolling decompression */ -- u16 max_distance_pages; -- /* maximum possible blocks for pclusters in the filesystem */ -- u16 max_pclusterblks; -+ u16 max_pclusterblks; /* maximum physical blocks for LZ4 pclusters */ - }; - - struct erofs_domain { -diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c ---- a/fs/erofs/zdata.c -+++ b/fs/erofs/zdata.c -@@ -1258,7 +1258,7 @@ static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, bool eio) - const struct z_erofs_decompressor *decomp = - z_erofs_decomp[pcl->algorithmformat]; - bool try_free = true; -- int i, j, jtop, err2, err = eio ? -EIO : 0; -+ int i, err2, err = eio ? -EIO : 0; - struct page *page; - bool overlapped; - -@@ -1333,7 +1333,6 @@ static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, bool eio) - be->compressed_pages >= be->onstack_pages + Z_EROFS_ONSTACK_PAGES) - kvfree(be->compressed_pages); - -- jtop = 0; - z_erofs_fill_other_copies(be, err); - for (i = 0; i < be->nr_pages; ++i) { - page = be->decompressed_pages[i]; -@@ -1341,22 +1340,11 @@ static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, bool eio) - continue; - - DBG_BUGON(z_erofs_page_is_invalidated(page)); -- if (!z_erofs_is_shortlived_page(page)) { -+ if (!z_erofs_is_shortlived_page(page)) - erofs_onlinefolio_end(page_folio(page), err, true); -- continue; -- } -- if (pcl->algorithmformat != Z_EROFS_COMPRESSION_LZ4) { -+ else - erofs_pagepool_add(be->pagepool, page); -- continue; -- } -- for (j = 0; j < jtop && be->decompressed_pages[j] != page; ++j) -- ; -- if (j >= jtop) /* this bounce page is newly detected */ -- be->decompressed_pages[jtop++] = page; - } -- while (jtop) -- erofs_pagepool_add(be->pagepool, -- be->decompressed_pages[--jtop]); - if (be->decompressed_pages != be->onstack_pages) - kvfree(be->decompressed_pages); - +-- +2.50.1 + diff --git a/packages/kernel-6.18/1008-xfs-initialise-args-total-for-parent-pointer-updates.patch b/packages/kernel-6.18/1008-xfs-initialise-args-total-for-parent-pointer-updates.patch deleted file mode 100644 index 481fce69..00000000 --- a/packages/kernel-6.18/1008-xfs-initialise-args-total-for-parent-pointer-updates.patch +++ /dev/null @@ -1,94 +0,0 @@ -From c66e138af626cad4210da449996ae9e07ee63add Mon Sep 17 00:00:00 2001 -From: Javier Tia -Date: Mon, 10 Aug 2026 17:06:17 -0600 -Subject: xfs: initialise args->total for parent pointer updates - -commit 8e4ebb6afaa34bd2e8ce52da231003d24111c2d6 upstream. - -xfs_parent_da_args_init() builds an xfs_da_args from a zeroed -xfs_parent_args (kmem_cache_zalloc), leaving args->total == 0. -xfs_da_grow_inode_int() treats that field as a running block reservation -and subtracts from it; because it is an xfs_extlen_t (uint32_t), the -first attr-fork growth wraps it to ~0U. That defeats the free-space -check in xfs_alloc_space_available(), and when it coincides with an AG -that has exactly zero available blocks the allocation is clamped to -maxlen 0 and returns -ENOSPC, which xfs_defer_finish_noroll() escalates -to a filesystem shutdown. - -Set args->total the way the log recovery path does -(xfs_attri_recover_work(), xfs_attr_item.c:706), in the add and replace -paths that can grow the fork. Removals and lookups never grow it, so -they leave the field alone, matching that switch. - -Fixes: b7c62d90c12c ("xfs: parent pointer attribute creation") -Cc: stable@vger.kernel.org # v6.10 -Signed-off-by: Javier Tia -Reviewed-by: Darrick J. Wong -Signed-off-by: Carlos Maiolino -[ Backported to 6.12.y and 6.18.y, whose fs/xfs/libxfs/xfs_parent.c are - byte-identical. These trees queue the operation with - xfs_attr_defer_add() instead of calling xfs_attr_setname() and - xfs_attr_replacename() directly, and spell the inode number - child->i_ino rather than I_INO(child), so the upstream hunks do not - apply as-is. The defect is unchanged: xfs_attr_defer_add() stores a - pointer to this same xfs_da_args, and xfs_attr_finish_item() resets - only args->trans, so the zeroed total still reaches - xfs_da_grow_inode_int(). The assignment therefore goes in the same - place, before the operation is queued. xfs_attr_calc_size() needs no - new include: it is declared in xfs_attr.h, which xfs_parent.c already - includes. ] -Signed-off-by: Javier Tia -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Craig Qian ---- - fs/xfs/libxfs/xfs_parent.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/fs/xfs/libxfs/xfs_parent.c b/fs/xfs/libxfs/xfs_parent.c -index 69366c44a7015..f47dda640c0ef 100644 ---- a/fs/xfs/libxfs/xfs_parent.c -+++ b/fs/xfs/libxfs/xfs_parent.c -@@ -193,7 +193,7 @@ xfs_parent_addname( - const struct xfs_name *parent_name, - struct xfs_inode *child) - { -- int error; -+ int error, local; - - error = xfs_parent_iread_extents(tp, child); - if (error) -@@ -202,6 +202,11 @@ xfs_parent_addname( - xfs_inode_to_parent_rec(&ppargs->rec, dp); - xfs_parent_da_args_init(&ppargs->args, tp, &ppargs->rec, child, - child->i_ino, parent_name); -+ -+ /* Growing the attr fork needs a real reservation in args->total. */ -+ ppargs->args.total = xfs_attr_calc_size(&ppargs->args, &local); -+ ASSERT(local); -+ - xfs_attr_defer_add(&ppargs->args, XFS_ATTR_DEFER_SET); - return 0; - } -@@ -239,7 +244,7 @@ xfs_parent_replacename( - const struct xfs_name *new_name, - struct xfs_inode *child) - { -- int error; -+ int error, local; - - error = xfs_parent_iread_extents(tp, child); - if (error) -@@ -249,6 +254,10 @@ xfs_parent_replacename( - xfs_parent_da_args_init(&ppargs->args, tp, &ppargs->rec, child, - child->i_ino, old_name); - -+ /* Growing the attr fork needs a real reservation in args->total. */ -+ ppargs->args.total = xfs_attr_calc_size(&ppargs->args, &local); -+ ASSERT(local); -+ - xfs_inode_to_parent_rec(&ppargs->new_rec, new_dp); - ppargs->args.new_name = new_name->name; - ppargs->args.new_namelen = new_name->len; --- -cgit 1.3.1-korg - diff --git a/packages/kernel-6.18/Cargo.toml b/packages/kernel-6.18/Cargo.toml index b80fd44f..b9848c97 100644 --- a/packages/kernel-6.18/Cargo.toml +++ b/packages/kernel-6.18/Cargo.toml @@ -13,8 +13,8 @@ path = "../packages.rs" [[package.metadata.build-package.external-files]] # Use latest-kernel-srpm-url.sh to get this. -url = "https://cdn.amazonlinux.com/al2023/blobstore/39f4c2db4f790d9f1525e77e5597d80d8080f9c1db893482267c7b7d4321f2b0/kernel6.18-6.18.51-120.163.amzn2023.src.rpm" -sha512 = "df697e7f7b6864ae29de52d2d6c42b39aa5b978ee5853c4248a22452585c954772dc576a494c167338fa0ba3a197808f100ba8b60a8ffa3e3a2627c8c205a04e" +url = "https://cdn.amazonlinux.com/al2023/blobstore/29d88d37fe6de08d78ff9e57ddbe05c439a3b25ea7e9414dd65ffc3b7f435d0d/kernel6.18-6.18.54-121.166.amzn2023.src.rpm" +sha512 = "af287f27a257df40fc3a12e1df70375b9d45aa9569491449a24917faf083bcfb3ac8baf280f98aeb82803989682b76ebb8919829b5bdab39a189c63c97443f6b" force-upstream = true diff --git a/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-aarch64 b/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-aarch64 index 8b75bcf0..37110317 100644 --- a/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-aarch64 +++ b/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-aarch64 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 6.18.51 Kernel Configuration +# Linux/arm64 6.18.54 Kernel Configuration # CONFIG_CC_VERSION_TEXT="aarch64-bottlerocket-linux-gnu-gcc (Buildroot 2025.05.1) 13.4.0" CONFIG_CC_IS_GCC=y @@ -901,6 +901,7 @@ CONFIG_GCC_PLUGINS=y CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FUNCTION_ALIGNMENT_8B=y CONFIG_FUNCTION_ALIGNMENT=8 +CONFIG_HAVE_ARCH_GET_SECUREBOOT=y # end of General architecture-dependent options CONFIG_RT_MUTEXES=y diff --git a/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-x86_64 b/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-x86_64 index 8b75bcf0..37110317 100644 --- a/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-x86_64 +++ b/packages/kernel-6.18/config-full-bottlerocket-aarch64-on-x86_64 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 6.18.51 Kernel Configuration +# Linux/arm64 6.18.54 Kernel Configuration # CONFIG_CC_VERSION_TEXT="aarch64-bottlerocket-linux-gnu-gcc (Buildroot 2025.05.1) 13.4.0" CONFIG_CC_IS_GCC=y @@ -901,6 +901,7 @@ CONFIG_GCC_PLUGINS=y CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FUNCTION_ALIGNMENT_8B=y CONFIG_FUNCTION_ALIGNMENT=8 +CONFIG_HAVE_ARCH_GET_SECUREBOOT=y # end of General architecture-dependent options CONFIG_RT_MUTEXES=y diff --git a/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-aarch64 b/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-aarch64 index 2426e3a7..f49ebae1 100644 --- a/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-aarch64 +++ b/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-aarch64 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 6.18.51 Kernel Configuration +# Linux/x86 6.18.54 Kernel Configuration # CONFIG_CC_VERSION_TEXT="x86_64-bottlerocket-linux-gnu-gcc (Buildroot 2025.05.1) 13.4.0" CONFIG_CC_IS_GCC=y @@ -406,6 +406,7 @@ CONFIG_PARAVIRT_CLOCK=y # CONFIG_ACRN_GUEST is not set # CONFIG_BHYVE_GUEST is not set # CONFIG_INTEL_TDX_GUEST is not set +CONFIG_RUSTC_HAS_APXF=y CONFIG_X86_INTERNODE_CACHE_SHIFT=6 CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_X86_TSC=y @@ -624,6 +625,7 @@ CONFIG_ACPI_IPMI=m CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_PLATFORM_PROFILE=y CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ACPI_TABLE_UPGRADE=y # CONFIG_ACPI_DEBUG is not set @@ -684,6 +686,7 @@ CONFIG_X86_INTEL_PSTATE=y CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_AMD_PSTATE=y CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3 +# CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP is not set # CONFIG_X86_AMD_PSTATE_UT is not set CONFIG_X86_ACPI_CPUFREQ=m # CONFIG_X86_ACPI_CPUFREQ_CPB is not set @@ -987,6 +990,7 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FUNCTION_ALIGNMENT_16B=y CONFIG_FUNCTION_ALIGNMENT=16 CONFIG_ARCH_HAS_CPU_ATTACK_VECTORS=y +CONFIG_HAVE_ARCH_GET_SECUREBOOT=y # end of General architecture-dependent options CONFIG_RT_MUTEXES=y diff --git a/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-x86_64 b/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-x86_64 index 1423f5cb..4be4fcad 100644 --- a/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-x86_64 +++ b/packages/kernel-6.18/config-full-bottlerocket-x86_64-on-x86_64 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 6.18.51 Kernel Configuration +# Linux/x86 6.18.54 Kernel Configuration # CONFIG_CC_VERSION_TEXT="x86_64-bottlerocket-linux-gnu-gcc (Buildroot 2025.05.1) 13.4.0" CONFIG_CC_IS_GCC=y @@ -407,6 +407,7 @@ CONFIG_PARAVIRT_CLOCK=y # CONFIG_BHYVE_GUEST is not set # CONFIG_INTEL_TDX_GUEST is not set CONFIG_CC_HAS_MARCH_NATIVE=y +CONFIG_RUSTC_HAS_APXF=y # CONFIG_X86_NATIVE_CPU is not set CONFIG_X86_INTERNODE_CACHE_SHIFT=6 CONFIG_X86_L1_CACHE_SHIFT=6 @@ -626,6 +627,7 @@ CONFIG_ACPI_IPMI=m CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_PLATFORM_PROFILE=y CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ACPI_TABLE_UPGRADE=y # CONFIG_ACPI_DEBUG is not set @@ -686,6 +688,7 @@ CONFIG_X86_INTEL_PSTATE=y CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_AMD_PSTATE=y CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3 +# CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP is not set # CONFIG_X86_AMD_PSTATE_UT is not set CONFIG_X86_ACPI_CPUFREQ=m # CONFIG_X86_ACPI_CPUFREQ_CPB is not set @@ -989,6 +992,7 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FUNCTION_ALIGNMENT_16B=y CONFIG_FUNCTION_ALIGNMENT=16 CONFIG_ARCH_HAS_CPU_ATTACK_VECTORS=y +CONFIG_HAVE_ARCH_GET_SECUREBOOT=y # end of General architecture-dependent options CONFIG_RT_MUTEXES=y diff --git a/packages/kernel-6.18/kernel-6.18.spec b/packages/kernel-6.18/kernel-6.18.spec index d332b844..d87a07e7 100644 --- a/packages/kernel-6.18/kernel-6.18.spec +++ b/packages/kernel-6.18/kernel-6.18.spec @@ -8,13 +8,13 @@ %global host_arch %(uname -m) Name: %{_cross_os}kernel-%{kmajor} -Version: 6.18.51 +Version: 6.18.54 Release: 1%{?dist} Summary: The Linux kernel License: GPL-2.0 WITH Linux-syscall-note URL: https://www.kernel.org/ # Use latest-kernel-srpm-url.sh to get this. -Source0: https://cdn.amazonlinux.com/al2023/blobstore/39f4c2db4f790d9f1525e77e5597d80d8080f9c1db893482267c7b7d4321f2b0/kernel6.18-6.18.51-120.163.amzn2023.src.rpm +Source0: https://cdn.amazonlinux.com/al2023/blobstore/29d88d37fe6de08d78ff9e57ddbe05c439a3b25ea7e9414dd65ffc3b7f435d0d/kernel6.18-6.18.54-121.166.amzn2023.src.rpm Source1: gpgkey-B21C50FA44A99720EAA72F7FE951904AD832C631.asc # Custom Bottlerocket kernel configurations. @@ -86,8 +86,6 @@ Patch1005: 1005-drm-simpledrm-Select-prerequisites-for-gpu-drivers.patch Patch1006: 1006-Revert-selinux-fix-overlayfs-mmap-and-mprotect-acces.patch # Backport patch to disable LZ4 rolling decompression on EROFS Patch1007: 1007-erofs-disable-LZ4-rolling-decompression-for-now.patch -# Reserve blocks for XFS parent pointer updates to avoid a filesystem shutdown -Patch1008: 1008-xfs-initialise-args-total-for-parent-pointer-updates.patch BuildRequires: bc BuildRequires: elfutils-devel