From: Sasha Levin Date: Sun, 17 Feb 2019 23:18:04 +0000 (-0500) Subject: patches for 3.18 X-Git-Tag: v3.18.135~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e74a33f20988cfdb1a23862bd2fbb3f71b53c41f;p=thirdparty%2Fkernel%2Fstable-queue.git patches for 3.18 Signed-off-by: Sasha Levin --- diff --git a/queue-3.18/arm-dts-da850-evm-correct-the-sound-card-name.patch b/queue-3.18/arm-dts-da850-evm-correct-the-sound-card-name.patch new file mode 100644 index 00000000000..6dd2bbb1622 --- /dev/null +++ b/queue-3.18/arm-dts-da850-evm-correct-the-sound-card-name.patch @@ -0,0 +1,36 @@ +From b84ebcd1a23a5fce0d35f9e95ccdc6f428b1936b Mon Sep 17 00:00:00 2001 +From: Peter Ujfalusi +Date: Wed, 19 Dec 2018 13:47:24 +0200 +Subject: ARM: dts: da850-evm: Correct the sound card name + +[ Upstream commit 7fca69d4e43fa1ae9cb4f652772c132dc5a659c6 ] + +To avoid the following error: +asoc-simple-card sound: ASoC: Failed to create card debugfs directory + +Which is because the card name contains '/' character, which can not be +used in file or directory names. + +Signed-off-by: Peter Ujfalusi +Signed-off-by: Sekhar Nori +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/da850-evm.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts +index 4f935ad9f27b..505ea30c9cb2 100644 +--- a/arch/arm/boot/dts/da850-evm.dts ++++ b/arch/arm/boot/dts/da850-evm.dts +@@ -146,7 +146,7 @@ + + sound { + compatible = "simple-audio-card"; +- simple-audio-card,name = "DA850/OMAP-L138 EVM"; ++ simple-audio-card,name = "DA850-OMAPL138 EVM"; + simple-audio-card,widgets = + "Line", "Line In", + "Line", "Line Out"; +-- +2.19.1 + diff --git a/queue-3.18/arm-dts-kirkwood-fix-polarity-of-gpio-fan-lines.patch b/queue-3.18/arm-dts-kirkwood-fix-polarity-of-gpio-fan-lines.patch new file mode 100644 index 00000000000..7fe94de6424 --- /dev/null +++ b/queue-3.18/arm-dts-kirkwood-fix-polarity-of-gpio-fan-lines.patch @@ -0,0 +1,48 @@ +From df9681cad2ea3f2ccffba5ee641a302e4defe849 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 8 Jan 2019 00:08:18 +0100 +Subject: ARM: dts: kirkwood: Fix polarity of GPIO fan lines + +[ Upstream commit b5f034845e70916fd33e172fad5ad530a29c10ab ] + +These two lines are active high, not active low. The bug was +found when we changed the kernel to respect the polarity defined +in the device tree. + +Fixes: 1b90e06b1429 ("ARM: kirkwood: Use devicetree to define DNS-32[05] fan") +Cc: Jamie Lentin +Cc: Guenter Roeck +Cc: Jason Cooper +Cc: Andrew Lunn +Cc: Gregory Clement +Cc: Sebastian Hesselbarth +Cc: Julien D'Ascenzio +Reviewed-by: Andrew Lunn +Tested-by: Jamie Lentin +Reported-by: Julien D'Ascenzio +Tested-by: Julien D'Ascenzio +Signed-off-by: Linus Walleij +Signed-off-by: Gregory CLEMENT +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/kirkwood-dnskw.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi +index 113dcf056dcf..1b2dacfa6132 100644 +--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi ++++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi +@@ -35,8 +35,8 @@ + compatible = "gpio-fan"; + pinctrl-0 = <&pmx_fan_high_speed &pmx_fan_low_speed>; + pinctrl-names = "default"; +- gpios = <&gpio1 14 GPIO_ACTIVE_LOW +- &gpio1 13 GPIO_ACTIVE_LOW>; ++ gpios = <&gpio1 14 GPIO_ACTIVE_HIGH ++ &gpio1 13 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <0 0 + 3000 1 + 6000 2>; +-- +2.19.1 + diff --git a/queue-3.18/cifs-limit-memory-used-by-lock-request-calls-to-a-pa.patch b/queue-3.18/cifs-limit-memory-used-by-lock-request-calls-to-a-pa.patch new file mode 100644 index 00000000000..16aa4e05c13 --- /dev/null +++ b/queue-3.18/cifs-limit-memory-used-by-lock-request-calls-to-a-pa.patch @@ -0,0 +1,73 @@ +From 817477fbaacd98d0f652a1c9c766096711dda975 Mon Sep 17 00:00:00 2001 +From: Ross Lagerwall +Date: Tue, 8 Jan 2019 18:30:56 +0000 +Subject: cifs: Limit memory used by lock request calls to a page + +[ Upstream commit 92a8109e4d3a34fb6b115c9098b51767dc933444 ] + +The code tries to allocate a contiguous buffer with a size supplied by +the server (maxBuf). This could fail if memory is fragmented since it +results in high order allocations for commonly used server +implementations. It is also wasteful since there are probably +few locks in the usual case. Limit the buffer to be no larger than a +page to avoid memory allocation failures due to fragmentation. + +Signed-off-by: Ross Lagerwall +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/cifs/file.c | 8 ++++++++ + fs/cifs/smb2file.c | 4 ++++ + 2 files changed, 12 insertions(+) + +diff --git a/fs/cifs/file.c b/fs/cifs/file.c +index 338c92620d07..5dd8165a5429 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -1075,6 +1075,10 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) + return -EINVAL; + } + ++ BUILD_BUG_ON(sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE) > ++ PAGE_SIZE); ++ max_buf = min_t(unsigned int, max_buf - sizeof(struct smb_hdr), ++ PAGE_SIZE); + max_num = (max_buf - sizeof(struct smb_hdr)) / + sizeof(LOCKING_ANDX_RANGE); + buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); +@@ -1410,6 +1414,10 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, + if (max_buf < (sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE))) + return -EINVAL; + ++ BUILD_BUG_ON(sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE) > ++ PAGE_SIZE); ++ max_buf = min_t(unsigned int, max_buf - sizeof(struct smb_hdr), ++ PAGE_SIZE); + max_num = (max_buf - sizeof(struct smb_hdr)) / + sizeof(LOCKING_ANDX_RANGE); + buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); +diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c +index fabeaa0ff1bf..df7f4515c63d 100644 +--- a/fs/cifs/smb2file.c ++++ b/fs/cifs/smb2file.c +@@ -110,6 +110,8 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, + if (max_buf < sizeof(struct smb2_lock_element)) + return -EINVAL; + ++ BUILD_BUG_ON(sizeof(struct smb2_lock_element) > PAGE_SIZE); ++ max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); + max_num = max_buf / sizeof(struct smb2_lock_element); + buf = kzalloc(max_num * sizeof(struct smb2_lock_element), GFP_KERNEL); + if (!buf) +@@ -246,6 +248,8 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile) + return -EINVAL; + } + ++ BUILD_BUG_ON(sizeof(struct smb2_lock_element) > PAGE_SIZE); ++ max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); + max_num = max_buf / sizeof(struct smb2_lock_element); + buf = kzalloc(max_num * sizeof(struct smb2_lock_element), GFP_KERNEL); + if (!buf) { +-- +2.19.1 + diff --git a/queue-3.18/gpio-pl061-handle-failed-allocations.patch b/queue-3.18/gpio-pl061-handle-failed-allocations.patch new file mode 100644 index 00000000000..921a35cc96f --- /dev/null +++ b/queue-3.18/gpio-pl061-handle-failed-allocations.patch @@ -0,0 +1,43 @@ +From 357953ec771a5be3c1ba6d3d1b04dfb58e4c213b Mon Sep 17 00:00:00 2001 +From: Nicholas Mc Guire +Date: Sat, 1 Dec 2018 12:57:18 +0100 +Subject: gpio: pl061: handle failed allocations + +[ Upstream commit df209c43a0e8258e096fb722dfbdae4f0dd13fde ] + +devm_kzalloc(), devm_kstrdup() and devm_kasprintf() all can +fail internal allocation and return NULL. Using any of the assigned +objects without checking is not safe. As this is early in the boot +phase and these allocations really should not fail, any failure here +is probably an indication of a more serious issue so it makes little +sense to try and rollback the previous allocated resources or try to +continue; but rather the probe function is simply exited with -ENOMEM. + +Signed-off-by: Nicholas Mc Guire +Fixes: 684284b64aae ("ARM: integrator: add MMCI device to IM-PD1") +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + arch/arm/mach-integrator/impd1.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c +index 38b0da300dd5..423a88ff908c 100644 +--- a/arch/arm/mach-integrator/impd1.c ++++ b/arch/arm/mach-integrator/impd1.c +@@ -394,7 +394,11 @@ static int __init_refok impd1_probe(struct lm_device *dev) + sizeof(*lookup) + 3 * sizeof(struct gpiod_lookup), + GFP_KERNEL); + chipname = devm_kstrdup(&dev->dev, devname, GFP_KERNEL); +- mmciname = kasprintf(GFP_KERNEL, "lm%x:00700", dev->id); ++ mmciname = devm_kasprintf(&dev->dev, GFP_KERNEL, ++ "lm%x:00700", dev->id); ++ if (!lookup || !chipname || !mmciname) ++ return -ENOMEM; ++ + lookup->dev_id = mmciname; + /* + * Offsets on GPIO block 1: +-- +2.19.1 + diff --git a/queue-3.18/series b/queue-3.18/series index 9d6fad448fb..ce71d130992 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -89,3 +89,7 @@ batman-adv-avoid-warn-on-net_device-without-parent-in-netns.patch batman-adv-force-mac-header-to-start-of-data-on-xmit.patch usb-host-ehci-msm-fix-handling-platform_get_irq-result.patch revert-exec-load_script-don-t-blindly-truncate-shebang-string.patch +arm-dts-da850-evm-correct-the-sound-card-name.patch +arm-dts-kirkwood-fix-polarity-of-gpio-fan-lines.patch +gpio-pl061-handle-failed-allocations.patch +cifs-limit-memory-used-by-lock-request-calls-to-a-pa.patch