From: Greg Kroah-Hartman Date: Fri, 5 Apr 2024 09:23:45 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.15.154~108 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d79cf67fb2e173b77536d2e30c56b5684055a1e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: io_uring-ensure-0-is-returned-on-file-registration-success.patch revert-x86-mm-ident_map-use-gbpages-only-where-full-gb-page-should-be-mapped.patch --- diff --git a/queue-5.15/io_uring-ensure-0-is-returned-on-file-registration-success.patch b/queue-5.15/io_uring-ensure-0-is-returned-on-file-registration-success.patch new file mode 100644 index 00000000000..a121d90b969 --- /dev/null +++ b/queue-5.15/io_uring-ensure-0-is-returned-on-file-registration-success.patch @@ -0,0 +1,29 @@ +From 51ebdc3b0996cc43502b25e95637c66bb083e252 Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Tue, 2 Apr 2024 08:28:04 -0600 +Subject: io_uring: ensure '0' is returned on file registration success + +From: Jens Axboe + +A previous backport mistakenly removed code that cleared 'ret' to zero, +as the SCM logging was performed. Fix up the return value so we don't +return an errant error on fixed file registration. + +Fixes: d909d381c315 ("io_uring: drop any code related to SCM_RIGHTS") +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/io_uring.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/io_uring/io_uring.c ++++ b/io_uring/io_uring.c +@@ -8422,7 +8422,7 @@ static int io_sqe_files_register(struct + } + + io_rsrc_node_switch(ctx, NULL); +- return ret; ++ return 0; + out_fput: + for (i = 0; i < ctx->nr_user_files; i++) { + file = io_file_from_index(ctx, i); diff --git a/queue-5.15/revert-x86-mm-ident_map-use-gbpages-only-where-full-gb-page-should-be-mapped.patch b/queue-5.15/revert-x86-mm-ident_map-use-gbpages-only-where-full-gb-page-should-be-mapped.patch new file mode 100644 index 00000000000..191d0328fb5 --- /dev/null +++ b/queue-5.15/revert-x86-mm-ident_map-use-gbpages-only-where-full-gb-page-should-be-mapped.patch @@ -0,0 +1,75 @@ +From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001 +From: Ingo Molnar +Date: Mon, 25 Mar 2024 11:47:51 +0100 +Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped." + +From: Ingo Molnar + +commit c567f2948f57bdc03ed03403ae0234085f376b7d upstream. + +This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572. + +While the original change tries to fix a bug, it also unintentionally broke +existing systems, see the regressions reported at: + + https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/ + +Since d794734c9bbf was also marked for -stable, let's back it out before +causing more damage. + +Note that due to another upstream change the revert was not 100% automatic: + + 0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf() + +Signed-off-by: Ingo Molnar +Cc: +Cc: Russ Anderson +Cc: Steve Wahl +Cc: Dave Hansen +Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/ +Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.") +Signed-off-by: Steve Wahl +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/mm/ident_map.c | 23 +++++------------------ + 1 file changed, 5 insertions(+), 18 deletions(-) + +--- a/arch/x86/mm/ident_map.c ++++ b/arch/x86/mm/ident_map.c +@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_map + for (; addr < end; addr = next) { + pud_t *pud = pud_page + pud_index(addr); + pmd_t *pmd; +- bool use_gbpage; + + next = (addr & PUD_MASK) + PUD_SIZE; + if (next > end) + next = end; + +- /* if this is already a gbpage, this portion is already mapped */ +- if (pud_large(*pud)) +- continue; +- +- /* Is using a gbpage allowed? */ +- use_gbpage = info->direct_gbpages; +- +- /* Don't use gbpage if it maps more than the requested region. */ +- /* at the begining: */ +- use_gbpage &= ((addr & ~PUD_MASK) == 0); +- /* ... or at the end: */ +- use_gbpage &= ((next & ~PUD_MASK) == 0); +- +- /* Never overwrite existing mappings */ +- use_gbpage &= !pud_present(*pud); +- +- if (use_gbpage) { ++ if (info->direct_gbpages) { + pud_t pudval; + ++ if (pud_present(*pud)) ++ continue; ++ ++ addr &= PUD_MASK; + pudval = __pud((addr - info->offset) | info->page_flag); + set_pud(pud, pudval); + continue; diff --git a/queue-5.15/series b/queue-5.15/series index 3aab2eeac41..a76e92a471f 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -627,3 +627,5 @@ bluetooth-fix-toctou-in-hci-debugfs-implementation.patch xen-netfront-add-missing-skb_mark_for_recycle.patch net-rds-fix-possible-cp-null-dereference.patch locking-rwsem-disable-preemption-while-trying-for-rwsem-lock.patch +io_uring-ensure-0-is-returned-on-file-registration-success.patch +revert-x86-mm-ident_map-use-gbpages-only-where-full-gb-page-should-be-mapped.patch