]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jul 2017 18:05:47 +0000 (11:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jul 2017 18:05:47 +0000 (11:05 -0700)
added patches:
alarmtimer-don-t-rate-limit-one-shot-timers.patch
spmi-include-of-based-modalias-in-device-uevent.patch
tracing-fix-kmemleak-in-instance_rmdir.patch

queue-4.4/alarmtimer-don-t-rate-limit-one-shot-timers.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/spmi-include-of-based-modalias-in-device-uevent.patch [new file with mode: 0644]
queue-4.4/tracing-fix-kmemleak-in-instance_rmdir.patch [new file with mode: 0644]

diff --git a/queue-4.4/alarmtimer-don-t-rate-limit-one-shot-timers.patch b/queue-4.4/alarmtimer-don-t-rate-limit-one-shot-timers.patch
new file mode 100644 (file)
index 0000000..81bfc4b
--- /dev/null
@@ -0,0 +1,38 @@
+From ghackmann@google.com  Tue Jul 25 10:58:26 2017
+From: Greg Hackmann <ghackmann@google.com>
+Date: Mon, 24 Jul 2017 10:19:24 -0700
+Subject: alarmtimer: don't rate limit one-shot timers
+To: John Stultz <john.stultz@linaro.org>, Thomas Gleixner <tglx@linutronix.de>
+Cc: Ben Fennema <fennema@google.com>, linux-kernel@vger.kernel.org, Greg Hackmann <ghackmann@google.com>, stable@vger.kernel.org
+Message-ID: <20170724171924.27898-1-ghackmann@google.com>
+
+From: Greg Hackmann <ghackmann@google.com>
+
+Commit ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") sets a
+minimum bound on the alarm timer interval.  This minimum bound shouldn't
+be applied if the interval is 0.  Otherwise, one-shot timers will be
+converted into periodic ones.
+
+Fixes: ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals")
+Reported-by: Ben Fennema <fennema@google.com>
+Signed-off-by: Greg Hackmann <ghackmann@google.com>
+Cc: stable@vger.kernel.org
+Cc: John Stultz <john.stultz@linaro.org>
+Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/time/alarmtimer.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/time/alarmtimer.c
++++ b/kernel/time/alarmtimer.c
+@@ -616,7 +616,8 @@ static int alarm_timer_set(struct k_itim
+        * Rate limit to the tick as a hot fix to prevent DOS. Will be
+        * mopped up later.
+        */
+-      if (ktime_to_ns(timr->it.alarm.interval) < TICK_NSEC)
++      if (timr->it.alarm.interval.tv64 &&
++                      ktime_to_ns(timr->it.alarm.interval) < TICK_NSEC)
+               timr->it.alarm.interval = ktime_set(0, TICK_NSEC);
+       exp = timespec_to_ktime(new_setting->it_value);
index ec5becb6a92a21befeeec39576ff52caddb16c0a..7386524889d2d6fbc0ca903b40a184d186cf46e8 100644 (file)
@@ -77,3 +77,6 @@ rdma-core-initialize-port_num-in-qp_attr.patch
 drm-mst-fix-error-handling-during-mst-sideband-message-reception.patch
 drm-mst-avoid-dereferencing-a-null-mstb-in-drm_dp_mst_handle_up_req.patch
 drm-mst-avoid-processing-partially-received-up-down-message-transactions.patch
+spmi-include-of-based-modalias-in-device-uevent.patch
+tracing-fix-kmemleak-in-instance_rmdir.patch
+alarmtimer-don-t-rate-limit-one-shot-timers.patch
diff --git a/queue-4.4/spmi-include-of-based-modalias-in-device-uevent.patch b/queue-4.4/spmi-include-of-based-modalias-in-device-uevent.patch
new file mode 100644 (file)
index 0000000..76dd10e
--- /dev/null
@@ -0,0 +1,49 @@
+From d50daa2af2618dab6d21634e65a5fbcf4ae437d6 Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson@linaro.org>
+Date: Thu, 29 Jun 2017 14:46:44 -0700
+Subject: spmi: Include OF based modalias in device uevent
+
+From: Bjorn Andersson <bjorn.andersson@linaro.org>
+
+commit d50daa2af2618dab6d21634e65a5fbcf4ae437d6 upstream.
+
+Include the OF-based modalias in the uevent sent when registering SPMI
+devices, so that user space has a chance to autoload the kernel module
+for the device.
+
+Tested-by: Rob Clark <robdclark@gmail.com>
+Reported-by: Rob Clark <robdclark@gmail.com>
+Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
+Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spmi/spmi.c |   12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/drivers/spmi/spmi.c
++++ b/drivers/spmi/spmi.c
+@@ -364,11 +364,23 @@ static int spmi_drv_remove(struct device
+       return 0;
+ }
++static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env)
++{
++      int ret;
++
++      ret = of_device_uevent_modalias(dev, env);
++      if (ret != -ENODEV)
++              return ret;
++
++      return 0;
++}
++
+ static struct bus_type spmi_bus_type = {
+       .name           = "spmi",
+       .match          = spmi_device_match,
+       .probe          = spmi_drv_probe,
+       .remove         = spmi_drv_remove,
++      .uevent         = spmi_drv_uevent,
+ };
+ /**
diff --git a/queue-4.4/tracing-fix-kmemleak-in-instance_rmdir.patch b/queue-4.4/tracing-fix-kmemleak-in-instance_rmdir.patch
new file mode 100644 (file)
index 0000000..62c8789
--- /dev/null
@@ -0,0 +1,51 @@
+From db9108e054700c96322b0f0028546aa4e643cf0b Mon Sep 17 00:00:00 2001
+From: Chunyu Hu <chuhu@redhat.com>
+Date: Thu, 20 Jul 2017 18:36:09 +0800
+Subject: tracing: Fix kmemleak in instance_rmdir
+
+From: Chunyu Hu <chuhu@redhat.com>
+
+commit db9108e054700c96322b0f0028546aa4e643cf0b upstream.
+
+Hit the kmemleak when executing instance_rmdir, it forgot releasing
+mem of tracing_cpumask. With this fix, the warn does not appear any
+more.
+
+unreferenced object 0xffff93a8dfaa7c18 (size 8):
+  comm "mkdir", pid 1436, jiffies 4294763622 (age 9134.308s)
+  hex dump (first 8 bytes):
+    ff ff ff ff ff ff ff ff                          ........
+  backtrace:
+    [<ffffffff88b6567a>] kmemleak_alloc+0x4a/0xa0
+    [<ffffffff8861ea41>] __kmalloc_node+0xf1/0x280
+    [<ffffffff88b505d3>] alloc_cpumask_var_node+0x23/0x30
+    [<ffffffff88b5060e>] alloc_cpumask_var+0xe/0x10
+    [<ffffffff88571ab0>] instance_mkdir+0x90/0x240
+    [<ffffffff886e5100>] tracefs_syscall_mkdir+0x40/0x70
+    [<ffffffff886565c9>] vfs_mkdir+0x109/0x1b0
+    [<ffffffff8865b1d0>] SyS_mkdir+0xd0/0x100
+    [<ffffffff88403857>] do_syscall_64+0x67/0x150
+    [<ffffffff88b710e7>] return_from_SYSCALL_64+0x0/0x6a
+    [<ffffffffffffffff>] 0xffffffffffffffff
+
+Link: http://lkml.kernel.org/r/1500546969-12594-1-git-send-email-chuhu@redhat.com
+
+Fixes: ccfe9e42e451 ("tracing: Make tracing_cpumask available for all instances")
+Signed-off-by: Chunyu Hu <chuhu@redhat.com>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/trace/trace.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -6737,6 +6737,7 @@ static int instance_rmdir(const char *na
+       }
+       kfree(tr->topts);
++      free_cpumask_var(tr->tracing_cpumask);
+       kfree(tr->name);
+       kfree(tr);