From: Greg Kroah-Hartman Date: Fri, 5 May 2017 20:07:41 +0000 (-0700) Subject: 3.18-stable patches X-Git-Tag: v3.18.52~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c9a95f96938841ead3841ec17c91a1988e7f3da;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: i2o-hide-unsafe-ioctl-on-64-bit.patch --- diff --git a/queue-3.18/i2o-hide-unsafe-ioctl-on-64-bit.patch b/queue-3.18/i2o-hide-unsafe-ioctl-on-64-bit.patch new file mode 100644 index 00000000000..40b5bbd8c87 --- /dev/null +++ b/queue-3.18/i2o-hide-unsafe-ioctl-on-64-bit.patch @@ -0,0 +1,53 @@ +From arnd@arndb.de Fri May 5 13:07:16 2017 +From: Arnd Bergmann +Date: Fri, 5 May 2017 21:46:49 +0200 +Subject: [PATCH 3.16-stable 31/87] i2o: hide unsafe ioctl on 64-bit +To: Ben Hutchings +Cc: stable@vger.kernel.org, Arnd Bergmann +Message-ID: <20170505194745.3627137-32-arnd@arndb.de> + +From: Arnd Bergmann + +We get a warning about a broken pointer conversion on 64-bit architectures: + +drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru': +drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] + (p->virt, (void __user *)sg[i].addr_bus, + ^ +drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] + ((void __user *)sg[j].addr_bus, sg_list[j].virt, + ^ + +This has clearly never worked right, so we can add an #ifdef around the code. +The driver was moved to staging in linux-4.0 and finally removed in 4.2, +so upstream does not have a fix for it. + +The driver originally got this mostly right, though probably by accident. + +Fixes: f4c2c15b930b ("[PATCH] Convert i2o to compat_ioctl") +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman +--- + drivers/message/i2o/i2o_config.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/message/i2o/i2o_config.c ++++ b/drivers/message/i2o/i2o_config.c +@@ -772,7 +772,7 @@ static long i2o_cfg_compat_ioctl(struct + + #endif + +-#ifdef CONFIG_I2O_EXT_ADAPTEC ++#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT) + static int i2o_cfg_passthru(unsigned long arg) + { + struct i2o_cmd_passthru __user *cmd = +@@ -1045,7 +1045,7 @@ static long i2o_cfg_ioctl(struct file *f + ret = i2o_cfg_evt_get(arg, fp); + break; + +-#ifdef CONFIG_I2O_EXT_ADAPTEC ++#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT) + case I2OPASSTHRU: + ret = i2o_cfg_passthru(arg); + break; diff --git a/queue-3.18/message-i2o-fix-64bit-build-warnings.patch b/queue-3.18/message-i2o-fix-64bit-build-warnings.patch deleted file mode 100644 index 9528f7353b5..00000000000 --- a/queue-3.18/message-i2o-fix-64bit-build-warnings.patch +++ /dev/null @@ -1,41 +0,0 @@ -From foo@baz Thu May 4 16:01:53 PDT 2017 -Date: Thu, 04 May 2017 16:01:53 -0700 -To: Greg KH -From: Greg Kroah-Hartman -Subject: message: i2o: fix 64bit build warnings - -From: Greg Kroah-Hartman - -It seems that most of the 64bit build warnings were fixed up in this -driver, but 2 were forgotten. This code is long deleted from newer -kernels, so the fix is not needed there, but make it here in the 3.18 -tree to keep the build quiet. - -Cc: Arnd Bergmann -Signed-off-by: Greg Kroah-Hartman - - ---- - drivers/message/i2o/i2o_config.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/message/i2o/i2o_config.c -+++ b/drivers/message/i2o/i2o_config.c -@@ -890,7 +890,7 @@ static int i2o_cfg_passthru(unsigned lon - flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { - // TODO 64bit fix - if (copy_from_user -- (p->virt, (void __user *)sg[i].addr_bus, -+ (p->virt, (void __user *)(u64)sg[i].addr_bus, - sg_size)) { - printk(KERN_DEBUG - "%s: Could not copy SG buf %d FROM user\n", -@@ -950,7 +950,7 @@ static int i2o_cfg_passthru(unsigned lon - sg_size = sg[j].flag_count & 0xffffff; - // TODO 64bit fix - if (copy_to_user -- ((void __user *)sg[j].addr_bus, sg_list[j].virt, -+ ((void __user *)(u64)sg[j].addr_bus, sg_list[j].virt, - sg_size)) { - printk(KERN_WARNING - "%s: Could not copy %p TO user %x\n", diff --git a/queue-3.18/net-ipv4-fix-multipath-rtm_getroute-behavior-when-iif-is-given.patch b/queue-3.18/net-ipv4-fix-multipath-rtm_getroute-behavior-when-iif-is-given.patch deleted file mode 100644 index 91aa26c9f3f..00000000000 --- a/queue-3.18/net-ipv4-fix-multipath-rtm_getroute-behavior-when-iif-is-given.patch +++ /dev/null @@ -1,37 +0,0 @@ -From foo@baz Sun Apr 30 15:50:51 CEST 2017 -From: Florian Larysch -Date: Mon, 3 Apr 2017 16:46:09 +0200 -Subject: net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given - -From: Florian Larysch - - -[ Upstream commit a8801799c6975601fd58ae62f48964caec2eb83f ] - -inet_rtm_getroute synthesizes a skeletal ICMP skb, which is passed to -ip_route_input when iif is given. If a multipath route is present for -the designated destination, ip_multipath_icmp_hash ends up being called, -which uses the source/destination addresses within the skb to calculate -a hash. However, those are not set in the synthetic skb, causing it to -return an arbitrary and incorrect result. - -Instead, use UDP, which gets no such special treatment. - -Signed-off-by: Florian Larysch -Signed-off-by: David S. Miller -Signed-off-by: Greg Kroah-Hartman ---- - net/ipv4/route.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/net/ipv4/route.c -+++ b/net/ipv4/route.c -@@ -2436,7 +2436,7 @@ static int inet_rtm_getroute(struct sk_b - skb_reset_network_header(skb); - - /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */ -- ip_hdr(skb)->protocol = IPPROTO_ICMP; -+ ip_hdr(skb)->protocol = IPPROTO_UDP; - skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr)); - - src = tb[RTA_SRC] ? nla_get_be32(tb[RTA_SRC]) : 0; diff --git a/queue-3.18/series b/queue-3.18/series index d31bc1d2983..3fbce045060 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -13,7 +13,6 @@ net-phy-handle-state-correctly-in-phy_stop_machine.patch l2tp-purge-socket-queues-in-the-.destruct-callback.patch net-packet-fix-overflow-in-check-for-tp_frame_nr.patch net-packet-fix-overflow-in-check-for-tp_reserve.patch -net-ipv4-fix-multipath-rtm_getroute-behavior-when-iif-is-given.patch sctp-listen-on-the-sock-only-when-it-s-state-is-listening-or-closed.patch netpoll-check-for-skb-queue_mapping.patch ip6mr-fix-notification-device-destruction.patch @@ -58,7 +57,7 @@ mips-jz4740-fix-build-error-in-irq.h.patch mips-elf2ecoff-ignore-pt_mips_abiflags-program-headers.patch mips-elf2ecoff-fix-warning-due-to-dead-code.patch staging-unisys-correctly-handle-return-value-from-queue_delayed_work.patch -message-i2o-fix-64bit-build-warnings.patch +i2o-hide-unsafe-ioctl-on-64-bit.patch scsi-advansys-remove-warning-message.patch modpost-expand-pattern-matching-to-support-substring-matches.patch modpost-don-t-emit-section-mismatch-warnings-for-compiler-optimizations.patch