From: Greg Kroah-Hartman Date: Wed, 15 Mar 2023 09:00:04 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v4.14.310~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=812733253d84c24d8cc057aeebc91c158a97b609;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: kvm-fix-memoryleak-in-kvm_init.patch uml-define-runtime_discard_exit.patch xfs-remove-xfs_setattr_time-declaration.patch --- diff --git a/queue-5.15/kvm-fix-memoryleak-in-kvm_init.patch b/queue-5.15/kvm-fix-memoryleak-in-kvm_init.patch new file mode 100644 index 00000000000..868d3ef1abd --- /dev/null +++ b/queue-5.15/kvm-fix-memoryleak-in-kvm_init.patch @@ -0,0 +1,46 @@ +From 5a2a961be2ad6a16eb388a80442443b353c11d16 Mon Sep 17 00:00:00 2001 +From: Miaohe Lin +Date: Tue, 23 Aug 2022 14:34:14 +0800 +Subject: KVM: fix memoryleak in kvm_init() + +From: Miaohe Lin + +commit 5a2a961be2ad6a16eb388a80442443b353c11d16 upstream. + +When alloc_cpumask_var_node() fails for a certain cpu, there might be some +allocated cpumasks for percpu cpu_kick_mask. We should free these cpumasks +or memoryleak will occur. + +Fixes: baff59ccdc65 ("KVM: Pre-allocate cpumasks for kvm_make_all_cpus_request_except()") +Signed-off-by: Miaohe Lin +Link: https://lore.kernel.org/r/20220823063414.59778-1-linmiaohe@huawei.com +Signed-off-by: Sean Christopherson +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + virt/kvm/kvm_main.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -5649,7 +5649,7 @@ int kvm_init(void *opaque, unsigned vcpu + + r = kvm_async_pf_init(); + if (r) +- goto out_free_5; ++ goto out_free_4; + + kvm_chardev_ops.owner = module; + kvm_vm_fops.owner = module; +@@ -5682,10 +5682,9 @@ err_register: + kvm_vfio_ops_exit(); + err_vfio: + kvm_async_pf_deinit(); +-out_free_5: ++out_free_4: + for_each_possible_cpu(cpu) + free_cpumask_var(per_cpu(cpu_kick_mask, cpu)); +-out_free_4: + kmem_cache_destroy(kvm_vcpu_cache); + out_free_3: + unregister_reboot_notifier(&kvm_reboot_notifier); diff --git a/queue-5.15/series b/queue-5.15/series index f9baed3c35c..28136261cca 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -136,3 +136,6 @@ tools-include-add-dis-asm-compat.h-to-handle-version-differences.patch tools-perf-fix-compilation-error-with-new-binutils.patch tools-bpf_jit_disasm-fix-compilation-error-with-new-binutils.patch tools-bpftool-fix-compilation-error-with-new-binutils.patch +kvm-fix-memoryleak-in-kvm_init.patch +xfs-remove-xfs_setattr_time-declaration.patch +uml-define-runtime_discard_exit.patch diff --git a/queue-5.15/uml-define-runtime_discard_exit.patch b/queue-5.15/uml-define-runtime_discard_exit.patch new file mode 100644 index 00000000000..7ca1463d308 --- /dev/null +++ b/queue-5.15/uml-define-runtime_discard_exit.patch @@ -0,0 +1,40 @@ +From b99ddbe8336ee680257c8ab479f75051eaa49dcf Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Wed, 8 Feb 2023 01:41:56 +0900 +Subject: UML: define RUNTIME_DISCARD_EXIT + +From: Masahiro Yamada + +commit b99ddbe8336ee680257c8ab479f75051eaa49dcf upstream. + +With CONFIG_VIRTIO_UML=y, GNU ld < 2.36 fails to link UML vmlinux +(w/wo CONFIG_LD_SCRIPT_STATIC). + + `.exit.text' referenced in section `.uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o + collect2: error: ld returned 1 exit status + +This fix is similar to the following commits: + +- 4b9880dbf3bd ("powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT") +- a494398bde27 ("s390: define RUNTIME_DISCARD_EXIT to fix link error + with GNU ld < 2.36") +- c1c551bebf92 ("sh: define RUNTIME_DISCARD_EXIT") + +Fixes: 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") +Reported-by: SeongJae Park +Signed-off-by: Masahiro Yamada +Tested-by: SeongJae Park +Signed-off-by: Richard Weinberger +Signed-off-by: Greg Kroah-Hartman +--- + arch/um/kernel/vmlinux.lds.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/um/kernel/vmlinux.lds.S ++++ b/arch/um/kernel/vmlinux.lds.S +@@ -1,4 +1,4 @@ +- ++#define RUNTIME_DISCARD_EXIT + KERNEL_STACK_SIZE = 4096 * (1 << CONFIG_KERNEL_STACK_ORDER); + + #ifdef CONFIG_LD_SCRIPT_STATIC diff --git a/queue-5.15/xfs-remove-xfs_setattr_time-declaration.patch b/queue-5.15/xfs-remove-xfs_setattr_time-declaration.patch new file mode 100644 index 00000000000..fb85d1b1a0f --- /dev/null +++ b/queue-5.15/xfs-remove-xfs_setattr_time-declaration.patch @@ -0,0 +1,31 @@ +From b0463b9dd7030a766133ad2f1571f97f204d7bdf Mon Sep 17 00:00:00 2001 +From: Gaosheng Cui +Date: Mon, 19 Sep 2022 06:53:14 +1000 +Subject: xfs: remove xfs_setattr_time() declaration + +From: Gaosheng Cui + +commit b0463b9dd7030a766133ad2f1571f97f204d7bdf upstream. + +xfs_setattr_time() has been removed since +commit e014f37db1a2 ("xfs: use setattr_copy to set vfs inode +attributes"), so remove it. + +Signed-off-by: Gaosheng Cui +Reviewed-by: Carlos Maiolino +Signed-off-by: Dave Chinner +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/xfs_iops.h | 1 - + 1 file changed, 1 deletion(-) + +--- a/fs/xfs/xfs_iops.h ++++ b/fs/xfs/xfs_iops.h +@@ -13,7 +13,6 @@ extern const struct file_operations xfs_ + + extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size); + +-extern void xfs_setattr_time(struct xfs_inode *ip, struct iattr *iattr); + int xfs_vn_setattr_size(struct user_namespace *mnt_userns, + struct dentry *dentry, struct iattr *vap); +