]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Nov 2019 07:53:40 +0000 (08:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Nov 2019 07:53:40 +0000 (08:53 +0100)
added patches:
pm-devfreq-fix-kernel-oops-on-governor-module-load.patch

queue-4.19/pm-devfreq-fix-kernel-oops-on-governor-module-load.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/pm-devfreq-fix-kernel-oops-on-governor-module-load.patch b/queue-4.19/pm-devfreq-fix-kernel-oops-on-governor-module-load.patch
new file mode 100644 (file)
index 0000000..13d8317
--- /dev/null
@@ -0,0 +1,43 @@
+From 7544fd7f384591038646d3cd9efb311ab4509e24 Mon Sep 17 00:00:00 2001
+From: Ezequiel Garcia <ezequiel@collabora.com>
+Date: Fri, 21 Jun 2019 18:39:49 -0300
+Subject: PM / devfreq: Fix kernel oops on governor module load
+
+From: Ezequiel Garcia <ezequiel@collabora.com>
+
+commit 7544fd7f384591038646d3cd9efb311ab4509e24 upstream.
+
+A bit unexpectedly (but still documented), request_module may
+return a positive value, in case of a modprobe error.
+This is currently causing issues in the devfreq framework.
+
+When a request_module exits with a positive value, we currently
+return that via ERR_PTR. However, because the value is positive,
+it's not a ERR_VALUE proper, and is therefore treated as a
+valid struct devfreq_governor pointer, leading to a kernel oops.
+
+Fix this by returning -EINVAL if request_module returns a positive
+value.
+
+Fixes: b53b0128052ff ("PM / devfreq: Fix static checker warning in try_then_request_governor")
+Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
+Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
+Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
+Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/devfreq/devfreq.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/devfreq/devfreq.c
++++ b/drivers/devfreq/devfreq.c
+@@ -257,7 +257,7 @@ static struct devfreq_governor *try_then
+               /* Restore previous state before return */
+               mutex_lock(&devfreq_list_lock);
+               if (err)
+-                      return ERR_PTR(err);
++                      return (err < 0) ? ERR_PTR(err) : ERR_PTR(-EINVAL);
+               governor = find_devfreq_governor(name);
+       }
index a409d19f85c4c83e9932b1e800ecd62a06b7129d..828f04f14e89300cd7884c42964f121c63a7ce17 100644 (file)
@@ -305,3 +305,4 @@ powerpc-64s-support-nospectre_v2-cmdline-option.patch
 powerpc-book3s64-fix-link-stack-flush-on-context-switch.patch
 kvm-ppc-book3s-hv-flush-link-stack-on-guest-exit-to-host-kernel.patch
 net-sysfs-fix-netdev_queue_add_kobject-breakage.patch
+pm-devfreq-fix-kernel-oops-on-governor-module-load.patch