]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Dec 2020 14:21:36 +0000 (15:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Dec 2020 14:21:36 +0000 (15:21 +0100)
added patches:
input-cm109-do-not-stomp-on-control-urb.patch
input-i8042-add-acer-laptops-to-the-i8042-reset-list.patch
kbuild-avoid-static_assert-for-genksyms.patch
pinctrl-amd-remove-debounce-filter-setting-in-irq-type-setting.patch
scsi-be2iscsi-revert-fix-a-theoretical-leak-in-beiscsi_create_eqs.patch
x86-mm-mem_encrypt-fix-definition-of-pmd_flags_dec_wp.patch

queue-4.14/input-cm109-do-not-stomp-on-control-urb.patch [new file with mode: 0644]
queue-4.14/input-i8042-add-acer-laptops-to-the-i8042-reset-list.patch [new file with mode: 0644]
queue-4.14/kbuild-avoid-static_assert-for-genksyms.patch [new file with mode: 0644]
queue-4.14/pinctrl-amd-remove-debounce-filter-setting-in-irq-type-setting.patch [new file with mode: 0644]
queue-4.14/scsi-be2iscsi-revert-fix-a-theoretical-leak-in-beiscsi_create_eqs.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/x86-mm-mem_encrypt-fix-definition-of-pmd_flags_dec_wp.patch [new file with mode: 0644]

diff --git a/queue-4.14/input-cm109-do-not-stomp-on-control-urb.patch b/queue-4.14/input-cm109-do-not-stomp-on-control-urb.patch
new file mode 100644 (file)
index 0000000..0d47735
--- /dev/null
@@ -0,0 +1,42 @@
+From 82e06090473289ce63e23fdeb8737aad59b10645 Mon Sep 17 00:00:00 2001
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Date: Wed, 9 Dec 2020 20:13:24 -0800
+Subject: Input: cm109 - do not stomp on control URB
+
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+commit 82e06090473289ce63e23fdeb8737aad59b10645 upstream.
+
+We need to make sure we are not stomping on the control URB that was
+issued when opening the device when attempting to toggle buzzer.
+To do that we need to mark it as pending in cm109_open().
+
+Reported-and-tested-by: syzbot+150f793ac5bc18eee150@syzkaller.appspotmail.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/misc/cm109.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/input/misc/cm109.c
++++ b/drivers/input/misc/cm109.c
+@@ -571,12 +571,15 @@ static int cm109_input_open(struct input
+       dev->ctl_data->byte[HID_OR2] = dev->keybit;
+       dev->ctl_data->byte[HID_OR3] = 0x00;
++      dev->ctl_urb_pending = 1;
+       error = usb_submit_urb(dev->urb_ctl, GFP_KERNEL);
+-      if (error)
++      if (error) {
++              dev->ctl_urb_pending = 0;
+               dev_err(&dev->intf->dev, "%s: usb_submit_urb (urb_ctl) failed %d\n",
+                       __func__, error);
+-      else
++      } else {
+               dev->open = 1;
++      }
+       mutex_unlock(&dev->pm_mutex);
diff --git a/queue-4.14/input-i8042-add-acer-laptops-to-the-i8042-reset-list.patch b/queue-4.14/input-i8042-add-acer-laptops-to-the-i8042-reset-list.patch
new file mode 100644 (file)
index 0000000..b503926
--- /dev/null
@@ -0,0 +1,74 @@
+From ce6520b0eafad5962ffc21dc47cd7bd3250e9045 Mon Sep 17 00:00:00 2001
+From: Chris Chiu <chiu@endlessos.org>
+Date: Wed, 9 Dec 2020 20:24:47 -0800
+Subject: Input: i8042 - add Acer laptops to the i8042 reset list
+
+From: Chris Chiu <chiu@endlessos.org>
+
+commit ce6520b0eafad5962ffc21dc47cd7bd3250e9045 upstream.
+
+The touchpad operates in Basic Mode by default in the Acer BIOS
+setup, but some Aspire/TravelMate models require the i8042 to be
+reset in order to be correctly detected.
+
+Signed-off-by: Chris Chiu <chiu@endlessos.org>
+Link: https://lore.kernel.org/r/20201207071250.15021-1-chiu@endlessos.org
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/serio/i8042-x86ia64io.h |   42 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+--- a/drivers/input/serio/i8042-x86ia64io.h
++++ b/drivers/input/serio/i8042-x86ia64io.h
+@@ -616,6 +616,48 @@ static const struct dmi_system_id __init
+               },
+       },
+       {
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
++              },
++      },
++      {
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
++              },
++      },
++      {
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
++              },
++      },
++      {
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
++              },
++      },
++      {
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
++              },
++      },
++      {
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
++              },
++      },
++      {
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
++              },
++      },
++      {
+               /* Advent 4211 */
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
diff --git a/queue-4.14/kbuild-avoid-static_assert-for-genksyms.patch b/queue-4.14/kbuild-avoid-static_assert-for-genksyms.patch
new file mode 100644 (file)
index 0000000..055fd42
--- /dev/null
@@ -0,0 +1,48 @@
+From 14dc3983b5dff513a90bd5a8cc90acaf7867c3d0 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Fri, 11 Dec 2020 13:36:38 -0800
+Subject: kbuild: avoid static_assert for genksyms
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 14dc3983b5dff513a90bd5a8cc90acaf7867c3d0 upstream.
+
+genksyms does not know or care about the _Static_assert() built-in, and
+sometimes falls back to ignoring the later symbols, which causes
+undefined behavior such as
+
+  WARNING: modpost: EXPORT symbol "ethtool_set_ethtool_phy_ops" [vmlinux] version generation failed, symbol will not be versioned.
+  ld: net/ethtool/common.o: relocation R_AARCH64_ABS32 against `__crc_ethtool_set_ethtool_phy_ops' can not be used when making a shared object
+  net/ethtool/common.o:(_ftrace_annotated_branch+0x0): dangerous relocation: unsupported relocation
+
+Redefine static_assert for genksyms to avoid that.
+
+Link: https://lkml.kernel.org/r/20201203230955.1482058-1-arnd@kernel.org
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Suggested-by: Ard Biesheuvel <ardb@kernel.org>
+Cc: Masahiro Yamada <masahiroy@kernel.org>
+Cc: Michal Marek <michal.lkml@markovi.net>
+Cc: Kees Cook <keescook@chromium.org>
+Cc: Rikard Falkeborn <rikard.falkeborn@gmail.com>
+Cc: Marco Elver <elver@google.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/build_bug.h |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/include/linux/build_bug.h
++++ b/include/linux/build_bug.h
+@@ -82,4 +82,9 @@
+ #endif        /* __CHECKER__ */
++#ifdef __GENKSYMS__
++/* genksyms gets confused by _Static_assert */
++#define _Static_assert(expr, ...)
++#endif
++
+ #endif        /* _LINUX_BUILD_BUG_H */
diff --git a/queue-4.14/pinctrl-amd-remove-debounce-filter-setting-in-irq-type-setting.patch b/queue-4.14/pinctrl-amd-remove-debounce-filter-setting-in-irq-type-setting.patch
new file mode 100644 (file)
index 0000000..00731aa
--- /dev/null
@@ -0,0 +1,93 @@
+From 47a0001436352c9853d72bf2071e85b316d688a2 Mon Sep 17 00:00:00 2001
+From: Coiby Xu <coiby.xu@gmail.com>
+Date: Wed, 25 Nov 2020 21:03:19 +0800
+Subject: pinctrl: amd: remove debounce filter setting in IRQ type setting
+
+From: Coiby Xu <coiby.xu@gmail.com>
+
+commit 47a0001436352c9853d72bf2071e85b316d688a2 upstream.
+
+Debounce filter setting should be independent from IRQ type setting
+because according to the ACPI specs, there are separate arguments for
+specifying debounce timeout and IRQ type in GpioIo() and GpioInt().
+
+Together with commit 06abe8291bc31839950f7d0362d9979edc88a666
+("pinctrl: amd: fix incorrect way to disable debounce filter") and
+Andy's patch "gpiolib: acpi: Take into account debounce settings" [1],
+this will fix broken touchpads for laptops whose BIOS set the
+debounce timeout to a relatively large value. For example, the BIOS
+of Lenovo AMD gaming laptops including Legion-5 15ARH05 (R7000),
+Legion-5P (R7000P) and IdeaPad Gaming 3 15ARH05, set the debounce
+timeout to 124.8ms. This led to the kernel receiving only ~7 HID
+reports per second from the Synaptics touchpad
+(MSFT0001:00 06CB:7F28).
+
+Existing touchpads like [2][3] are not troubled by this bug because
+the debounce timeout has been set to 0 by the BIOS before enabling
+the debounce filter in setting IRQ type.
+
+[1] https://lore.kernel.org/linux-gpio/20201111222008.39993-11-andriy.shevchenko@linux.intel.com/
+    8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings")
+[2] https://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582
+[3] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28
+
+Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
+Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
+Cc: Hans de Goede <hdegoede@redhat.com>
+Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
+Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/
+BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190
+Link: https://lore.kernel.org/r/20201125130320.311059-1-coiby.xu@gmail.com
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/pinctrl-amd.c |    7 -------
+ 1 file changed, 7 deletions(-)
+
+--- a/drivers/pinctrl/pinctrl-amd.c
++++ b/drivers/pinctrl/pinctrl-amd.c
+@@ -426,7 +426,6 @@ static int amd_gpio_irq_set_type(struct
+               pin_reg &= ~BIT(LEVEL_TRIG_OFF);
+               pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
+               pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
+-              pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
+               irq_set_handler_locked(d, handle_edge_irq);
+               break;
+@@ -434,7 +433,6 @@ static int amd_gpio_irq_set_type(struct
+               pin_reg &= ~BIT(LEVEL_TRIG_OFF);
+               pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
+               pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
+-              pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
+               irq_set_handler_locked(d, handle_edge_irq);
+               break;
+@@ -442,7 +440,6 @@ static int amd_gpio_irq_set_type(struct
+               pin_reg &= ~BIT(LEVEL_TRIG_OFF);
+               pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
+               pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
+-              pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
+               irq_set_handler_locked(d, handle_edge_irq);
+               break;
+@@ -450,8 +447,6 @@ static int amd_gpio_irq_set_type(struct
+               pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
+               pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
+               pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
+-              pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
+-              pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;
+               irq_set_handler_locked(d, handle_level_irq);
+               break;
+@@ -459,8 +454,6 @@ static int amd_gpio_irq_set_type(struct
+               pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
+               pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
+               pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
+-              pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
+-              pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
+               irq_set_handler_locked(d, handle_level_irq);
+               break;
diff --git a/queue-4.14/scsi-be2iscsi-revert-fix-a-theoretical-leak-in-beiscsi_create_eqs.patch b/queue-4.14/scsi-be2iscsi-revert-fix-a-theoretical-leak-in-beiscsi_create_eqs.patch
new file mode 100644 (file)
index 0000000..628c88f
--- /dev/null
@@ -0,0 +1,61 @@
+From eeaf06af6f87e1dba371fbe42674e6f963220b9c Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 3 Dec 2020 15:18:26 +0300
+Subject: scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit eeaf06af6f87e1dba371fbe42674e6f963220b9c upstream.
+
+My patch caused kernel Oopses and delays in boot.  Revert it.
+
+The problem was that I moved the "mem->dma = paddr;" before the call to
+be_fill_queue().  But the first thing that the be_fill_queue() function
+does is memset the whole struct to zero which overwrites the assignment.
+
+Link: https://lore.kernel.org/r/X8jXkt6eThjyVP1v@mwanda
+Fixes: 38b2db564d9a ("scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()")
+Cc: stable <stable@vger.kernel.org>
+Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/be2iscsi/be_main.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/be2iscsi/be_main.c
++++ b/drivers/scsi/be2iscsi/be_main.c
+@@ -3013,7 +3013,6 @@ static int beiscsi_create_eqs(struct bei
+                       goto create_eq_error;
+               }
+-              mem->dma = paddr;
+               mem->va = eq_vaddress;
+               ret = be_fill_queue(eq, phba->params.num_eq_entries,
+                                   sizeof(struct be_eq_entry), eq_vaddress);
+@@ -3023,6 +3022,7 @@ static int beiscsi_create_eqs(struct bei
+                       goto create_eq_error;
+               }
++              mem->dma = paddr;
+               ret = beiscsi_cmd_eq_create(&phba->ctrl, eq,
+                                           phwi_context->cur_eqd);
+               if (ret) {
+@@ -3079,7 +3079,6 @@ static int beiscsi_create_cqs(struct bei
+                       goto create_cq_error;
+               }
+-              mem->dma = paddr;
+               ret = be_fill_queue(cq, phba->params.num_cq_entries,
+                                   sizeof(struct sol_cqe), cq_vaddress);
+               if (ret) {
+@@ -3089,6 +3088,7 @@ static int beiscsi_create_cqs(struct bei
+                       goto create_cq_error;
+               }
++              mem->dma = paddr;
+               ret = beiscsi_cmd_cq_create(&phba->ctrl, cq, eq, false,
+                                           false, 0);
+               if (ret) {
index faac89f7cab6218a2376aad0f122f4d6b6f4a6a1..ec4b0e1ba3bcc79b81205b0a86dcdbf26fc0af9f 100644 (file)
@@ -7,3 +7,9 @@ arc-stack-unwinding-don-t-assume-non-current-task-is.patch
 scsi-ufs-make-sure-clk-scaling-happens-only-when-hba.patch
 soc-fsl-dpio-get-the-cpumask-through-cpumask_of-cpu.patch
 platform-x86-acer-wmi-add-automatic-keyboard-backgro.patch
+input-cm109-do-not-stomp-on-control-urb.patch
+input-i8042-add-acer-laptops-to-the-i8042-reset-list.patch
+pinctrl-amd-remove-debounce-filter-setting-in-irq-type-setting.patch
+kbuild-avoid-static_assert-for-genksyms.patch
+scsi-be2iscsi-revert-fix-a-theoretical-leak-in-beiscsi_create_eqs.patch
+x86-mm-mem_encrypt-fix-definition-of-pmd_flags_dec_wp.patch
diff --git a/queue-4.14/x86-mm-mem_encrypt-fix-definition-of-pmd_flags_dec_wp.patch b/queue-4.14/x86-mm-mem_encrypt-fix-definition-of-pmd_flags_dec_wp.patch
new file mode 100644 (file)
index 0000000..6e8617d
--- /dev/null
@@ -0,0 +1,53 @@
+From 29ac40cbed2bc06fa218ca25d7f5e280d3d08a25 Mon Sep 17 00:00:00 2001
+From: Arvind Sankar <nivedita@alum.mit.edu>
+Date: Wed, 11 Nov 2020 11:09:45 -0500
+Subject: x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
+
+From: Arvind Sankar <nivedita@alum.mit.edu>
+
+commit 29ac40cbed2bc06fa218ca25d7f5e280d3d08a25 upstream.
+
+The PAT bit is in different locations for 4k and 2M/1G page table
+entries.
+
+Add a definition for _PAGE_LARGE_CACHE_MASK to represent the three
+caching bits (PWT, PCD, PAT), similar to _PAGE_CACHE_MASK for 4k pages,
+and use it in the definition of PMD_FLAGS_DEC_WP to get the correct PAT
+index for write-protected pages.
+
+Fixes: 6ebcb060713f ("x86/mm: Add support to encrypt the kernel in-place")
+Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
+Cc: stable@vger.kernel.org
+Link: https://lkml.kernel.org/r/20201111160946.147341-1-nivedita@alum.mit.edu
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/include/asm/pgtable_types.h |    1 +
+ arch/x86/mm/mem_encrypt.c            |    4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/include/asm/pgtable_types.h
++++ b/arch/x86/include/asm/pgtable_types.h
+@@ -148,6 +148,7 @@ enum page_cache_mode {
+ #endif
+ #define _PAGE_CACHE_MASK      (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)
++#define _PAGE_LARGE_CACHE_MASK        (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT_LARGE)
+ #define _PAGE_NOCACHE         (cachemode2protval(_PAGE_CACHE_MODE_UC))
+ #define _PAGE_CACHE_WP                (cachemode2protval(_PAGE_CACHE_MODE_WP))
+--- a/arch/x86/mm/mem_encrypt.c
++++ b/arch/x86/mm/mem_encrypt.c
+@@ -248,8 +248,8 @@ static void __init sme_clear_pgd(struct
+ #define PMD_FLAGS_LARGE               (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL)
+ #define PMD_FLAGS_DEC         PMD_FLAGS_LARGE
+-#define PMD_FLAGS_DEC_WP      ((PMD_FLAGS_DEC & ~_PAGE_CACHE_MASK) | \
+-                               (_PAGE_PAT | _PAGE_PWT))
++#define PMD_FLAGS_DEC_WP      ((PMD_FLAGS_DEC & ~_PAGE_LARGE_CACHE_MASK) | \
++                               (_PAGE_PAT_LARGE | _PAGE_PWT))
+ #define PMD_FLAGS_ENC         (PMD_FLAGS_LARGE | _PAGE_ENC)