From: Sasha Levin Date: Fri, 17 Apr 2020 03:43:40 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v4.19.116~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc97f741d580537666f2919cdcd06305ec255ded;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/efi-x86-fix-the-deletion-of-variables-in-mixed-mode.patch b/queue-4.19/efi-x86-fix-the-deletion-of-variables-in-mixed-mode.patch new file mode 100644 index 00000000000..cbd16dc8f37 --- /dev/null +++ b/queue-4.19/efi-x86-fix-the-deletion-of-variables-in-mixed-mode.patch @@ -0,0 +1,50 @@ +From f7d011de32db75533cc12f14b3ad093298ab09ee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 9 Apr 2020 15:04:33 +0200 +Subject: efi/x86: Fix the deletion of variables in mixed mode + +From: Gary Lin + +[ Upstream commit a4b81ccfd4caba017d2b84720b6de4edd16911a0 ] + +efi_thunk_set_variable() treated the NULL "data" pointer as an invalid +parameter, and this broke the deletion of variables in mixed mode. +This commit fixes the check of data so that the userspace program can +delete a variable in mixed mode. + +Fixes: 8319e9d5ad98ffcc ("efi/x86: Handle by-ref arguments covering multiple pages in mixed mode") +Signed-off-by: Gary Lin +Signed-off-by: Ard Biesheuvel +Signed-off-by: Ingo Molnar +Link: https://lore.kernel.org/r/20200408081606.1504-1-glin@suse.com +Link: https://lore.kernel.org/r/20200409130434.6736-9-ardb@kernel.org +Signed-off-by: Sasha Levin +--- + arch/x86/platform/efi/efi_64.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c +index 2a9a703ef4a07..52dd59af873ee 100644 +--- a/arch/x86/platform/efi/efi_64.c ++++ b/arch/x86/platform/efi/efi_64.c +@@ -833,7 +833,7 @@ efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor, + phys_vendor = virt_to_phys_or_null(vnd); + phys_data = virt_to_phys_or_null_size(data, data_size); + +- if (!phys_name || !phys_data) ++ if (!phys_name || (data && !phys_data)) + status = EFI_INVALID_PARAMETER; + else + status = efi_thunk(set_variable, phys_name, phys_vendor, +@@ -864,7 +864,7 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, + phys_vendor = virt_to_phys_or_null(vnd); + phys_data = virt_to_phys_or_null_size(data, data_size); + +- if (!phys_name || !phys_data) ++ if (!phys_name || (data && !phys_data)) + status = EFI_INVALID_PARAMETER; + else + status = efi_thunk(set_variable, phys_name, phys_vendor, +-- +2.20.1 + diff --git a/queue-4.19/mfd-dln2-fix-sanity-checking-for-endpoints.patch b/queue-4.19/mfd-dln2-fix-sanity-checking-for-endpoints.patch new file mode 100644 index 00000000000..17bb896b877 --- /dev/null +++ b/queue-4.19/mfd-dln2-fix-sanity-checking-for-endpoints.patch @@ -0,0 +1,61 @@ +From 52334a544d9021947acab1bf2768145c961f9370 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 26 Feb 2020 16:51:58 +0200 +Subject: mfd: dln2: Fix sanity checking for endpoints + +From: Andy Shevchenko + +[ Upstream commit fb945c95a482200876993977008b67ea658bd938 ] + +While the commit 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints") +tries to harden the sanity checks it made at the same time a regression, +i.e. mixed in and out endpoints. Obviously it should have been not tested on +real hardware at that time, but unluckily it didn't happen. + +So, fix above mentioned typo and make device being enumerated again. + +While here, introduce an enumerator for magic values to prevent similar issue +to happen in the future. + +Fixes: 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints") +Cc: Oliver Neukum +Cc: Greg Kroah-Hartman +Signed-off-by: Andy Shevchenko +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/mfd/dln2.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c +index 1476465ce803b..6ea0dd37b4535 100644 +--- a/drivers/mfd/dln2.c ++++ b/drivers/mfd/dln2.c +@@ -93,6 +93,11 @@ struct dln2_mod_rx_slots { + spinlock_t lock; + }; + ++enum dln2_endpoint { ++ DLN2_EP_OUT = 0, ++ DLN2_EP_IN = 1, ++}; ++ + struct dln2_dev { + struct usb_device *usb_dev; + struct usb_interface *interface; +@@ -736,10 +741,10 @@ static int dln2_probe(struct usb_interface *interface, + hostif->desc.bNumEndpoints < 2) + return -ENODEV; + +- epin = &hostif->endpoint[0].desc; +- epout = &hostif->endpoint[1].desc; ++ epout = &hostif->endpoint[DLN2_EP_OUT].desc; + if (!usb_endpoint_is_bulk_out(epout)) + return -ENODEV; ++ epin = &hostif->endpoint[DLN2_EP_IN].desc; + if (!usb_endpoint_is_bulk_in(epin)) + return -ENODEV; + +-- +2.20.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 5edb521cbe7..d575669df82 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -144,3 +144,5 @@ ftrace-kprobe-show-the-maxactive-number-on-kprobe_ev.patch powerpc-fsl_booke-avoid-creating-duplicate-tlb1-entr.patch misc-echo-remove-unnecessary-parentheses-and-simplif.patch etnaviv-perfmon-fix-total-and-idle-hi-cyleces-readou.patch +mfd-dln2-fix-sanity-checking-for-endpoints.patch +efi-x86-fix-the-deletion-of-variables-in-mixed-mode.patch