]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Fri, 28 Aug 2020 04:35:14 +0000 (00:35 -0400)
committerSasha Levin <sashal@kernel.org>
Fri, 28 Aug 2020 04:35:14 +0000 (00:35 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/arm64-fix-__cpu_logical_map-undefined-issue.patch [new file with mode: 0644]
queue-5.4/brcmfmac-set-timeout-value-when-configuring-power-sa.patch [new file with mode: 0644]
queue-5.4/efi-provide-empty-efi_enter_virtual_mode-implementat.patch [new file with mode: 0644]
queue-5.4/kvm-arm64-fix-symbol-dependency-in-__hyp_call_panic_.patch [new file with mode: 0644]
queue-5.4/media-davinci-vpif_capture-fix-potential-double-free.patch [new file with mode: 0644]
queue-5.4/powerpc-spufs-add-config_coredump-dependency.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/usb-sisusbvga-fix-a-potential-ub-casued-by-left-shif.patch [new file with mode: 0644]

diff --git a/queue-5.4/arm64-fix-__cpu_logical_map-undefined-issue.patch b/queue-5.4/arm64-fix-__cpu_logical_map-undefined-issue.patch
new file mode 100644 (file)
index 0000000..0916ade
--- /dev/null
@@ -0,0 +1,110 @@
+From 117ef83e9041d09fc91704dfa1fa40ad95ad6ce6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 27 Jul 2020 23:29:38 +0800
+Subject: arm64: Fix __cpu_logical_map undefined issue
+
+From: Kefeng Wang <wangkefeng.wang@huawei.com>
+
+[ Upstream commit eaecca9e7710281be7c31d892c9f447eafd7ddd9 ]
+
+The __cpu_logical_map undefined issue occued when the new
+tegra194-cpufreq drvier building as a module.
+
+ERROR: modpost: "__cpu_logical_map" [drivers/cpufreq/tegra194-cpufreq.ko] undefined!
+
+The driver using cpu_logical_map() macro which will expand to
+__cpu_logical_map, we can't access it in a drvier. Let's turn
+cpu_logical_map() into a C wrapper and export it to fix the
+build issue.
+
+Also create a function set_cpu_logical_map(cpu, hwid) when assign
+a value to cpu_logical_map(cpu).
+
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm64/include/asm/smp.h | 7 ++++++-
+ arch/arm64/kernel/setup.c    | 8 +++++++-
+ arch/arm64/kernel/smp.c      | 6 +++---
+ 3 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h
+index a0c8a0b652593..0eadbf933e359 100644
+--- a/arch/arm64/include/asm/smp.h
++++ b/arch/arm64/include/asm/smp.h
+@@ -46,7 +46,12 @@ DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
+  * Logical CPU mapping.
+  */
+ extern u64 __cpu_logical_map[NR_CPUS];
+-#define cpu_logical_map(cpu)    __cpu_logical_map[cpu]
++extern u64 cpu_logical_map(int cpu);
++
++static inline void set_cpu_logical_map(int cpu, u64 hwid)
++{
++      __cpu_logical_map[cpu] = hwid;
++}
+ struct seq_file;
+diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
+index 56f6645617548..d98987b82874f 100644
+--- a/arch/arm64/kernel/setup.c
++++ b/arch/arm64/kernel/setup.c
+@@ -85,7 +85,7 @@ u64 __cacheline_aligned boot_args[4];
+ void __init smp_setup_processor_id(void)
+ {
+       u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
+-      cpu_logical_map(0) = mpidr;
++      set_cpu_logical_map(0, mpidr);
+       /*
+        * clear __my_cpu_offset on boot CPU to avoid hang caused by
+@@ -276,6 +276,12 @@ arch_initcall(reserve_memblock_reserved_regions);
+ u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
++u64 cpu_logical_map(int cpu)
++{
++      return __cpu_logical_map[cpu];
++}
++EXPORT_SYMBOL_GPL(cpu_logical_map);
++
+ void __init setup_arch(char **cmdline_p)
+ {
+       init_mm.start_code = (unsigned long) _text;
+diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
+index 993a4aedfd377..102dc3e7f2e1d 100644
+--- a/arch/arm64/kernel/smp.c
++++ b/arch/arm64/kernel/smp.c
+@@ -549,7 +549,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
+               return;
+       /* map the logical cpu id to cpu MPIDR */
+-      cpu_logical_map(cpu_count) = hwid;
++      set_cpu_logical_map(cpu_count, hwid);
+       cpu_madt_gicc[cpu_count] = *processor;
+@@ -663,7 +663,7 @@ static void __init of_parse_and_init_cpus(void)
+                       goto next;
+               pr_debug("cpu logical map 0x%llx\n", hwid);
+-              cpu_logical_map(cpu_count) = hwid;
++              set_cpu_logical_map(cpu_count, hwid);
+               early_map_cpu_to_node(cpu_count, of_node_to_nid(dn));
+ next:
+@@ -704,7 +704,7 @@ void __init smp_init_cpus(void)
+       for (i = 1; i < nr_cpu_ids; i++) {
+               if (cpu_logical_map(i) != INVALID_HWID) {
+                       if (smp_cpu_setup(i))
+-                              cpu_logical_map(i) = INVALID_HWID;
++                              set_cpu_logical_map(i, INVALID_HWID);
+               }
+       }
+ }
+-- 
+2.25.1
+
diff --git a/queue-5.4/brcmfmac-set-timeout-value-when-configuring-power-sa.patch b/queue-5.4/brcmfmac-set-timeout-value-when-configuring-power-sa.patch
new file mode 100644 (file)
index 0000000..5d659a8
--- /dev/null
@@ -0,0 +1,50 @@
+From fa81781ff60d80776897de8416f1a30656dfd3d8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 Jul 2020 13:23:02 +0200
+Subject: brcmfmac: Set timeout value when configuring power save
+
+From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+
+[ Upstream commit 3dc05ffb04436020f63138186dbc4f37bd938552 ]
+
+Set the timeout value as per cfg80211's set_power_mgmt() request. If the
+requested value value is left undefined we set it to 2 seconds, the
+maximum supported value.
+
+Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20200721112302.22718-1-nsaenzjulienne@suse.de
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c   | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+index e3ebb7abbdaed..4ca50353538ef 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -82,6 +82,8 @@
+ #define BRCMF_ND_INFO_TIMEOUT         msecs_to_jiffies(2000)
++#define BRCMF_PS_MAX_TIMEOUT_MS               2000
++
+ #define BRCMF_ASSOC_PARAMS_FIXED_SIZE \
+       (sizeof(struct brcmf_assoc_params_le) - sizeof(u16))
+@@ -2789,6 +2791,12 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev,
+               else
+                       bphy_err(drvr, "error (%d)\n", err);
+       }
++
++      err = brcmf_fil_iovar_int_set(ifp, "pm2_sleep_ret",
++                              min_t(u32, timeout, BRCMF_PS_MAX_TIMEOUT_MS));
++      if (err)
++              bphy_err(drvr, "Unable to set pm timeout, (%d)\n", err);
++
+ done:
+       brcmf_dbg(TRACE, "Exit\n");
+       return err;
+-- 
+2.25.1
+
diff --git a/queue-5.4/efi-provide-empty-efi_enter_virtual_mode-implementat.patch b/queue-5.4/efi-provide-empty-efi_enter_virtual_mode-implementat.patch
new file mode 100644 (file)
index 0000000..8d653ea
--- /dev/null
@@ -0,0 +1,52 @@
+From 3dffb68deac8e31cc9f2062fb2c415f13e14a5f1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Aug 2020 23:25:01 -0700
+Subject: efi: provide empty efi_enter_virtual_mode implementation
+
+From: Andrey Konovalov <andreyknvl@google.com>
+
+[ Upstream commit 2c547f9da0539ad1f7ef7f08c8c82036d61b011a ]
+
+When CONFIG_EFI is not enabled, we might get an undefined reference to
+efi_enter_virtual_mode() error, if this efi_enabled() call isn't inlined
+into start_kernel().  This happens in particular, if start_kernel() is
+annodated with __no_sanitize_address.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Acked-by: Ard Biesheuvel <ardb@kernel.org>
+Cc: Alexander Potapenko <glider@google.com>
+Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Dmitry Vyukov <dvyukov@google.com>
+Cc: Elena Petrova <lenaptr@google.com>
+Cc: Marco Elver <elver@google.com>
+Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
+Cc: Walter Wu <walter-zh.wu@mediatek.com>
+Link: http://lkml.kernel.org/r/6514652d3a32d3ed33d6eb5c91d0af63bf0d1a0c.1596544734.git.andreyknvl@google.com
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/efi.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/linux/efi.h b/include/linux/efi.h
+index d87acf62958e2..13ed2c6b13f8b 100644
+--- a/include/linux/efi.h
++++ b/include/linux/efi.h
+@@ -1039,7 +1039,11 @@ extern void *efi_get_pal_addr (void);
+ extern void efi_map_pal_code (void);
+ extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
+ extern void efi_gettimeofday (struct timespec64 *ts);
++#ifdef CONFIG_EFI
+ extern void efi_enter_virtual_mode (void);    /* switch EFI to virtual mode, if possible */
++#else
++static inline void efi_enter_virtual_mode (void) {}
++#endif
+ #ifdef CONFIG_X86
+ extern efi_status_t efi_query_variable_store(u32 attributes,
+                                            unsigned long size,
+-- 
+2.25.1
+
diff --git a/queue-5.4/kvm-arm64-fix-symbol-dependency-in-__hyp_call_panic_.patch b/queue-5.4/kvm-arm64-fix-symbol-dependency-in-__hyp_call_panic_.patch
new file mode 100644 (file)
index 0000000..8b86d2b
--- /dev/null
@@ -0,0 +1,42 @@
+From bebdbec4a943d5fdb825f6bc0216a2d0f00c5108 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 25 Jun 2020 14:14:06 +0100
+Subject: KVM: arm64: Fix symbol dependency in __hyp_call_panic_nvhe
+
+From: David Brazdil <dbrazdil@google.com>
+
+[ Upstream commit b38b298aa4397e2dc74a89b4dd3eac9e59b64c96 ]
+
+__hyp_call_panic_nvhe contains inline assembly which did not declare
+its dependency on the __hyp_panic_string symbol.
+
+The static-declared string has previously been kept alive because of a use in
+__hyp_call_panic_vhe. Fix this in preparation for separating the source files
+between VHE and nVHE when the two users land in two different compilation
+units. The static variable otherwise gets dropped when compiling the nVHE
+source file, causing an undefined symbol linker error later.
+
+Signed-off-by: David Brazdil <dbrazdil@google.com>
+Signed-off-by: Marc Zyngier <maz@kernel.org>
+Link: https://lore.kernel.org/r/20200625131420.71444-2-dbrazdil@google.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm64/kvm/hyp/switch.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
+index d76a3d39b2699..6f4838b475d0d 100644
+--- a/arch/arm64/kvm/hyp/switch.c
++++ b/arch/arm64/kvm/hyp/switch.c
+@@ -754,7 +754,7 @@ static void __hyp_text __hyp_call_panic_nvhe(u64 spsr, u64 elr, u64 par,
+        * making sure it is a kernel address and not a PC-relative
+        * reference.
+        */
+-      asm volatile("ldr %0, =__hyp_panic_string" : "=r" (str_va));
++      asm volatile("ldr %0, =%1" : "=r" (str_va) : "S" (__hyp_panic_string));
+       __hyp_do_panic(str_va,
+                      spsr, elr,
+-- 
+2.25.1
+
diff --git a/queue-5.4/media-davinci-vpif_capture-fix-potential-double-free.patch b/queue-5.4/media-davinci-vpif_capture-fix-potential-double-free.patch
new file mode 100644 (file)
index 0000000..f6ffdd5
--- /dev/null
@@ -0,0 +1,40 @@
+From 78f7cbd7fd6aa36a7db47d506e268b88fe0e7d40 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 23 Jul 2020 19:04:53 +0200
+Subject: media: davinci: vpif_capture: fix potential double free
+
+From: Evgeny Novikov <novikov@ispras.ru>
+
+[ Upstream commit 602649eadaa0c977e362e641f51ec306bc1d365d ]
+
+In case of errors vpif_probe_complete() releases memory for vpif_obj.sd
+and unregisters the V4L2 device. But then this is done again by
+vpif_probe() itself. The patch removes the cleaning from
+vpif_probe_complete().
+
+Found by Linux Driver Verification project (linuxtesting.org).
+
+Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/platform/davinci/vpif_capture.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
+index 71f4fe882d138..74f68ac3c9a75 100644
+--- a/drivers/media/platform/davinci/vpif_capture.c
++++ b/drivers/media/platform/davinci/vpif_capture.c
+@@ -1482,8 +1482,6 @@ probe_out:
+               /* Unregister video device */
+               video_unregister_device(&ch->video_dev);
+       }
+-      kfree(vpif_obj.sd);
+-      v4l2_device_unregister(&vpif_obj.v4l2_dev);
+       return err;
+ }
+-- 
+2.25.1
+
diff --git a/queue-5.4/powerpc-spufs-add-config_coredump-dependency.patch b/queue-5.4/powerpc-spufs-add-config_coredump-dependency.patch
new file mode 100644 (file)
index 0000000..8f2af9e
--- /dev/null
@@ -0,0 +1,47 @@
+From ffec9539b8e1289b9354329d038a0ef456a208cf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 6 Jul 2020 15:22:46 +0200
+Subject: powerpc/spufs: add CONFIG_COREDUMP dependency
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+[ Upstream commit b648a5132ca3237a0f1ce5d871fff342b0efcf8a ]
+
+The kernel test robot pointed out a slightly different error message
+after recent commit 5456ffdee666 ("powerpc/spufs: simplify spufs core
+dumping") to spufs for a configuration that never worked:
+
+   powerpc64-linux-ld: arch/powerpc/platforms/cell/spufs/file.o: in function `.spufs_proxydma_info_dump':
+>> file.c:(.text+0x4c68): undefined reference to `.dump_emit'
+   powerpc64-linux-ld: arch/powerpc/platforms/cell/spufs/file.o: in function `.spufs_dma_info_dump':
+   file.c:(.text+0x4d70): undefined reference to `.dump_emit'
+   powerpc64-linux-ld: arch/powerpc/platforms/cell/spufs/file.o: in function `.spufs_wbox_info_dump':
+   file.c:(.text+0x4df4): undefined reference to `.dump_emit'
+
+Add a Kconfig dependency to prevent this from happening again.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Jeremy Kerr <jk@ozlabs.org>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20200706132302.3885935-1-arnd@arndb.de
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/platforms/cell/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
+index 0f7c8241912b9..f2ff359041eec 100644
+--- a/arch/powerpc/platforms/cell/Kconfig
++++ b/arch/powerpc/platforms/cell/Kconfig
+@@ -44,6 +44,7 @@ config SPU_FS
+       tristate "SPU file system"
+       default m
+       depends on PPC_CELL
++      depends on COREDUMP
+       select SPU_BASE
+       help
+         The SPU file system is used to access Synergistic Processing
+-- 
+2.25.1
+
index 8eee0b896c32d39794ec5dfc14e6496c550e211b..08706ce898e52b667dc32ed40faa42382746d064 100644 (file)
@@ -57,3 +57,10 @@ ceph-do-not-access-the-kiocb-after-aio-requests.patch
 scsi-fcoe-memory-leak-fix-in-fcoe_sysfs_fcf_del.patch
 edac-ie31200-fallback-if-host-bridge-device-is-alrea.patch
 hugetlbfs-prevent-filesystem-stacking-of-hugetlbfs.patch
+media-davinci-vpif_capture-fix-potential-double-free.patch
+kvm-arm64-fix-symbol-dependency-in-__hyp_call_panic_.patch
+powerpc-spufs-add-config_coredump-dependency.patch
+usb-sisusbvga-fix-a-potential-ub-casued-by-left-shif.patch
+brcmfmac-set-timeout-value-when-configuring-power-sa.patch
+efi-provide-empty-efi_enter_virtual_mode-implementat.patch
+arm64-fix-__cpu_logical_map-undefined-issue.patch
diff --git a/queue-5.4/usb-sisusbvga-fix-a-potential-ub-casued-by-left-shif.patch b/queue-5.4/usb-sisusbvga-fix-a-potential-ub-casued-by-left-shif.patch
new file mode 100644 (file)
index 0000000..4c17212
--- /dev/null
@@ -0,0 +1,41 @@
+From 9b2b45f84f038fee8be229da888dfcb747636d1c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 11 Jul 2020 00:30:18 -0400
+Subject: USB: sisusbvga: Fix a potential UB casued by left shifting a negative
+ value
+
+From: Changming Liu <charley.ashbringer@gmail.com>
+
+[ Upstream commit 2b53a19284f537168fb506f2f40d7fda40a01162 ]
+
+The char buffer buf, receives data directly from user space,
+so its content might be negative and its elements are left
+shifted to form an unsigned integer.
+
+Since left shifting a negative value is undefined behavior, thus
+change the char to u8 to elimintate this UB.
+
+Signed-off-by: Changming Liu <charley.ashbringer@gmail.com>
+Link: https://lore.kernel.org/r/20200711043018.928-1-charley.ashbringer@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/usb/misc/sisusbvga/sisusb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
+index fc8a5da4a07c9..0734e6dd93862 100644
+--- a/drivers/usb/misc/sisusbvga/sisusb.c
++++ b/drivers/usb/misc/sisusbvga/sisusb.c
+@@ -761,7 +761,7 @@ static int sisusb_write_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr,
+       u8   swap8, fromkern = kernbuffer ? 1 : 0;
+       u16  swap16;
+       u32  swap32, flag = (length >> 28) & 1;
+-      char buf[4];
++      u8 buf[4];
+       /* if neither kernbuffer not userbuffer are given, assume
+        * data in obuf
+-- 
+2.25.1
+