From: Sasha Levin Date: Sun, 17 Feb 2019 23:18:04 +0000 (-0500) Subject: patches for 4.4 X-Git-Tag: v3.18.135~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d37807d0bae1a2edcb95bdbebd5d76130dc98299;p=thirdparty%2Fkernel%2Fstable-queue.git patches for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/arm-dts-da850-evm-correct-the-sound-card-name.patch b/queue-4.4/arm-dts-da850-evm-correct-the-sound-card-name.patch new file mode 100644 index 00000000000..ed993cee76d --- /dev/null +++ b/queue-4.4/arm-dts-da850-evm-correct-the-sound-card-name.patch @@ -0,0 +1,36 @@ +From 4e82895ad2fbeb0709bae4eba6204cad3f079c98 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 6881757b03e8..67369f284b91 100644 +--- a/arch/arm/boot/dts/da850-evm.dts ++++ b/arch/arm/boot/dts/da850-evm.dts +@@ -147,7 +147,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-4.4/arm-dts-kirkwood-fix-polarity-of-gpio-fan-lines.patch b/queue-4.4/arm-dts-kirkwood-fix-polarity-of-gpio-fan-lines.patch new file mode 100644 index 00000000000..2719568927c --- /dev/null +++ b/queue-4.4/arm-dts-kirkwood-fix-polarity-of-gpio-fan-lines.patch @@ -0,0 +1,48 @@ +From 49c62884265c3e3a9462cbc2262997f7dc1107b7 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-4.4/cifs-limit-memory-used-by-lock-request-calls-to-a-pa.patch b/queue-4.4/cifs-limit-memory-used-by-lock-request-calls-to-a-pa.patch new file mode 100644 index 00000000000..c8a124f35be --- /dev/null +++ b/queue-4.4/cifs-limit-memory-used-by-lock-request-calls-to-a-pa.patch @@ -0,0 +1,73 @@ +From 600db19020cde1df5eec0be27f8484ea84daeb6b 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 026b399af215..1062e96ee272 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -1081,6 +1081,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 = kcalloc(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 = kcalloc(max_num, sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); +diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c +index b7885dc0d9bb..dee5250701de 100644 +--- a/fs/cifs/smb2file.c ++++ b/fs/cifs/smb2file.c +@@ -129,6 +129,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 = kcalloc(max_num, sizeof(struct smb2_lock_element), GFP_KERNEL); + if (!buf) +@@ -265,6 +267,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 = kcalloc(max_num, sizeof(struct smb2_lock_element), GFP_KERNEL); + if (!buf) { +-- +2.19.1 + diff --git a/queue-4.4/gpio-pl061-handle-failed-allocations.patch b/queue-4.4/gpio-pl061-handle-failed-allocations.patch new file mode 100644 index 00000000000..dd53b631db0 --- /dev/null +++ b/queue-4.4/gpio-pl061-handle-failed-allocations.patch @@ -0,0 +1,43 @@ +From 881b3e58c0f47253099afa16d19e1987032dd929 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-4.4/series b/queue-4.4/series index b3bddb8687d..fa120069f3a 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -116,3 +116,8 @@ xfrm-refine-validation-of-template-and-selector-families.patch batman-adv-avoid-warn-on-net_device-without-parent-in-netns.patch batman-adv-force-mac-header-to-start-of-data-on-xmit.patch revert-exec-load_script-don-t-blindly-truncate-shebang-string.patch +uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.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 diff --git a/queue-4.4/uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/queue-4.4/uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch new file mode 100644 index 00000000000..df940b0d7b2 --- /dev/null +++ b/queue-4.4/uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch @@ -0,0 +1,67 @@ +From 1b9f8672230330130782d3b1c530fb1e1cf6bf47 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 14 Feb 2019 14:18:00 +0100 +Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr + +commit 6926e041a8920c8ec27e4e155efa760aa01551fd upstream. + +Musl provides its own ethhdr struct definition. Add a guard to prevent +its definition of the appropriate musl header has already been included. + +glibc does not implement this header, but when glibc will implement this +they can just define __UAPI_DEF_ETHHDR 0 to make it work with the +kernel. + +Signed-off-by: Hauke Mehrtens +Signed-off-by: David S. Miller +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + include/uapi/linux/if_ether.h | 3 +++ + include/uapi/linux/libc-compat.h | 6 ++++++ + 2 files changed, 9 insertions(+) + +diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h +index 064d2026ab38..cb490cd9376f 100644 +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -22,6 +22,7 @@ + #define _UAPI_LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -136,11 +137,13 @@ + * This is an Ethernet frame header. + */ + ++#if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ + unsigned char h_source[ETH_ALEN]; /* source ether addr */ + __be16 h_proto; /* packet type ID field */ + } __attribute__((packed)); ++#endif + + + #endif /* _UAPI_LINUX_IF_ETHER_H */ +diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h +index e4f048ee7043..5da44c571cdd 100644 +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -184,4 +184,10 @@ + + #endif /* __GLIBC__ */ + ++/* Definitions for if_ether.h */ ++/* allow libcs like musl to deactivate this, glibc does not implement this. */ ++#ifndef __UAPI_DEF_ETHHDR ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ + #endif /* _UAPI_LIBC_COMPAT_H */ +-- +2.19.1 +