]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Mar 2023 09:00:04 +0000 (10:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Mar 2023 09:00:04 +0000 (10:00 +0100)
added patches:
kvm-fix-memoryleak-in-kvm_init.patch
uml-define-runtime_discard_exit.patch
xfs-remove-xfs_setattr_time-declaration.patch

queue-5.15/kvm-fix-memoryleak-in-kvm_init.patch [new file with mode: 0644]
queue-5.15/series
queue-5.15/uml-define-runtime_discard_exit.patch [new file with mode: 0644]
queue-5.15/xfs-remove-xfs_setattr_time-declaration.patch [new file with mode: 0644]

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 (file)
index 0000000..868d3ef
--- /dev/null
@@ -0,0 +1,46 @@
+From 5a2a961be2ad6a16eb388a80442443b353c11d16 Mon Sep 17 00:00:00 2001
+From: Miaohe Lin <linmiaohe@huawei.com>
+Date: Tue, 23 Aug 2022 14:34:14 +0800
+Subject: KVM: fix memoryleak in kvm_init()
+
+From: Miaohe Lin <linmiaohe@huawei.com>
+
+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 <linmiaohe@huawei.com>
+Link: https://lore.kernel.org/r/20220823063414.59778-1-linmiaohe@huawei.com
+Signed-off-by: Sean Christopherson <seanjc@google.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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);
index f9baed3c35c176bb1ec8ff1da97b7559096902c6..28136261ccaa381f01f440fc3110e3438f38b23e 100644 (file)
@@ -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 (file)
index 0000000..7ca1463
--- /dev/null
@@ -0,0 +1,40 @@
+From b99ddbe8336ee680257c8ab479f75051eaa49dcf Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <masahiroy@kernel.org>
+Date: Wed, 8 Feb 2023 01:41:56 +0900
+Subject: UML: define RUNTIME_DISCARD_EXIT
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+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 <sj@kernel.org>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Tested-by: SeongJae Park <sj@kernel.org>
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..fb85d1b
--- /dev/null
@@ -0,0 +1,31 @@
+From b0463b9dd7030a766133ad2f1571f97f204d7bdf Mon Sep 17 00:00:00 2001
+From: Gaosheng Cui <cuigaosheng1@huawei.com>
+Date: Mon, 19 Sep 2022 06:53:14 +1000
+Subject: xfs: remove xfs_setattr_time() declaration
+
+From: Gaosheng Cui <cuigaosheng1@huawei.com>
+
+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 <cuigaosheng1@huawei.com>
+Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
+Signed-off-by: Dave Chinner <david@fromorbit.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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);