From: Greg Kroah-Hartman Date: Sun, 29 Oct 2023 12:25:02 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v6.1.61~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=968c1ebbe5bd2df5a42c8d06240062f9e5b77864;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: i2c-muxes-i2c-demux-pinctrl-use-of_get_i2c_adapter_by_node.patch i2c-muxes-i2c-mux-gpmux-use-of_get_i2c_adapter_by_node.patch i2c-muxes-i2c-mux-pinctrl-use-of_get_i2c_adapter_by_node.patch perf-core-fix-potential-null-deref.patch --- diff --git a/queue-4.14/i2c-muxes-i2c-demux-pinctrl-use-of_get_i2c_adapter_by_node.patch b/queue-4.14/i2c-muxes-i2c-demux-pinctrl-use-of_get_i2c_adapter_by_node.patch new file mode 100644 index 00000000000..e30fd1a3bd5 --- /dev/null +++ b/queue-4.14/i2c-muxes-i2c-demux-pinctrl-use-of_get_i2c_adapter_by_node.patch @@ -0,0 +1,42 @@ +From 0fb118de5003028ad092a4e66fc6d07b86c3bc94 Mon Sep 17 00:00:00 2001 +From: Herve Codina +Date: Fri, 20 Oct 2023 17:30:12 +0200 +Subject: i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() + +From: Herve Codina + +commit 0fb118de5003028ad092a4e66fc6d07b86c3bc94 upstream. + +i2c-demux-pinctrl uses the pair of_find_i2c_adapter_by_node() / +i2c_put_adapter(). These pair alone is not correct to properly lock the +I2C parent adapter. + +Indeed, i2c_put_adapter() decrements the module refcount while +of_find_i2c_adapter_by_node() does not increment it. This leads to an +underflow of the parent module refcount. + +Use the dedicated function, of_get_i2c_adapter_by_node(), to handle +correctly the module refcount. + +Fixes: 50a5ba876908 ("i2c: mux: demux-pinctrl: add driver") +Signed-off-by: Herve Codina +Cc: stable@vger.kernel.org +Acked-by: Peter Rosin +Reviewed-by: Jonathan Cameron +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/i2c/muxes/i2c-demux-pinctrl.c ++++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c +@@ -63,7 +63,7 @@ static int i2c_demux_activate_master(str + if (ret) + goto err; + +- adap = of_find_i2c_adapter_by_node(priv->chan[new_chan].parent_np); ++ adap = of_get_i2c_adapter_by_node(priv->chan[new_chan].parent_np); + if (!adap) { + ret = -ENODEV; + goto err_with_revert; diff --git a/queue-4.14/i2c-muxes-i2c-mux-gpmux-use-of_get_i2c_adapter_by_node.patch b/queue-4.14/i2c-muxes-i2c-mux-gpmux-use-of_get_i2c_adapter_by_node.patch new file mode 100644 index 00000000000..1d337d0ff06 --- /dev/null +++ b/queue-4.14/i2c-muxes-i2c-mux-gpmux-use-of_get_i2c_adapter_by_node.patch @@ -0,0 +1,42 @@ +From 3dc0ec46f6e7511fc4fdf6b6cda439382bc957f1 Mon Sep 17 00:00:00 2001 +From: Herve Codina +Date: Fri, 20 Oct 2023 17:30:13 +0200 +Subject: i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() + +From: Herve Codina + +commit 3dc0ec46f6e7511fc4fdf6b6cda439382bc957f1 upstream. + +i2c-mux-gpmux uses the pair of_find_i2c_adapter_by_node() / +i2c_put_adapter(). These pair alone is not correct to properly lock the +I2C parent adapter. + +Indeed, i2c_put_adapter() decrements the module refcount while +of_find_i2c_adapter_by_node() does not increment it. This leads to an +underflow of the parent module refcount. + +Use the dedicated function, of_get_i2c_adapter_by_node(), to handle +correctly the module refcount. + +Fixes: ac8498f0ce53 ("i2c: i2c-mux-gpmux: new driver") +Signed-off-by: Herve Codina +Cc: stable@vger.kernel.org +Acked-by: Peter Rosin +Reviewed-by: Jonathan Cameron +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/muxes/i2c-mux-gpmux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/i2c/muxes/i2c-mux-gpmux.c ++++ b/drivers/i2c/muxes/i2c-mux-gpmux.c +@@ -55,7 +55,7 @@ static struct i2c_adapter *mux_parent_ad + dev_err(dev, "Cannot parse i2c-parent\n"); + return ERR_PTR(-ENODEV); + } +- parent = of_find_i2c_adapter_by_node(parent_np); ++ parent = of_get_i2c_adapter_by_node(parent_np); + of_node_put(parent_np); + if (!parent) + return ERR_PTR(-EPROBE_DEFER); diff --git a/queue-4.14/i2c-muxes-i2c-mux-pinctrl-use-of_get_i2c_adapter_by_node.patch b/queue-4.14/i2c-muxes-i2c-mux-pinctrl-use-of_get_i2c_adapter_by_node.patch new file mode 100644 index 00000000000..b2fd5a550a2 --- /dev/null +++ b/queue-4.14/i2c-muxes-i2c-mux-pinctrl-use-of_get_i2c_adapter_by_node.patch @@ -0,0 +1,42 @@ +From 3171d37b58a76e1febbf3f4af2d06234a98cf88b Mon Sep 17 00:00:00 2001 +From: Herve Codina +Date: Fri, 20 Oct 2023 17:30:11 +0200 +Subject: i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() + +From: Herve Codina + +commit 3171d37b58a76e1febbf3f4af2d06234a98cf88b upstream. + +i2c-mux-pinctrl uses the pair of_find_i2c_adapter_by_node() / +i2c_put_adapter(). These pair alone is not correct to properly lock the +I2C parent adapter. + +Indeed, i2c_put_adapter() decrements the module refcount while +of_find_i2c_adapter_by_node() does not increment it. This leads to an +underflow of the parent module refcount. + +Use the dedicated function, of_get_i2c_adapter_by_node(), to handle +correctly the module refcount. + +Fixes: c4aee3e1b0de ("i2c: mux: pinctrl: remove platform_data") +Signed-off-by: Herve Codina +Cc: stable@vger.kernel.org +Acked-by: Peter Rosin +Reviewed-by: Jonathan Cameron +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/i2c/muxes/i2c-mux-pinctrl.c ++++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c +@@ -73,7 +73,7 @@ static struct i2c_adapter *i2c_mux_pinct + dev_err(dev, "Cannot parse i2c-parent\n"); + return ERR_PTR(-ENODEV); + } +- parent = of_find_i2c_adapter_by_node(parent_np); ++ parent = of_get_i2c_adapter_by_node(parent_np); + of_node_put(parent_np); + if (!parent) + return ERR_PTR(-EPROBE_DEFER); diff --git a/queue-4.14/perf-core-fix-potential-null-deref.patch b/queue-4.14/perf-core-fix-potential-null-deref.patch new file mode 100644 index 00000000000..1d2f5de2ddf --- /dev/null +++ b/queue-4.14/perf-core-fix-potential-null-deref.patch @@ -0,0 +1,32 @@ +From a71ef31485bb51b846e8db8b3a35e432cc15afb5 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Tue, 24 Oct 2023 11:42:21 +0200 +Subject: perf/core: Fix potential NULL deref + +From: Peter Zijlstra + +commit a71ef31485bb51b846e8db8b3a35e432cc15afb5 upstream. + +Smatch is awesome. + +Fixes: 32671e3799ca ("perf: Disallow mis-matched inherited group reads") +Reported-by: Dan Carpenter +Signed-off-by: Peter Zijlstra (Intel) +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + kernel/events/core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -11059,7 +11059,8 @@ static int inherit_group(struct perf_eve + if (IS_ERR(child_ctr)) + return PTR_ERR(child_ctr); + } +- leader->group_generation = parent_event->group_generation; ++ if (leader) ++ leader->group_generation = parent_event->group_generation; + return 0; + } + diff --git a/queue-4.14/series b/queue-4.14/series index c96dc5c0275..98268a38328 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -7,3 +7,7 @@ r8152-increase-usb-control-msg-timeout-to-5000ms-as-.patch tcp-fix-wrong-rto-timeout-when-received-sack-renegin.patch gtp-uapi-fix-gtpa_max.patch i40e-fix-wrong-check-for-i40e_txr_flags_wb_on_itr.patch +i2c-muxes-i2c-mux-pinctrl-use-of_get_i2c_adapter_by_node.patch +i2c-muxes-i2c-mux-gpmux-use-of_get_i2c_adapter_by_node.patch +i2c-muxes-i2c-demux-pinctrl-use-of_get_i2c_adapter_by_node.patch +perf-core-fix-potential-null-deref.patch