From d585bf83ca1086b6e66e6d8ec3d73e0aff6899e2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 12 May 2018 16:16:19 +0200 Subject: [PATCH] 3.18-stable patches added patches: can-kvaser_usb-increase-correct-stats-counter-in-kvaser_usb_rx_can_msg.patch libata-apply-nolpm-quirk-for-sandisk-sd7ub3q-g1001-ssds.patch rfkill-gpio-fix-memory-leak-in-probe-error-path.patch tracing-fix-regex_match_front-to-not-over-compare-the-test-string.patch --- ...ats-counter-in-kvaser_usb_rx_can_msg.patch | 31 +++++++++++++ ...quirk-for-sandisk-sd7ub3q-g1001-ssds.patch | 45 ++++++++++++++++++ ...-fix-memory-leak-in-probe-error-path.patch | 46 +++++++++++++++++++ queue-3.18/series | 4 ++ ...-to-not-over-compare-the-test-string.patch | 41 +++++++++++++++++ 5 files changed, 167 insertions(+) create mode 100644 queue-3.18/can-kvaser_usb-increase-correct-stats-counter-in-kvaser_usb_rx_can_msg.patch create mode 100644 queue-3.18/libata-apply-nolpm-quirk-for-sandisk-sd7ub3q-g1001-ssds.patch create mode 100644 queue-3.18/rfkill-gpio-fix-memory-leak-in-probe-error-path.patch create mode 100644 queue-3.18/tracing-fix-regex_match_front-to-not-over-compare-the-test-string.patch diff --git a/queue-3.18/can-kvaser_usb-increase-correct-stats-counter-in-kvaser_usb_rx_can_msg.patch b/queue-3.18/can-kvaser_usb-increase-correct-stats-counter-in-kvaser_usb_rx_can_msg.patch new file mode 100644 index 00000000000..bd767df0dcd --- /dev/null +++ b/queue-3.18/can-kvaser_usb-increase-correct-stats-counter-in-kvaser_usb_rx_can_msg.patch @@ -0,0 +1,31 @@ +From 6ee00865ffe4e8c8ba4a68d26db53c7ec09bbb89 Mon Sep 17 00:00:00 2001 +From: Jimmy Assarsson +Date: Fri, 20 Apr 2018 14:38:46 +0200 +Subject: can: kvaser_usb: Increase correct stats counter in kvaser_usb_rx_can_msg() + +From: Jimmy Assarsson + +commit 6ee00865ffe4e8c8ba4a68d26db53c7ec09bbb89 upstream. + +Increase rx_dropped, if alloc_can_skb() fails, not tx_dropped. + +Signed-off-by: Jimmy Assarsson +Cc: linux-stable +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/usb/kvaser_usb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/can/usb/kvaser_usb.c ++++ b/drivers/net/can/usb/kvaser_usb.c +@@ -850,7 +850,7 @@ static void kvaser_usb_rx_can_msg(const + + skb = alloc_can_skb(priv->netdev, &cf); + if (!skb) { +- stats->tx_dropped++; ++ stats->rx_dropped++; + return; + } + diff --git a/queue-3.18/libata-apply-nolpm-quirk-for-sandisk-sd7ub3q-g1001-ssds.patch b/queue-3.18/libata-apply-nolpm-quirk-for-sandisk-sd7ub3q-g1001-ssds.patch new file mode 100644 index 00000000000..84af360d226 --- /dev/null +++ b/queue-3.18/libata-apply-nolpm-quirk-for-sandisk-sd7ub3q-g1001-ssds.patch @@ -0,0 +1,45 @@ +From 184add2ca23ce5edcac0ab9c3b9be13f91e7b567 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 26 Apr 2018 22:32:21 +0200 +Subject: libata: Apply NOLPM quirk for SanDisk SD7UB3Q*G1001 SSDs + +From: Hans de Goede + +commit 184add2ca23ce5edcac0ab9c3b9be13f91e7b567 upstream. + +Richard Jones has reported that using med_power_with_dipm on a T450s +with a Sandisk SD7UB3Q256G1001 SSD (firmware version X2180501) is +causing the machine to hang. + +Switching the LPM to max_performance fixes this, so it seems that +this Sandisk SSD does not handle LPM well. + +Note in the past there have been bug-reports about the following +Sandisk models not working with min_power, so we may need to extend +the quirk list in the future: name - firmware +Sandisk SD6SB2M512G1022I - X210400 +Sandisk SD6PP4M-256G-1006 - A200906 + +Cc: stable@vger.kernel.org +Cc: Richard W.M. Jones +Reported-and-tested-by: Richard W.M. Jones +Signed-off-by: Hans de Goede +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-core.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -4244,6 +4244,9 @@ static const struct ata_blacklist_entry + ATA_HORKAGE_ZERO_AFTER_TRIM | + ATA_HORKAGE_NOLPM, }, + ++ /* Sandisk devices which are known to not handle LPM well */ ++ { "SanDisk SD7UB3Q*G1001", NULL, ATA_HORKAGE_NOLPM, }, ++ + /* devices that don't properly handle queued TRIM commands */ + { "Micron_M500_*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | + ATA_HORKAGE_ZERO_AFTER_TRIM, }, diff --git a/queue-3.18/rfkill-gpio-fix-memory-leak-in-probe-error-path.patch b/queue-3.18/rfkill-gpio-fix-memory-leak-in-probe-error-path.patch new file mode 100644 index 00000000000..a7f4e744adf --- /dev/null +++ b/queue-3.18/rfkill-gpio-fix-memory-leak-in-probe-error-path.patch @@ -0,0 +1,46 @@ +From 4bf01ca21e2e0e4561d1a03c48c3d740418702db Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 26 Apr 2018 09:31:52 +0200 +Subject: rfkill: gpio: fix memory leak in probe error path + +From: Johan Hovold + +commit 4bf01ca21e2e0e4561d1a03c48c3d740418702db upstream. + +Make sure to free the rfkill device in case registration fails during +probe. + +Fixes: 5e7ca3937fbe ("net: rfkill: gpio: convert to resource managed allocation") +Cc: stable # 3.13 +Cc: Heikki Krogerus +Signed-off-by: Johan Hovold +Reviewed-by: Heikki Krogerus +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/rfkill/rfkill-gpio.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/net/rfkill/rfkill-gpio.c ++++ b/net/rfkill/rfkill-gpio.c +@@ -134,13 +134,18 @@ static int rfkill_gpio_probe(struct plat + + ret = rfkill_register(rfkill->rfkill_dev); + if (ret < 0) +- return ret; ++ goto err_destroy; + + platform_set_drvdata(pdev, rfkill); + + dev_info(&pdev->dev, "%s device registered.\n", rfkill->name); + + return 0; ++ ++err_destroy: ++ rfkill_destroy(rfkill->rfkill_dev); ++ ++ return ret; + } + + static int rfkill_gpio_remove(struct platform_device *pdev) diff --git a/queue-3.18/series b/queue-3.18/series index 18068320b95..852a54324e4 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -16,3 +16,7 @@ net-fix-uninit-value-in-__hw_addr_add_ex.patch soreuseport-initialise-timewait-reuseport-field.patch perf-remove-superfluous-allocation-error-check.patch tcp-fix-tcp_repair_queue-bound-checking.patch +rfkill-gpio-fix-memory-leak-in-probe-error-path.patch +libata-apply-nolpm-quirk-for-sandisk-sd7ub3q-g1001-ssds.patch +tracing-fix-regex_match_front-to-not-over-compare-the-test-string.patch +can-kvaser_usb-increase-correct-stats-counter-in-kvaser_usb_rx_can_msg.patch diff --git a/queue-3.18/tracing-fix-regex_match_front-to-not-over-compare-the-test-string.patch b/queue-3.18/tracing-fix-regex_match_front-to-not-over-compare-the-test-string.patch new file mode 100644 index 00000000000..f9ec2a32ac3 --- /dev/null +++ b/queue-3.18/tracing-fix-regex_match_front-to-not-over-compare-the-test-string.patch @@ -0,0 +1,41 @@ +From dc432c3d7f9bceb3de6f5b44fb9c657c9810ed6d Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Wed, 9 May 2018 11:59:32 -0400 +Subject: tracing: Fix regex_match_front() to not over compare the test string + +From: Steven Rostedt (VMware) + +commit dc432c3d7f9bceb3de6f5b44fb9c657c9810ed6d upstream. + +The regex match function regex_match_front() in the tracing filter logic, +was fixed to test just the pattern length from testing the entire test +string. That is, it went from strncmp(str, r->pattern, len) to +strcmp(str, r->pattern, r->len). + +The issue is that str is not guaranteed to be nul terminated, and if r->len +is greater than the length of str, it can access more memory than is +allocated. + +The solution is to add a simple test if (len < r->len) return 0. + +Cc: stable@vger.kernel.org +Fixes: 285caad415f45 ("tracing/filters: Fix MATCH_FRONT_ONLY filter matching") +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/trace_events_filter.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/kernel/trace/trace_events_filter.c ++++ b/kernel/trace/trace_events_filter.c +@@ -273,6 +273,9 @@ static int regex_match_full(char *str, s + + static int regex_match_front(char *str, struct regex *r, int len) + { ++ if (len < r->len) ++ return 0; ++ + if (strncmp(str, r->pattern, r->len) == 0) + return 1; + return 0; -- 2.47.3