From 16d099d7aaea644d3494a9c34c071ca5b0ea78d4 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sat, 17 Apr 2021 19:27:00 -0400 Subject: [PATCH] Fixes for 5.4 Signed-off-by: Sasha Levin --- ...-return-efault-if-copy_to_user-fails.patch | 44 +++++++ ...licate-sha2md5_fck-to-fix-clk_disabl.patch | 42 ++++++ ...ng-mmc-devices-with-aliases-for-omap.patch | 55 ++++++++ ...eystone-fix-integer-overflow-warning.patch | 56 ++++++++ ...rm-omap1-fix-building-with-clang-ias.patch | 56 ++++++++ ...esai-fix-tdm-slot-setup-for-i2s-mode.patch | 49 +++++++ ...73-added-30ms-turn-on-off-time-delay.patch | 41 ++++++ ...ne-dw-make-it-dependent-to-has_iomem.patch | 46 +++++++ .../drm-msm-fix-a5xx-a6xx-timestamps.patch | 56 ++++++++ queue-5.4/gpio-sysfs-obey-valid_mask.patch | 50 ++++++++ ...pad-enable-interrupts-only-when-open.patch | 121 ++++++++++++++++++ ...ssing-initialization-hint-to-the-inf.patch | 43 +++++++ ...ta-fast_rx-when-sta-removed-from-4-a.patch | 70 ++++++++++ ...r-disregard-dead-dst-in-neigh_update.patch | 51 ++++++++ ...154-forbid-monitor-for-add-llsec-dev.patch | 38 ++++++ ...-forbid-monitor-for-add-llsec-devkey.patch | 38 ++++++ ...154-forbid-monitor-for-add-llsec-key.patch | 38 ++++++ ...orbid-monitor-for-add-llsec-seclevel.patch | 38 ++++++ ...154-forbid-monitor-for-del-llsec-dev.patch | 38 ++++++ ...-forbid-monitor-for-del-llsec-devkey.patch | 38 ++++++ ...154-forbid-monitor-for-del-llsec-key.patch | 38 ++++++ ...stop-dump-llsec-devkeys-for-monitors.patch | 40 ++++++ ...54-stop-dump-llsec-devs-for-monitors.patch | 40 ++++++ ...54-stop-dump-llsec-keys-for-monitors.patch | 40 ++++++ ...top-dump-llsec-seclevels-for-monitor.patch | 40 ++++++ ...tential-use-after-free-in-rds_send_r.patch | 50 ++++++++ ...x-spelling-errors-in-net-tipc-module.patch | 67 ++++++++++ ...resource_len-to-validate-pci-resourc.patch | 54 ++++++++ ...ort_srp-don-t-block-target-in-srp_po.patch | 52 ++++++++ queue-5.4/series | 30 +++++ ...ifi-return-micros-for-bss-tsf-values.patch | 50 ++++++++ 31 files changed, 1509 insertions(+) create mode 100644 queue-5.4/arc-kernel-return-efault-if-copy_to_user-fails.patch create mode 100644 queue-5.4/arm-dts-drop-duplicate-sha2md5_fck-to-fix-clk_disabl.patch create mode 100644 queue-5.4/arm-dts-fix-moving-mmc-devices-with-aliases-for-omap.patch create mode 100644 queue-5.4/arm-keystone-fix-integer-overflow-warning.patch create mode 100644 queue-5.4/arm-omap1-fix-building-with-clang-ias.patch create mode 100644 queue-5.4/asoc-fsl_esai-fix-tdm-slot-setup-for-i2s-mode.patch create mode 100644 queue-5.4/asoc-max98373-added-30ms-turn-on-off-time-delay.patch create mode 100644 queue-5.4/dmaengine-dw-make-it-dependent-to-has_iomem.patch create mode 100644 queue-5.4/drm-msm-fix-a5xx-a6xx-timestamps.patch create mode 100644 queue-5.4/gpio-sysfs-obey-valid_mask.patch create mode 100644 queue-5.4/input-nspire-keypad-enable-interrupts-only-when-open.patch create mode 100644 queue-5.4/lockdep-add-a-missing-initialization-hint-to-the-inf.patch create mode 100644 queue-5.4/mac80211-clear-sta-fast_rx-when-sta-removed-from-4-a.patch create mode 100644 queue-5.4/neighbour-disregard-dead-dst-in-neigh_update.patch create mode 100644 queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-dev.patch create mode 100644 queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-devkey.patch create mode 100644 queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-key.patch create mode 100644 queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-seclevel.patch create mode 100644 queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-dev.patch create mode 100644 queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-devkey.patch create mode 100644 queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-key.patch create mode 100644 queue-5.4/net-ieee802154-stop-dump-llsec-devkeys-for-monitors.patch create mode 100644 queue-5.4/net-ieee802154-stop-dump-llsec-devs-for-monitors.patch create mode 100644 queue-5.4/net-ieee802154-stop-dump-llsec-keys-for-monitors.patch create mode 100644 queue-5.4/net-ieee802154-stop-dump-llsec-seclevels-for-monitor.patch create mode 100644 queue-5.4/net-rds-avoid-potential-use-after-free-in-rds_send_r.patch create mode 100644 queue-5.4/net-tipc-fix-spelling-errors-in-net-tipc-module.patch create mode 100644 queue-5.4/pcnet32-use-pci_resource_len-to-validate-pci-resourc.patch create mode 100644 queue-5.4/scsi-scsi_transport_srp-don-t-block-target-in-srp_po.patch create mode 100644 queue-5.4/virt_wifi-return-micros-for-bss-tsf-values.patch diff --git a/queue-5.4/arc-kernel-return-efault-if-copy_to_user-fails.patch b/queue-5.4/arc-kernel-return-efault-if-copy_to_user-fails.patch new file mode 100644 index 00000000000..8e871fd6555 --- /dev/null +++ b/queue-5.4/arc-kernel-return-efault-if-copy_to_user-fails.patch @@ -0,0 +1,44 @@ +From 9810ba418dd8b9bf17a87fdb2e9cd1964c95f157 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 1 Mar 2021 20:05:48 +0800 +Subject: arc: kernel: Return -EFAULT if copy_to_user() fails + +From: Wang Qing + +[ Upstream commit 46e152186cd89d940b26726fff11eb3f4935b45a ] + +The copy_to_user() function returns the number of bytes remaining to be +copied, but we want to return -EFAULT if the copy doesn't complete. + +Signed-off-by: Wang Qing +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/kernel/signal.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c +index 3d57ed0d8535..404518051093 100644 +--- a/arch/arc/kernel/signal.c ++++ b/arch/arc/kernel/signal.c +@@ -96,7 +96,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, + sizeof(sf->uc.uc_mcontext.regs.scratch)); + err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t)); + +- return err; ++ return err ? -EFAULT : 0; + } + + static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) +@@ -110,7 +110,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) + &(sf->uc.uc_mcontext.regs.scratch), + sizeof(sf->uc.uc_mcontext.regs.scratch)); + if (err) +- return err; ++ return -EFAULT; + + set_current_blocked(&set); + regs->bta = uregs.scratch.bta; +-- +2.30.2 + diff --git a/queue-5.4/arm-dts-drop-duplicate-sha2md5_fck-to-fix-clk_disabl.patch b/queue-5.4/arm-dts-drop-duplicate-sha2md5_fck-to-fix-clk_disabl.patch new file mode 100644 index 00000000000..2ea7fc11ba2 --- /dev/null +++ b/queue-5.4/arm-dts-drop-duplicate-sha2md5_fck-to-fix-clk_disabl.patch @@ -0,0 +1,42 @@ +From 3b525d1688282960155d125ed16650e07788762f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Mar 2021 11:26:25 +0200 +Subject: ARM: dts: Drop duplicate sha2md5_fck to fix clk_disable race + +From: Tony Lindgren + +[ Upstream commit 140a776833957539c84301dbdb4c3013876de118 ] + +We have a duplicate legacy clock defined for sha2md5_fck that can +sometimes race with clk_disable() with the dts configured clock +for OMAP4_SHA2MD5_CLKCTRL when unused clocks are disabled during +boot causing an "Unhandled fault: imprecise external abort". + +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/omap44xx-clocks.dtsi | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/arch/arm/boot/dts/omap44xx-clocks.dtsi b/arch/arm/boot/dts/omap44xx-clocks.dtsi +index e9d9c8460682..68ab6a95f222 100644 +--- a/arch/arm/boot/dts/omap44xx-clocks.dtsi ++++ b/arch/arm/boot/dts/omap44xx-clocks.dtsi +@@ -770,14 +770,6 @@ + ti,max-div = <2>; + }; + +- sha2md5_fck: sha2md5_fck@15c8 { +- #clock-cells = <0>; +- compatible = "ti,gate-clock"; +- clocks = <&l3_div_ck>; +- ti,bit-shift = <1>; +- reg = <0x15c8>; +- }; +- + usb_phy_cm_clk32k: usb_phy_cm_clk32k@640 { + #clock-cells = <0>; + compatible = "ti,gate-clock"; +-- +2.30.2 + diff --git a/queue-5.4/arm-dts-fix-moving-mmc-devices-with-aliases-for-omap.patch b/queue-5.4/arm-dts-fix-moving-mmc-devices-with-aliases-for-omap.patch new file mode 100644 index 00000000000..3c390722483 --- /dev/null +++ b/queue-5.4/arm-dts-fix-moving-mmc-devices-with-aliases-for-omap.patch @@ -0,0 +1,55 @@ +From 85935f922835e14e67ec7d271b2eb60631feaaa6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Mar 2021 11:30:45 +0200 +Subject: ARM: dts: Fix moving mmc devices with aliases for omap4 & 5 + +From: Tony Lindgren + +[ Upstream commit 77335a040178a0456d4eabc8bf17a7ca3ee4a327 ] + +Fix moving mmc devices with dts aliases as discussed on the lists. +Without this we now have internal eMMC mmc1 show up as mmc2 compared +to the earlier order of devices. + +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/omap4.dtsi | 5 +++++ + arch/arm/boot/dts/omap5.dtsi | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi +index 904852006b9b..0a36b8fe3fa9 100644 +--- a/arch/arm/boot/dts/omap4.dtsi ++++ b/arch/arm/boot/dts/omap4.dtsi +@@ -22,6 +22,11 @@ + i2c1 = &i2c2; + i2c2 = &i2c3; + i2c3 = &i2c4; ++ mmc0 = &mmc1; ++ mmc1 = &mmc2; ++ mmc2 = &mmc3; ++ mmc3 = &mmc4; ++ mmc4 = &mmc5; + serial0 = &uart1; + serial1 = &uart2; + serial2 = &uart3; +diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi +index 041646fabb2d..3b56e993326d 100644 +--- a/arch/arm/boot/dts/omap5.dtsi ++++ b/arch/arm/boot/dts/omap5.dtsi +@@ -25,6 +25,11 @@ + i2c2 = &i2c3; + i2c3 = &i2c4; + i2c4 = &i2c5; ++ mmc0 = &mmc1; ++ mmc1 = &mmc2; ++ mmc2 = &mmc3; ++ mmc3 = &mmc4; ++ mmc4 = &mmc5; + serial0 = &uart1; + serial1 = &uart2; + serial2 = &uart3; +-- +2.30.2 + diff --git a/queue-5.4/arm-keystone-fix-integer-overflow-warning.patch b/queue-5.4/arm-keystone-fix-integer-overflow-warning.patch new file mode 100644 index 00000000000..fbe39438209 --- /dev/null +++ b/queue-5.4/arm-keystone-fix-integer-overflow-warning.patch @@ -0,0 +1,56 @@ +From 308d07b915065a7d98a78ae098d62ad3d679f0d4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Mar 2021 14:18:05 +0100 +Subject: ARM: keystone: fix integer overflow warning + +From: Arnd Bergmann + +[ Upstream commit 844b85dda2f569943e1e018fdd63b6f7d1d6f08e ] + +clang warns about an impossible condition when building with 32-bit +phys_addr_t: + +arch/arm/mach-keystone/keystone.c:79:16: error: result of comparison of constant 51539607551 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] + mem_end > KEYSTONE_HIGH_PHYS_END) { + ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~ +arch/arm/mach-keystone/keystone.c:78:16: error: result of comparison of constant 34359738368 with expression of type 'phys_addr_t' (aka 'unsigned int') is always true [-Werror,-Wtautological-constant-out-of-range-compare] + if (mem_start < KEYSTONE_HIGH_PHYS_START || + ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~ + +Change the temporary variable to a fixed-size u64 to avoid the warning. + +Signed-off-by: Arnd Bergmann +Reviewed-by: Nathan Chancellor +Acked-by: Santosh Shilimkar +Link: https://lore.kernel.org/r/20210323131814.2751750-1-arnd@kernel.org' +Signed-off-by: Arnd Bergmann +Signed-off-by: Sasha Levin +--- + arch/arm/mach-keystone/keystone.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c +index 638808c4e122..697adedaced4 100644 +--- a/arch/arm/mach-keystone/keystone.c ++++ b/arch/arm/mach-keystone/keystone.c +@@ -62,7 +62,7 @@ static void __init keystone_init(void) + static long long __init keystone_pv_fixup(void) + { + long long offset; +- phys_addr_t mem_start, mem_end; ++ u64 mem_start, mem_end; + + mem_start = memblock_start_of_DRAM(); + mem_end = memblock_end_of_DRAM(); +@@ -75,7 +75,7 @@ static long long __init keystone_pv_fixup(void) + if (mem_start < KEYSTONE_HIGH_PHYS_START || + mem_end > KEYSTONE_HIGH_PHYS_END) { + pr_crit("Invalid address space for memory (%08llx-%08llx)\n", +- (u64)mem_start, (u64)mem_end); ++ mem_start, mem_end); + return 0; + } + +-- +2.30.2 + diff --git a/queue-5.4/arm-omap1-fix-building-with-clang-ias.patch b/queue-5.4/arm-omap1-fix-building-with-clang-ias.patch new file mode 100644 index 00000000000..c7d58a3a4a8 --- /dev/null +++ b/queue-5.4/arm-omap1-fix-building-with-clang-ias.patch @@ -0,0 +1,56 @@ +From 55755a8b923f2b8ddfc493985c82c5b91f98779f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Mar 2021 16:34:21 +0100 +Subject: ARM: omap1: fix building with clang IAS + +From: Arnd Bergmann + +[ Upstream commit 28399a5a6d569c9bdb612345e4933046ca37cde5 ] + +The clang integrated assembler fails to build one file with +a complex asm instruction: + +arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: error: invalid instruction, any one of the following would fix this: + mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit + ^ +arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: armv6t2 + mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit + ^ +arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: thumb2 + mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit + ^ + +The problem is that 'NR_IRQS_LEGACY' is not defined here. Apparently +gas does not care because we first add and then subtract this number, +leading to the immediate value to be the same regardless of the +specific definition of NR_IRQS_LEGACY. + +Neither the way that 'gas' just silently builds this file, nor the +way that clang IAS makes nonsensical suggestions for how to fix it +is great. Fortunately there is an easy fix, which is to #include +the header that contains the definition. + +Signed-off-by: Arnd Bergmann +Acked-by: Tony Lindgren +Link: https://lore.kernel.org/r/20210308153430.2530616-1-arnd@kernel.org' +Signed-off-by: Arnd Bergmann +Signed-off-by: Sasha Levin +--- + arch/arm/mach-omap1/ams-delta-fiq-handler.S | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/mach-omap1/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S +index 14a6c3eb3298..f745a65d3bd7 100644 +--- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S ++++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S +@@ -15,6 +15,7 @@ + #include + + #include ++#include + + #include "ams-delta-fiq.h" + #include "board-ams-delta.h" +-- +2.30.2 + diff --git a/queue-5.4/asoc-fsl_esai-fix-tdm-slot-setup-for-i2s-mode.patch b/queue-5.4/asoc-fsl_esai-fix-tdm-slot-setup-for-i2s-mode.patch new file mode 100644 index 00000000000..a177c67fb54 --- /dev/null +++ b/queue-5.4/asoc-fsl_esai-fix-tdm-slot-setup-for-i2s-mode.patch @@ -0,0 +1,49 @@ +From 1859de2a45756cf660c0ead8b27b6766b04b4108 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Apr 2021 11:14:05 +0300 +Subject: ASoC: fsl_esai: Fix TDM slot setup for I2S mode + +From: Alexander Shiyan + +[ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] + +When using the driver in I2S TDM mode, the fsl_esai_startup() +function rewrites the number of slots previously set by the +fsl_esai_set_dai_tdm_slot() function to 2. +To fix this, let's use the saved slot count value or, if TDM +is not used and the number of slots is not set, the driver will use +the default value (2), which is set by fsl_esai_probe(). + +Signed-off-by: Alexander Shiyan +Acked-by: Nicolin Chen +Link: https://lore.kernel.org/r/20210402081405.9892-1-shc_work@mail.ru +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/fsl/fsl_esai.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c +index 84290be778f0..33ade79fa032 100644 +--- a/sound/soc/fsl/fsl_esai.c ++++ b/sound/soc/fsl/fsl_esai.c +@@ -494,11 +494,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream, + ESAI_SAICR_SYNC, esai_priv->synchronous ? + ESAI_SAICR_SYNC : 0); + +- /* Set a default slot number -- 2 */ ++ /* Set slots count */ + regmap_update_bits(esai_priv->regmap, REG_ESAI_TCCR, +- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2)); ++ ESAI_xCCR_xDC_MASK, ++ ESAI_xCCR_xDC(esai_priv->slots)); + regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR, +- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2)); ++ ESAI_xCCR_xDC_MASK, ++ ESAI_xCCR_xDC(esai_priv->slots)); + } + + return 0; +-- +2.30.2 + diff --git a/queue-5.4/asoc-max98373-added-30ms-turn-on-off-time-delay.patch b/queue-5.4/asoc-max98373-added-30ms-turn-on-off-time-delay.patch new file mode 100644 index 00000000000..ba7caa56fb6 --- /dev/null +++ b/queue-5.4/asoc-max98373-added-30ms-turn-on-off-time-delay.patch @@ -0,0 +1,41 @@ +From bcbf006a6ee5e777955c36aa7f8f8436b4e3984a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Mar 2021 20:35:54 -0700 +Subject: ASoC: max98373: Added 30ms turn on/off time delay + +From: Ryan Lee + +[ Upstream commit 3a27875e91fb9c29de436199d20b33f9413aea77 ] + +Amp requires 10 ~ 30ms for the power ON and OFF. +Added 30ms delay for stability. + +Signed-off-by: Ryan Lee +Link: https://lore.kernel.org/r/20210325033555.29377-2-ryans.lee@maximintegrated.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/max98373.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c +index 96718e3a1ad0..16fbc9faed90 100644 +--- a/sound/soc/codecs/max98373.c ++++ b/sound/soc/codecs/max98373.c +@@ -410,11 +410,13 @@ static int max98373_dac_event(struct snd_soc_dapm_widget *w, + regmap_update_bits(max98373->regmap, + MAX98373_R20FF_GLOBAL_SHDN, + MAX98373_GLOBAL_EN_MASK, 1); ++ usleep_range(30000, 31000); + break; + case SND_SOC_DAPM_POST_PMD: + regmap_update_bits(max98373->regmap, + MAX98373_R20FF_GLOBAL_SHDN, + MAX98373_GLOBAL_EN_MASK, 0); ++ usleep_range(30000, 31000); + max98373->tdm_mode = false; + break; + default: +-- +2.30.2 + diff --git a/queue-5.4/dmaengine-dw-make-it-dependent-to-has_iomem.patch b/queue-5.4/dmaengine-dw-make-it-dependent-to-has_iomem.patch new file mode 100644 index 00000000000..1f99e2bd3b6 --- /dev/null +++ b/queue-5.4/dmaengine-dw-make-it-dependent-to-has_iomem.patch @@ -0,0 +1,46 @@ +From 32efff4b077c7c87e3d00fe7adc9597019d6fc73 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Mar 2021 16:17:57 +0200 +Subject: dmaengine: dw: Make it dependent to HAS_IOMEM + +From: Andy Shevchenko + +[ Upstream commit 88cd1d6191b13689094310c2405394e4ce36d061 ] + +Some architectures do not provide devm_*() APIs. Hence make the driver +dependent on HAVE_IOMEM. + +Fixes: dbde5c2934d1 ("dw_dmac: use devm_* functions to simplify code") +Reported-by: kernel test robot +Signed-off-by: Andy Shevchenko +Acked-by: Viresh Kumar +Link: https://lore.kernel.org/r/20210324141757.24710-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/dw/Kconfig | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/dma/dw/Kconfig b/drivers/dma/dw/Kconfig +index e5162690de8f..db25f9b7778c 100644 +--- a/drivers/dma/dw/Kconfig ++++ b/drivers/dma/dw/Kconfig +@@ -10,6 +10,7 @@ config DW_DMAC_CORE + + config DW_DMAC + tristate "Synopsys DesignWare AHB DMA platform driver" ++ depends on HAS_IOMEM + select DW_DMAC_CORE + help + Support the Synopsys DesignWare AHB DMA controller. This +@@ -18,6 +19,7 @@ config DW_DMAC + config DW_DMAC_PCI + tristate "Synopsys DesignWare AHB DMA PCI driver" + depends on PCI ++ depends on HAS_IOMEM + select DW_DMAC_CORE + help + Support the Synopsys DesignWare AHB DMA controller on the +-- +2.30.2 + diff --git a/queue-5.4/drm-msm-fix-a5xx-a6xx-timestamps.patch b/queue-5.4/drm-msm-fix-a5xx-a6xx-timestamps.patch new file mode 100644 index 00000000000..86a3a6fbfd1 --- /dev/null +++ b/queue-5.4/drm-msm-fix-a5xx-a6xx-timestamps.patch @@ -0,0 +1,56 @@ +From f44d7ce7c4af7432a1a8653c47e7e465ea4b7ea4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Mar 2021 18:23:52 -0700 +Subject: drm/msm: Fix a5xx/a6xx timestamps + +From: Rob Clark + +[ Upstream commit 9fbd3088351b92e8c2cef6e37a39decb12a8d5bb ] + +They were reading a counter that was configured to ALWAYS_COUNT (ie. +cycles that the GPU is doing something) rather than ALWAYS_ON. This +isn't the thing that userspace is looking for. + +Signed-off-by: Rob Clark +Acked-by: Jordan Crouse +Message-Id: <20210325012358.1759770-2-robdclark@gmail.com> +Signed-off-by: Rob Clark +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 ++-- + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +index f84049119f1c..e3579e5ffa14 100644 +--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c ++++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +@@ -1131,8 +1131,8 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu) + + static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) + { +- *value = gpu_read64(gpu, REG_A5XX_RBBM_PERFCTR_CP_0_LO, +- REG_A5XX_RBBM_PERFCTR_CP_0_HI); ++ *value = gpu_read64(gpu, REG_A5XX_RBBM_ALWAYSON_COUNTER_LO, ++ REG_A5XX_RBBM_ALWAYSON_COUNTER_HI); + + return 0; + } +diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +index ab75f0309d4b..df2656e57991 100644 +--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c ++++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +@@ -773,8 +773,8 @@ static int a6xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) + /* Force the GPU power on so we can read this register */ + a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_GPU_SET); + +- *value = gpu_read64(gpu, REG_A6XX_RBBM_PERFCTR_CP_0_LO, +- REG_A6XX_RBBM_PERFCTR_CP_0_HI); ++ *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO, ++ REG_A6XX_CP_ALWAYS_ON_COUNTER_HI); + + a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_GPU_SET); + return 0; +-- +2.30.2 + diff --git a/queue-5.4/gpio-sysfs-obey-valid_mask.patch b/queue-5.4/gpio-sysfs-obey-valid_mask.patch new file mode 100644 index 00000000000..7fec93a228d --- /dev/null +++ b/queue-5.4/gpio-sysfs-obey-valid_mask.patch @@ -0,0 +1,50 @@ +From a59811aa084112624443431ce1bb401f240d291a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Mar 2021 14:41:12 +0300 +Subject: gpio: sysfs: Obey valid_mask + +From: Matti Vaittinen + +[ Upstream commit 23cf00ddd2e1aacf1873e43f5e0c519c120daf7a ] + +Do not allow exporting GPIOs which are set invalid +by the driver's valid mask. + +Fixes: 726cb3ba4969 ("gpiolib: Support 'gpio-reserved-ranges' property") +Signed-off-by: Matti Vaittinen +Reviewed-by: Andy Shevchenko +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpiolib-sysfs.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c +index fbf6b1a0a4fa..558cd900d399 100644 +--- a/drivers/gpio/gpiolib-sysfs.c ++++ b/drivers/gpio/gpiolib-sysfs.c +@@ -457,6 +457,8 @@ static ssize_t export_store(struct class *class, + long gpio; + struct gpio_desc *desc; + int status; ++ struct gpio_chip *gc; ++ int offset; + + status = kstrtol(buf, 0, &gpio); + if (status < 0) +@@ -468,6 +470,12 @@ static ssize_t export_store(struct class *class, + pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); + return -EINVAL; + } ++ gc = desc->gdev->chip; ++ offset = gpio_chip_hwgpio(desc); ++ if (!gpiochip_line_is_valid(gc, offset)) { ++ pr_warn("%s: GPIO %ld masked\n", __func__, gpio); ++ return -EINVAL; ++ } + + /* No extra locking here; FLAG_SYSFS just signifies that the + * request and export were done by on behalf of userspace, so +-- +2.30.2 + diff --git a/queue-5.4/input-nspire-keypad-enable-interrupts-only-when-open.patch b/queue-5.4/input-nspire-keypad-enable-interrupts-only-when-open.patch new file mode 100644 index 00000000000..88ea72b841a --- /dev/null +++ b/queue-5.4/input-nspire-keypad-enable-interrupts-only-when-open.patch @@ -0,0 +1,121 @@ +From 7e9ea1e9610fa267df52e5da0225da9fe4e884a7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Mar 2021 10:45:55 -0700 +Subject: Input: nspire-keypad - enable interrupts only when opened + +From: Fabian Vogt + +[ Upstream commit 69d5ff3e9e51e23d5d81bf48480aa5671be67a71 ] + +The driver registers an interrupt handler in _probe, but didn't configure +them until later when the _open function is called. In between, the keypad +can fire an IRQ due to touchpad activity, which the handler ignores. This +causes the kernel to disable the interrupt, blocking the keypad from +working. + +Fix this by disabling interrupts before registering the handler. +Additionally, disable them in _close, so that they're only enabled while +open. + +Fixes: fc4f31461892 ("Input: add TI-Nspire keypad support") +Signed-off-by: Fabian Vogt +Link: https://lore.kernel.org/r/3383725.iizBOSrK1V@linux-e202.suse.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/keyboard/nspire-keypad.c | 56 ++++++++++++++------------ + 1 file changed, 31 insertions(+), 25 deletions(-) + +diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c +index 63d5e488137d..e9fa1423f136 100644 +--- a/drivers/input/keyboard/nspire-keypad.c ++++ b/drivers/input/keyboard/nspire-keypad.c +@@ -93,9 +93,15 @@ static irqreturn_t nspire_keypad_irq(int irq, void *dev_id) + return IRQ_HANDLED; + } + +-static int nspire_keypad_chip_init(struct nspire_keypad *keypad) ++static int nspire_keypad_open(struct input_dev *input) + { ++ struct nspire_keypad *keypad = input_get_drvdata(input); + unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles; ++ int error; ++ ++ error = clk_prepare_enable(keypad->clk); ++ if (error) ++ return error; + + cycles_per_us = (clk_get_rate(keypad->clk) / 1000000); + if (cycles_per_us == 0) +@@ -121,30 +127,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad) + keypad->int_mask = 1 << 1; + writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK); + +- /* Disable GPIO interrupts to prevent hanging on touchpad */ +- /* Possibly used to detect touchpad events */ +- writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); +- /* Acknowledge existing interrupts */ +- writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); +- +- return 0; +-} +- +-static int nspire_keypad_open(struct input_dev *input) +-{ +- struct nspire_keypad *keypad = input_get_drvdata(input); +- int error; +- +- error = clk_prepare_enable(keypad->clk); +- if (error) +- return error; +- +- error = nspire_keypad_chip_init(keypad); +- if (error) { +- clk_disable_unprepare(keypad->clk); +- return error; +- } +- + return 0; + } + +@@ -152,6 +134,11 @@ static void nspire_keypad_close(struct input_dev *input) + { + struct nspire_keypad *keypad = input_get_drvdata(input); + ++ /* Disable interrupts */ ++ writel(0, keypad->reg_base + KEYPAD_INTMSK); ++ /* Acknowledge existing interrupts */ ++ writel(~0, keypad->reg_base + KEYPAD_INT); ++ + clk_disable_unprepare(keypad->clk); + } + +@@ -210,6 +197,25 @@ static int nspire_keypad_probe(struct platform_device *pdev) + return -ENOMEM; + } + ++ error = clk_prepare_enable(keypad->clk); ++ if (error) { ++ dev_err(&pdev->dev, "failed to enable clock\n"); ++ return error; ++ } ++ ++ /* Disable interrupts */ ++ writel(0, keypad->reg_base + KEYPAD_INTMSK); ++ /* Acknowledge existing interrupts */ ++ writel(~0, keypad->reg_base + KEYPAD_INT); ++ ++ /* Disable GPIO interrupts to prevent hanging on touchpad */ ++ /* Possibly used to detect touchpad events */ ++ writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); ++ /* Acknowledge existing GPIO interrupts */ ++ writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); ++ ++ clk_disable_unprepare(keypad->clk); ++ + input_set_drvdata(input, keypad); + + input->id.bustype = BUS_HOST; +-- +2.30.2 + diff --git a/queue-5.4/lockdep-add-a-missing-initialization-hint-to-the-inf.patch b/queue-5.4/lockdep-add-a-missing-initialization-hint-to-the-inf.patch new file mode 100644 index 00000000000..6475db236b5 --- /dev/null +++ b/queue-5.4/lockdep-add-a-missing-initialization-hint-to-the-inf.patch @@ -0,0 +1,43 @@ +From c1757b64244c21d77fdc19b3c02260ea7ddb811b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 21 Mar 2021 15:49:13 +0900 +Subject: lockdep: Add a missing initialization hint to the "INFO: Trying to + register non-static key" message + +From: Tetsuo Handa + +[ Upstream commit 3a85969e9d912d5dd85362ee37b5f81266e00e77 ] + +Since this message is printed when dynamically allocated spinlocks (e.g. +kzalloc()) are used without initialization (e.g. spin_lock_init()), +suggest to developers to check whether initialization functions for objects +were called, before making developers wonder what annotation is missing. + +[ mingo: Minor tweaks to the message. ] + +Signed-off-by: Tetsuo Handa +Signed-off-by: Ingo Molnar +Link: https://lore.kernel.org/r/20210321064913.4619-1-penguin-kernel@I-love.SAKURA.ne.jp +Signed-off-by: Ingo Molnar +Signed-off-by: Sasha Levin +--- + kernel/locking/lockdep.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c +index bca0f7f71cde..7429f1571755 100644 +--- a/kernel/locking/lockdep.c ++++ b/kernel/locking/lockdep.c +@@ -875,7 +875,8 @@ static bool assign_lock_key(struct lockdep_map *lock) + /* Debug-check: all keys must be persistent! */ + debug_locks_off(); + pr_err("INFO: trying to register non-static key.\n"); +- pr_err("the code is fine but needs lockdep annotation.\n"); ++ pr_err("The code is fine but needs lockdep annotation, or maybe\n"); ++ pr_err("you didn't initialize this object before use?\n"); + pr_err("turning off the locking correctness validator.\n"); + dump_stack(); + return false; +-- +2.30.2 + diff --git a/queue-5.4/mac80211-clear-sta-fast_rx-when-sta-removed-from-4-a.patch b/queue-5.4/mac80211-clear-sta-fast_rx-when-sta-removed-from-4-a.patch new file mode 100644 index 00000000000..fcdb6b70c53 --- /dev/null +++ b/queue-5.4/mac80211-clear-sta-fast_rx-when-sta-removed-from-4-a.patch @@ -0,0 +1,70 @@ +From 1a97ecf3527b9f5735da3e12272fe12828739513 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Mar 2021 19:48:52 +0530 +Subject: mac80211: clear sta->fast_rx when STA removed from 4-addr VLAN + +From: Seevalamuthu Mariappan + +[ Upstream commit dd0b45538146cb6a54d6da7663b8c3afd16ebcfd ] + +In some race conditions, with more clients and traffic configuration, +below crash is seen when making the interface down. sta->fast_rx wasn't +cleared when STA gets removed from 4-addr AP_VLAN interface. The crash is +due to try accessing 4-addr AP_VLAN interface's net_device (fast_rx->dev) +which has been deleted already. + +Resolve this by clearing sta->fast_rx pointer when STA removes +from a 4-addr VLAN. + +[ 239.449529] Unable to handle kernel NULL pointer dereference at virtual address 00000004 +[ 239.449531] pgd = 80204000 +... +[ 239.481496] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.60 #227 +[ 239.481591] Hardware name: Generic DT based system +[ 239.487665] task: be05b700 ti: be08e000 task.ti: be08e000 +[ 239.492360] PC is at get_rps_cpu+0x2d4/0x31c +[ 239.497823] LR is at 0xbe08fc54 +... +[ 239.778574] [<80739740>] (get_rps_cpu) from [<8073cb10>] (netif_receive_skb_internal+0x8c/0xac) +[ 239.786722] [<8073cb10>] (netif_receive_skb_internal) from [<8073d578>] (napi_gro_receive+0x48/0xc4) +[ 239.795267] [<8073d578>] (napi_gro_receive) from [] (ieee80211_mark_rx_ba_filtered_frames+0xbcc/0x12d4 [mac80211]) +[ 239.804776] [] (ieee80211_mark_rx_ba_filtered_frames [mac80211]) from [] (ieee80211_rx_napi+0x7b8/0x8c8 [mac8 + 0211]) +[ 239.815857] [] (ieee80211_rx_napi [mac80211]) from [] (ath11k_dp_process_rx+0x7bc/0x8c8 [ath11k]) +[ 239.827757] [] (ath11k_dp_process_rx [ath11k]) from [] (ath11k_dp_service_srng+0x2c0/0x2e0 [ath11k]) +[ 239.838484] [] (ath11k_dp_service_srng [ath11k]) from [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll+0x20/0x84 [ath11k_ahb] + ) +[ 239.849419] [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll [ath11k_ahb]) from [<8073ce1c>] (net_rx_action+0xe0/0x28c) +[ 239.860945] [<8073ce1c>] (net_rx_action) from [<80324868>] (__do_softirq+0xe4/0x228) +[ 239.871269] [<80324868>] (__do_softirq) from [<80324c48>] (irq_exit+0x98/0x108) +[ 239.879080] [<80324c48>] (irq_exit) from [<8035c59c>] (__handle_domain_irq+0x90/0xb4) +[ 239.886114] [<8035c59c>] (__handle_domain_irq) from [<8030137c>] (gic_handle_irq+0x50/0x94) +[ 239.894100] [<8030137c>] (gic_handle_irq) from [<803024c0>] (__irq_svc+0x40/0x74) + +Signed-off-by: Seevalamuthu Mariappan +Link: https://lore.kernel.org/r/1616163532-3881-1-git-send-email-seevalam@codeaurora.org +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/cfg.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index 677928bf13d1..1b50bbf030ed 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -1670,8 +1670,10 @@ static int ieee80211_change_station(struct wiphy *wiphy, + } + + if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && +- sta->sdata->u.vlan.sta) ++ sta->sdata->u.vlan.sta) { ++ ieee80211_clear_fast_rx(sta); + RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL); ++ } + + if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) + ieee80211_vif_dec_num_mcast(sta->sdata); +-- +2.30.2 + diff --git a/queue-5.4/neighbour-disregard-dead-dst-in-neigh_update.patch b/queue-5.4/neighbour-disregard-dead-dst-in-neigh_update.patch new file mode 100644 index 00000000000..81172fc3977 --- /dev/null +++ b/queue-5.4/neighbour-disregard-dead-dst-in-neigh_update.patch @@ -0,0 +1,51 @@ +From 3c5cd5f6d0d4c8488fe10eb9be7e2fe46c0cdaeb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Mar 2021 14:33:37 -0400 +Subject: neighbour: Disregard DEAD dst in neigh_update + +From: Tong Zhu + +[ Upstream commit d47ec7a0a7271dda08932d6208e4ab65ab0c987c ] + +After a short network outage, the dst_entry is timed out and put +in DST_OBSOLETE_DEAD. We are in this code because arp reply comes +from this neighbour after network recovers. There is a potential +race condition that dst_entry is still in DST_OBSOLETE_DEAD. +With that, another neighbour lookup causes more harm than good. + +In best case all packets in arp_queue are lost. This is +counterproductive to the original goal of finding a better path +for those packets. + +I observed a worst case with 4.x kernel where a dst_entry in +DST_OBSOLETE_DEAD state is associated with loopback net_device. +It leads to an ethernet header with all zero addresses. +A packet with all zero source MAC address is quite deadly with +mac80211, ath9k and 802.11 block ack. It fails +ieee80211_find_sta_by_ifaddr in ath9k (xmit.c). Ath9k flushes tx +queue (ath_tx_complete_aggr). BAW (block ack window) is not +updated. BAW logic is damaged and ath9k transmission is disabled. + +Signed-off-by: Tong Zhu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/core/neighbour.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/core/neighbour.c b/net/core/neighbour.c +index 7080d708b7d0..6635b83113f8 100644 +--- a/net/core/neighbour.c ++++ b/net/core/neighbour.c +@@ -1379,7 +1379,7 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr, + * we can reinject the packet there. + */ + n2 = NULL; +- if (dst) { ++ if (dst && dst->obsolete != DST_OBSOLETE_DEAD) { + n2 = dst_neigh_lookup_skb(dst, skb); + if (n2) + n1 = n2; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-dev.patch b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-dev.patch new file mode 100644 index 00000000000..22738942fbb --- /dev/null +++ b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-dev.patch @@ -0,0 +1,38 @@ +From f9204bece579c29411d1896d381dfbc876ca28b5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:46 -0400 +Subject: net: ieee802154: forbid monitor for add llsec dev + +From: Alexander Aring + +[ Upstream commit 5303f956b05a2886ff42890908156afaec0f95ac ] + +This patch forbids to add llsec dev for monitor interfaces which we +don't support yet. Otherwise we will access llsec mib which isn't +initialized for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-8-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 97074180c2e5..797888b4b2ce 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1784,6 +1784,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info) + struct wpan_dev *wpan_dev = dev->ieee802154_ptr; + struct ieee802154_llsec_device dev_desc; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) ++ return -EOPNOTSUPP; ++ + if (ieee802154_llsec_parse_device(info->attrs[NL802154_ATTR_SEC_DEVICE], + &dev_desc) < 0) + return -EINVAL; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-devkey.patch b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-devkey.patch new file mode 100644 index 00000000000..f26b1166e3e --- /dev/null +++ b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-devkey.patch @@ -0,0 +1,38 @@ +From 9ab8c9fd3e2ff62f877201ac4ce60b2eba4540b2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:49 -0400 +Subject: net: ieee802154: forbid monitor for add llsec devkey + +From: Alexander Aring + +[ Upstream commit a347b3b394868fef15b16f143719df56184be81d ] + +This patch forbids to add llsec devkey for monitor interfaces which we +don't support yet. Otherwise we will access llsec mib which isn't +initialized for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-11-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 66785e1eb559..65987215dd0c 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1936,6 +1936,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info + struct ieee802154_llsec_device_key key; + __le64 extended_addr; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) ++ return -EOPNOTSUPP; ++ + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || + nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack) < 0) + return -EINVAL; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-key.patch b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-key.patch new file mode 100644 index 00000000000..5882396dcdf --- /dev/null +++ b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-key.patch @@ -0,0 +1,38 @@ +From a7addbe017e2bd1e41649d16bd7ae2de48bd86fe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:43 -0400 +Subject: net: ieee802154: forbid monitor for add llsec key + +From: Alexander Aring + +[ Upstream commit 08470c5453339369bd3d590c4cbb0b5961cdcbb6 ] + +This patch forbids to add llsec key for monitor interfaces which we +don't support yet. Otherwise we will access llsec mib which isn't +initialized for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-5-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 27e34aab09a6..0920f320b59b 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1573,6 +1573,9 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info) + struct ieee802154_llsec_key_id id = { }; + u32 commands[NL802154_CMD_FRAME_NR_IDS / 32] = { }; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) ++ return -EOPNOTSUPP; ++ + if (!info->attrs[NL802154_ATTR_SEC_KEY] || + nla_parse_nested_deprecated(attrs, NL802154_KEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_KEY], nl802154_key_policy, info->extack)) + return -EINVAL; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-seclevel.patch b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-seclevel.patch new file mode 100644 index 00000000000..a856fb685fc --- /dev/null +++ b/queue-5.4/net-ieee802154-forbid-monitor-for-add-llsec-seclevel.patch @@ -0,0 +1,38 @@ +From 763366427ab290b4c0f8133dacac85805faf1b57 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:52 -0400 +Subject: net: ieee802154: forbid monitor for add llsec seclevel + +From: Alexander Aring + +[ Upstream commit 9ec87e322428d4734ac647d1a8e507434086993d ] + +This patch forbids to add llsec seclevel for monitor interfaces which we +don't support yet. Otherwise we will access llsec mib which isn't +initialized for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-14-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 4dd936c7db8b..328bb9f5342e 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -2136,6 +2136,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb, + struct wpan_dev *wpan_dev = dev->ieee802154_ptr; + struct ieee802154_llsec_seclevel sl; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) ++ return -EOPNOTSUPP; ++ + if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL], + &sl) < 0) + return -EINVAL; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-dev.patch b/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-dev.patch new file mode 100644 index 00000000000..f4d1143fbdc --- /dev/null +++ b/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-dev.patch @@ -0,0 +1,38 @@ +From ba12e6cffad20c9d865723084a2821e2b2eb3b64 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:47 -0400 +Subject: net: ieee802154: forbid monitor for del llsec dev + +From: Alexander Aring + +[ Upstream commit ad8f9de1f3566686af35b1c6b43240726541da61 ] + +This patch forbids to del llsec dev for monitor interfaces which we +don't support yet. Otherwise we will access llsec mib which isn't +initialized for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-9-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 797888b4b2ce..4f6777193029 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1802,6 +1802,9 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info) + struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; + __le64 extended_addr; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) ++ return -EOPNOTSUPP; ++ + if (!info->attrs[NL802154_ATTR_SEC_DEVICE] || + nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack)) + return -EINVAL; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-devkey.patch b/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-devkey.patch new file mode 100644 index 00000000000..b38b220e2f3 --- /dev/null +++ b/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-devkey.patch @@ -0,0 +1,38 @@ +From 36d92e29a521283851ede8bcfdde9833774f5dd9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:50 -0400 +Subject: net: ieee802154: forbid monitor for del llsec devkey + +From: Alexander Aring + +[ Upstream commit 6fb8045319ef172dc88a8142e7f8b58c7608137e ] + +This patch forbids to del llsec devkey for monitor interfaces which we +don't support yet. Otherwise we will access llsec mib which isn't +initialized for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-12-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 65987215dd0c..0c43b951a33f 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1970,6 +1970,9 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info + struct ieee802154_llsec_device_key key; + __le64 extended_addr; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) ++ return -EOPNOTSUPP; ++ + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || + nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack)) + return -EINVAL; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-key.patch b/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-key.patch new file mode 100644 index 00000000000..151a360debb --- /dev/null +++ b/queue-5.4/net-ieee802154-forbid-monitor-for-del-llsec-key.patch @@ -0,0 +1,38 @@ +From cdc76ee4a23a7e1108c199aaa6bb65e7eb7062c4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:44 -0400 +Subject: net: ieee802154: forbid monitor for del llsec key + +From: Alexander Aring + +[ Upstream commit b6e2949544a183f590ae6f3ef2d1aaaa2c44e38a ] + +This patch forbids to del llsec key for monitor interfaces which we +don't support yet. Otherwise we will access llsec mib which isn't +initialized for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-6-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 0920f320b59b..7fdcbaecc4fd 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1625,6 +1625,9 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info) + struct nlattr *attrs[NL802154_KEY_ATTR_MAX + 1]; + struct ieee802154_llsec_key_id id; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) ++ return -EOPNOTSUPP; ++ + if (!info->attrs[NL802154_ATTR_SEC_KEY] || + nla_parse_nested_deprecated(attrs, NL802154_KEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_KEY], nl802154_key_policy, info->extack)) + return -EINVAL; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-stop-dump-llsec-devkeys-for-monitors.patch b/queue-5.4/net-ieee802154-stop-dump-llsec-devkeys-for-monitors.patch new file mode 100644 index 00000000000..3b4955cf93e --- /dev/null +++ b/queue-5.4/net-ieee802154-stop-dump-llsec-devkeys-for-monitors.patch @@ -0,0 +1,40 @@ +From d39f236eaecc1bf2df7b8308a29986a046b97c49 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:48 -0400 +Subject: net: ieee802154: stop dump llsec devkeys for monitors + +From: Alexander Aring + +[ Upstream commit 080d1a57a94d93e70f84b7a360baa351388c574f ] + +This patch stops dumping llsec devkeys for monitors which we don't support +yet. Otherwise we will access llsec mib which isn't initialized for +monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-10-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 4f6777193029..66785e1eb559 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1874,6 +1874,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb) + if (err) + return err; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { ++ err = skb->len; ++ goto out_err; ++ } ++ + if (!wpan_dev->netdev) { + err = -EINVAL; + goto out_err; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-stop-dump-llsec-devs-for-monitors.patch b/queue-5.4/net-ieee802154-stop-dump-llsec-devs-for-monitors.patch new file mode 100644 index 00000000000..07a436d08a9 --- /dev/null +++ b/queue-5.4/net-ieee802154-stop-dump-llsec-devs-for-monitors.patch @@ -0,0 +1,40 @@ +From a1a0e5ab135641af4ef3ec89efb82207e9b0c0b2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:45 -0400 +Subject: net: ieee802154: stop dump llsec devs for monitors + +From: Alexander Aring + +[ Upstream commit 5582d641e6740839c9b83efd1fbf9bcd00b6f5fc ] + +This patch stops dumping llsec devs for monitors which we don't support +yet. Otherwise we will access llsec mib which isn't initialized for +monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-7-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 7fdcbaecc4fd..97074180c2e5 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1693,6 +1693,11 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb) + if (err) + return err; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { ++ err = skb->len; ++ goto out_err; ++ } ++ + if (!wpan_dev->netdev) { + err = -EINVAL; + goto out_err; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-stop-dump-llsec-keys-for-monitors.patch b/queue-5.4/net-ieee802154-stop-dump-llsec-keys-for-monitors.patch new file mode 100644 index 00000000000..ff73fc206e5 --- /dev/null +++ b/queue-5.4/net-ieee802154-stop-dump-llsec-keys-for-monitors.patch @@ -0,0 +1,40 @@ +From 66ba7e7d1de776a1f295e58120667bb7629b07f6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:42 -0400 +Subject: net: ieee802154: stop dump llsec keys for monitors + +From: Alexander Aring + +[ Upstream commit fb3c5cdf88cd504ef11d59e8d656f4bc896c6922 ] + +This patch stops dumping llsec keys for monitors which we don't support +yet. Otherwise we will access llsec mib which isn't initialized for +monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-4-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index f03958fcb5be..27e34aab09a6 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -1514,6 +1514,11 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb) + if (err) + return err; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { ++ err = skb->len; ++ goto out_err; ++ } ++ + if (!wpan_dev->netdev) { + err = -EINVAL; + goto out_err; +-- +2.30.2 + diff --git a/queue-5.4/net-ieee802154-stop-dump-llsec-seclevels-for-monitor.patch b/queue-5.4/net-ieee802154-stop-dump-llsec-seclevels-for-monitor.patch new file mode 100644 index 00000000000..992abef1bb6 --- /dev/null +++ b/queue-5.4/net-ieee802154-stop-dump-llsec-seclevels-for-monitor.patch @@ -0,0 +1,40 @@ +From ec4b172cc2ac5d87ab392088fe61683554778d98 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 4 Apr 2021 20:30:51 -0400 +Subject: net: ieee802154: stop dump llsec seclevels for monitors + +From: Alexander Aring + +[ Upstream commit 4c9b4f55ad1f5a4b6206ac4ea58f273126d21925 ] + +This patch stops dumping llsec seclevels for monitors which we don't +support yet. Otherwise we will access llsec mib which isn't initialized +for monitors. + +Signed-off-by: Alexander Aring +Link: https://lore.kernel.org/r/20210405003054.256017-13-aahringo@redhat.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + net/ieee802154/nl802154.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c +index 0c43b951a33f..4dd936c7db8b 100644 +--- a/net/ieee802154/nl802154.c ++++ b/net/ieee802154/nl802154.c +@@ -2047,6 +2047,11 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb) + if (err) + return err; + ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { ++ err = skb->len; ++ goto out_err; ++ } ++ + if (!wpan_dev->netdev) { + err = -EINVAL; + goto out_err; +-- +2.30.2 + diff --git a/queue-5.4/net-rds-avoid-potential-use-after-free-in-rds_send_r.patch b/queue-5.4/net-rds-avoid-potential-use-after-free-in-rds_send_r.patch new file mode 100644 index 00000000000..79137929c22 --- /dev/null +++ b/queue-5.4/net-rds-avoid-potential-use-after-free-in-rds_send_r.patch @@ -0,0 +1,50 @@ +From 9879523df9063eab9b389b1e7934f0ff23c4bb7a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Apr 2021 19:09:12 -0500 +Subject: net/rds: Avoid potential use after free in rds_send_remove_from_sock + +From: Aditya Pakki + +[ Upstream commit 0c85a7e87465f2d4cbc768e245f4f45b2f299b05 ] + +In case of rs failure in rds_send_remove_from_sock(), the 'rm' resource +is freed and later under spinlock, causing potential use-after-free. +Set the free pointer to NULL to avoid undefined behavior. + +Signed-off-by: Aditya Pakki +Acked-by: Santosh Shilimkar +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/rds/message.c | 1 + + net/rds/send.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/rds/message.c b/net/rds/message.c +index 92b6b22884d4..ed1d2255ce5a 100644 +--- a/net/rds/message.c ++++ b/net/rds/message.c +@@ -180,6 +180,7 @@ void rds_message_put(struct rds_message *rm) + rds_message_purge(rm); + + kfree(rm); ++ rm = NULL; + } + } + EXPORT_SYMBOL_GPL(rds_message_put); +diff --git a/net/rds/send.c b/net/rds/send.c +index 68e2bdb08fd0..aa3bc081773f 100644 +--- a/net/rds/send.c ++++ b/net/rds/send.c +@@ -665,7 +665,7 @@ static void rds_send_remove_from_sock(struct list_head *messages, int status) + unlock_and_drop: + spin_unlock_irqrestore(&rm->m_rs_lock, flags); + rds_message_put(rm); +- if (was_on_sock) ++ if (was_on_sock && rm) + rds_message_put(rm); + } + +-- +2.30.2 + diff --git a/queue-5.4/net-tipc-fix-spelling-errors-in-net-tipc-module.patch b/queue-5.4/net-tipc-fix-spelling-errors-in-net-tipc-module.patch new file mode 100644 index 00000000000..63a71b99d45 --- /dev/null +++ b/queue-5.4/net-tipc-fix-spelling-errors-in-net-tipc-module.patch @@ -0,0 +1,67 @@ +From 0ab429dae48c96c5235d8326c566fd5de49f6abc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Apr 2021 09:59:45 +0800 +Subject: net: tipc: Fix spelling errors in net/tipc module + +From: Zheng Yongjun + +[ Upstream commit a79ace4b312953c5835fafb12adc3cb6878b26bd ] + +These patches fix a series of spelling errors in net/tipc module. + +Reported-by: Hulk Robot +Signed-off-by: Zheng Yongjun +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/tipc/bearer.h | 6 +++--- + net/tipc/net.c | 2 +- + net/tipc/node.c | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h +index ea0f3c49cbed..a7b4cf66dfc2 100644 +--- a/net/tipc/bearer.h ++++ b/net/tipc/bearer.h +@@ -149,9 +149,9 @@ struct tipc_media { + * care of initializing all other fields. + */ + struct tipc_bearer { +- void __rcu *media_ptr; /* initalized by media */ +- u32 mtu; /* initalized by media */ +- struct tipc_media_addr addr; /* initalized by media */ ++ void __rcu *media_ptr; /* initialized by media */ ++ u32 mtu; /* initialized by media */ ++ struct tipc_media_addr addr; /* initialized by media */ + char name[TIPC_MAX_BEARER_NAME]; + struct tipc_media *media; + struct tipc_media_addr bcast_addr; +diff --git a/net/tipc/net.c b/net/tipc/net.c +index 2498ce8b83c1..2600be4b0d89 100644 +--- a/net/tipc/net.c ++++ b/net/tipc/net.c +@@ -89,7 +89,7 @@ + * - A spin lock to protect the registry of kernel/driver users (reg.c) + * - A global spin_lock (tipc_port_lock), which only task is to ensure + * consistency where more than one port is involved in an operation, +- * i.e., whe a port is part of a linked list of ports. ++ * i.e., when a port is part of a linked list of ports. + * There are two such lists; 'port_list', which is used for management, + * and 'wait_list', which is used to queue ports during congestion. + * +diff --git a/net/tipc/node.c b/net/tipc/node.c +index c8f6177dd5a2..47f7c8e856c6 100644 +--- a/net/tipc/node.c ++++ b/net/tipc/node.c +@@ -1482,7 +1482,7 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head *list, + } + + /* tipc_node_xmit_skb(): send single buffer to destination +- * Buffers sent via this functon are generally TIPC_SYSTEM_IMPORTANCE ++ * Buffers sent via this function are generally TIPC_SYSTEM_IMPORTANCE + * messages, which will not be rejected + * The only exception is datagram messages rerouted after secondary + * lookup, which are rare and safe to dispose of anyway. +-- +2.30.2 + diff --git a/queue-5.4/pcnet32-use-pci_resource_len-to-validate-pci-resourc.patch b/queue-5.4/pcnet32-use-pci_resource_len-to-validate-pci-resourc.patch new file mode 100644 index 00000000000..90b3faeaa80 --- /dev/null +++ b/queue-5.4/pcnet32-use-pci_resource_len-to-validate-pci-resourc.patch @@ -0,0 +1,54 @@ +From 395c790320803aad85e27bd86665f1d8db63138b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Apr 2021 21:29:22 -0700 +Subject: pcnet32: Use pci_resource_len to validate PCI resource + +From: Guenter Roeck + +[ Upstream commit 66c3f05ddc538ee796321210c906b6ae6fc0792a ] + +pci_resource_start() is not a good indicator to determine if a PCI +resource exists or not, since the resource may start at address 0. +This is seen when trying to instantiate the driver in qemu for riscv32 +or riscv64. + +pci 0000:00:01.0: reg 0x10: [io 0x0000-0x001f] +pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x0000001f] +... +pcnet32: card has no PCI IO resources, aborting + +Use pci_resouce_len() instead. + +Signed-off-by: Guenter Roeck +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/amd/pcnet32.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c +index f5ad12c10934..da84660ceae1 100644 +--- a/drivers/net/ethernet/amd/pcnet32.c ++++ b/drivers/net/ethernet/amd/pcnet32.c +@@ -1548,8 +1548,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) + } + pci_set_master(pdev); + +- ioaddr = pci_resource_start(pdev, 0); +- if (!ioaddr) { ++ if (!pci_resource_len(pdev, 0)) { + if (pcnet32_debug & NETIF_MSG_PROBE) + pr_err("card has no PCI IO resources, aborting\n"); + err = -ENODEV; +@@ -1562,6 +1561,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) + pr_err("architecture does not support 32bit PCI busmaster DMA\n"); + goto err_disable_dev; + } ++ ++ ioaddr = pci_resource_start(pdev, 0); + if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) { + if (pcnet32_debug & NETIF_MSG_PROBE) + pr_err("io address range already allocated\n"); +-- +2.30.2 + diff --git a/queue-5.4/scsi-scsi_transport_srp-don-t-block-target-in-srp_po.patch b/queue-5.4/scsi-scsi_transport_srp-don-t-block-target-in-srp_po.patch new file mode 100644 index 00000000000..36ab957349e --- /dev/null +++ b/queue-5.4/scsi-scsi_transport_srp-don-t-block-target-in-srp_po.patch @@ -0,0 +1,52 @@ +From 6b5e0fdd3e8963664d1fa49739ffa33b3b6af400 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 1 Apr 2021 11:11:05 +0200 +Subject: scsi: scsi_transport_srp: Don't block target in SRP_PORT_LOST state + +From: Martin Wilck + +[ Upstream commit 5cd0f6f57639c5afbb36100c69281fee82c95ee7 ] + +rport_dev_loss_timedout() sets the rport state to SRP_PORT_LOST and the +SCSI target state to SDEV_TRANSPORT_OFFLINE. If this races with +srp_reconnect_work(), a warning is printed: + +Mar 27 18:48:07 ictm1604s01h4 kernel: dev_loss_tmo expired for SRP port-18:1 / host18. +Mar 27 18:48:07 ictm1604s01h4 kernel: ------------[ cut here ]------------ +Mar 27 18:48:07 ictm1604s01h4 kernel: scsi_internal_device_block(18:0:0:100) failed: ret = -22 +Mar 27 18:48:07 ictm1604s01h4 kernel: Call Trace: +Mar 27 18:48:07 ictm1604s01h4 kernel: ? scsi_target_unblock+0x50/0x50 [scsi_mod] +Mar 27 18:48:07 ictm1604s01h4 kernel: starget_for_each_device+0x80/0xb0 [scsi_mod] +Mar 27 18:48:07 ictm1604s01h4 kernel: target_block+0x24/0x30 [scsi_mod] +Mar 27 18:48:07 ictm1604s01h4 kernel: device_for_each_child+0x57/0x90 +Mar 27 18:48:07 ictm1604s01h4 kernel: srp_reconnect_rport+0xe4/0x230 [scsi_transport_srp] +Mar 27 18:48:07 ictm1604s01h4 kernel: srp_reconnect_work+0x40/0xc0 [scsi_transport_srp] + +Avoid this by not trying to block targets for rports in SRP_PORT_LOST +state. + +Link: https://lore.kernel.org/r/20210401091105.8046-1-mwilck@suse.com +Reviewed-by: Bart Van Assche +Signed-off-by: Martin Wilck +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/scsi_transport_srp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c +index 8cd0a87764df..9fee851c23a5 100644 +--- a/drivers/scsi/scsi_transport_srp.c ++++ b/drivers/scsi/scsi_transport_srp.c +@@ -541,7 +541,7 @@ int srp_reconnect_rport(struct srp_rport *rport) + res = mutex_lock_interruptible(&rport->mutex); + if (res) + goto out; +- if (rport->state != SRP_RPORT_FAIL_FAST) ++ if (rport->state != SRP_RPORT_FAIL_FAST && rport->state != SRP_RPORT_LOST) + /* + * sdev state must be SDEV_TRANSPORT_OFFLINE, transition + * to SDEV_BLOCK is illegal. Calling scsi_target_unblock() +-- +2.30.2 + diff --git a/queue-5.4/series b/queue-5.4/series index 82b598feb5a..08db02912bc 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -6,3 +6,33 @@ scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-failure.patch scsi-qla2xxx-add-a-shadow-variable-to-hold-disc_stat.patch scsi-qla2xxx-fix-stuck-login-session-using-prli_pend.patch scsi-qla2xxx-fix-fabric-scan-hang.patch +input-nspire-keypad-enable-interrupts-only-when-open.patch +gpio-sysfs-obey-valid_mask.patch +dmaengine-dw-make-it-dependent-to-has_iomem.patch +arm-dts-drop-duplicate-sha2md5_fck-to-fix-clk_disabl.patch +arm-dts-fix-moving-mmc-devices-with-aliases-for-omap.patch +lockdep-add-a-missing-initialization-hint-to-the-inf.patch +arc-kernel-return-efault-if-copy_to_user-fails.patch +asoc-max98373-added-30ms-turn-on-off-time-delay.patch +neighbour-disregard-dead-dst-in-neigh_update.patch +arm-keystone-fix-integer-overflow-warning.patch +arm-omap1-fix-building-with-clang-ias.patch +drm-msm-fix-a5xx-a6xx-timestamps.patch +asoc-fsl_esai-fix-tdm-slot-setup-for-i2s-mode.patch +scsi-scsi_transport_srp-don-t-block-target-in-srp_po.patch +net-ieee802154-stop-dump-llsec-keys-for-monitors.patch +net-ieee802154-forbid-monitor-for-add-llsec-key.patch +net-ieee802154-forbid-monitor-for-del-llsec-key.patch +net-ieee802154-stop-dump-llsec-devs-for-monitors.patch +net-ieee802154-forbid-monitor-for-add-llsec-dev.patch +net-ieee802154-forbid-monitor-for-del-llsec-dev.patch +net-ieee802154-stop-dump-llsec-devkeys-for-monitors.patch +net-ieee802154-forbid-monitor-for-add-llsec-devkey.patch +net-ieee802154-forbid-monitor-for-del-llsec-devkey.patch +net-ieee802154-stop-dump-llsec-seclevels-for-monitor.patch +net-ieee802154-forbid-monitor-for-add-llsec-seclevel.patch +pcnet32-use-pci_resource_len-to-validate-pci-resourc.patch +net-rds-avoid-potential-use-after-free-in-rds_send_r.patch +net-tipc-fix-spelling-errors-in-net-tipc-module.patch +mac80211-clear-sta-fast_rx-when-sta-removed-from-4-a.patch +virt_wifi-return-micros-for-bss-tsf-values.patch diff --git a/queue-5.4/virt_wifi-return-micros-for-bss-tsf-values.patch b/queue-5.4/virt_wifi-return-micros-for-bss-tsf-values.patch new file mode 100644 index 00000000000..60c5e685641 --- /dev/null +++ b/queue-5.4/virt_wifi-return-micros-for-bss-tsf-values.patch @@ -0,0 +1,50 @@ +From 43fc07528387738d7b9281306de554e6d5c4b28d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Mar 2021 13:04:19 -0700 +Subject: virt_wifi: Return micros for BSS TSF values + +From: A. Cody Schuffelen + +[ Upstream commit b57aa17f07c9270e576ef7df09f142978b5a75f0 ] + +cfg80211_inform_bss expects to receive a TSF value, but is given the +time since boot in nanoseconds. TSF values are expected to be at +microsecond scale rather than nanosecond scale. + +Signed-off-by: A. Cody Schuffelen +Link: https://lore.kernel.org/r/20210318200419.1421034-1-schuffelen@google.com +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/virt_wifi.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c +index 01305ba2d3aa..9d04ca53229b 100644 +--- a/drivers/net/wireless/virt_wifi.c ++++ b/drivers/net/wireless/virt_wifi.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + + static struct wiphy *common_wiphy; +@@ -168,11 +169,11 @@ static void virt_wifi_scan_result(struct work_struct *work) + scan_result.work); + struct wiphy *wiphy = priv_to_wiphy(priv); + struct cfg80211_scan_info scan_info = { .aborted = false }; ++ u64 tsf = div_u64(ktime_get_boottime_ns(), 1000); + + informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz, + CFG80211_BSS_FTYPE_PRESP, +- fake_router_bssid, +- ktime_get_boottime_ns(), ++ fake_router_bssid, tsf, + WLAN_CAPABILITY_ESS, 0, + (void *)&ssid, sizeof(ssid), + DBM_TO_MBM(-50), GFP_KERNEL); +-- +2.30.2 + -- 2.47.3