From: Greg Kroah-Hartman Date: Thu, 28 Dec 2023 12:12:47 +0000 (+0000) Subject: 5.4-stable patches X-Git-Tag: v6.1.70~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9cc98f7ab741ac74a2ed3767b5af13ae1e01313f;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: drm-i915-reject-async-flips-with-bigjoiner.patch input-soc_button_array-add-mapping-for-airplane-mode-button.patch net-9p-avoid-freeing-uninit-memory-in-p9pdu_vreadf.patch net-rfkill-gpio-set-gpio-direction.patch --- diff --git a/queue-5.4/drm-i915-reject-async-flips-with-bigjoiner.patch b/queue-5.4/drm-i915-reject-async-flips-with-bigjoiner.patch new file mode 100644 index 00000000000..80bb3b262c8 --- /dev/null +++ b/queue-5.4/drm-i915-reject-async-flips-with-bigjoiner.patch @@ -0,0 +1,47 @@ +From 88a173e5dd05e788068e8fa20a8c37c44bd8f416 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Mon, 11 Dec 2023 10:11:34 +0200 +Subject: drm/i915: Reject async flips with bigjoiner +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit 88a173e5dd05e788068e8fa20a8c37c44bd8f416 upstream. + +Currently async flips are busted when bigjoiner is in use. +As a short term fix simply reject async flips in that case. + +Cc: stable@vger.kernel.org +Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9769 +Signed-off-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20231211081134.2698-1-ville.syrjala@linux.intel.com +Reviewed-by: Stanislav Lisovskiy +(cherry picked from commit e93bffc2ac0a833b42841f31fff955549d38ce98) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/display/intel_display.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/gpu/drm/i915/display/intel_display.c ++++ b/drivers/gpu/drm/i915/display/intel_display.c +@@ -14142,6 +14142,17 @@ static void intel_atomic_track_fbs(struc + struct intel_plane *plane; + int i; + ++ /* ++ * FIXME: Bigjoiner+async flip is busted currently. ++ * Remove this check once the issues are fixed. ++ */ ++ if (new_crtc_state->bigjoiner_pipes) { ++ drm_dbg_kms(&i915->drm, ++ "[CRTC:%d:%s] async flip disallowed with bigjoiner\n", ++ crtc->base.base.id, crtc->base.name); ++ return -EINVAL; ++ } ++ + for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state, + new_plane_state, i) + intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb), diff --git a/queue-5.4/input-soc_button_array-add-mapping-for-airplane-mode-button.patch b/queue-5.4/input-soc_button_array-add-mapping-for-airplane-mode-button.patch new file mode 100644 index 00000000000..6e3606fd227 --- /dev/null +++ b/queue-5.4/input-soc_button_array-add-mapping-for-airplane-mode-button.patch @@ -0,0 +1,43 @@ +From ea3715941a9b7d816a1e9096ac0577900af2a69e Mon Sep 17 00:00:00 2001 +From: Christoffer Sandberg +Date: Fri, 22 Dec 2023 23:25:38 -0800 +Subject: Input: soc_button_array - add mapping for airplane mode button + +From: Christoffer Sandberg + +commit ea3715941a9b7d816a1e9096ac0577900af2a69e upstream. + +This add a mapping for the airplane mode button on the TUXEDO Pulse Gen3. + +While it is physically a key it behaves more like a switch, sending a key +down on first press and a key up on 2nd press. Therefor the switch event +is used here. Besides this behaviour it uses the HID usage-id 0xc6 +(Wireless Radio Button) and not 0xc8 (Wireless Radio Slider Switch), but +since neither 0xc6 nor 0xc8 are currently implemented at all in +soc_button_array this not to standard behaviour is not put behind a quirk +for the moment. + +Signed-off-by: Christoffer Sandberg +Signed-off-by: Werner Sembach +Link: https://lore.kernel.org/r/20231215171718.80229-1-wse@tuxedocomputers.com +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/misc/soc_button_array.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/input/misc/soc_button_array.c ++++ b/drivers/input/misc/soc_button_array.c +@@ -192,6 +192,11 @@ static int soc_button_parse_btn_desc(str + info->name = "power"; + info->event_code = KEY_POWER; + info->wakeup = true; ++ } else if (upage == 0x01 && usage == 0xc6) { ++ info->name = "airplane mode switch"; ++ info->event_type = EV_SW; ++ info->event_code = SW_RFKILL_ALL; ++ info->active_low = false; + } else if (upage == 0x01 && usage == 0xca) { + info->name = "rotation lock switch"; + info->event_type = EV_SW; diff --git a/queue-5.4/net-9p-avoid-freeing-uninit-memory-in-p9pdu_vreadf.patch b/queue-5.4/net-9p-avoid-freeing-uninit-memory-in-p9pdu_vreadf.patch new file mode 100644 index 00000000000..5af06b0de4a --- /dev/null +++ b/queue-5.4/net-9p-avoid-freeing-uninit-memory-in-p9pdu_vreadf.patch @@ -0,0 +1,82 @@ +From ff49bf1867578f23a5ffdd38f927f6e1e16796c4 Mon Sep 17 00:00:00 2001 +From: Fedor Pchelkin +Date: Wed, 6 Dec 2023 23:09:13 +0300 +Subject: net: 9p: avoid freeing uninit memory in p9pdu_vreadf + +From: Fedor Pchelkin + +commit ff49bf1867578f23a5ffdd38f927f6e1e16796c4 upstream. + +If some of p9pdu_readf() calls inside case 'T' in p9pdu_vreadf() fails, +the error path is not handled properly. *wnames or members of *wnames +array may be left uninitialized and invalidly freed. + +Initialize *wnames to NULL in beginning of case 'T'. Initialize the first +*wnames array element to NULL and nullify the failing *wnames element so +that the error path freeing loop stops on the first NULL element and +doesn't proceed further. + +Found by Linux Verification Center (linuxtesting.org). + +Fixes: ace51c4dd2f9 ("9p: add new protocol support code") +Signed-off-by: Fedor Pchelkin +Message-ID: <20231206200913.16135-1-pchelkin@ispras.ru> +Cc: stable@vger.kernel.org +Reviewed-by: Simon Horman +Reviewed-by: Christian Schoenebeck +Signed-off-by: Dominique Martinet +Signed-off-by: Greg Kroah-Hartman +--- + net/9p/protocol.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +--- a/net/9p/protocol.c ++++ b/net/9p/protocol.c +@@ -228,6 +228,8 @@ p9pdu_vreadf(struct p9_fcall *pdu, int p + uint16_t *nwname = va_arg(ap, uint16_t *); + char ***wnames = va_arg(ap, char ***); + ++ *wnames = NULL; ++ + errcode = p9pdu_readf(pdu, proto_version, + "w", nwname); + if (!errcode) { +@@ -237,6 +239,8 @@ p9pdu_vreadf(struct p9_fcall *pdu, int p + GFP_NOFS); + if (!*wnames) + errcode = -ENOMEM; ++ else ++ (*wnames)[0] = NULL; + } + + if (!errcode) { +@@ -248,8 +252,10 @@ p9pdu_vreadf(struct p9_fcall *pdu, int p + proto_version, + "s", + &(*wnames)[i]); +- if (errcode) ++ if (errcode) { ++ (*wnames)[i] = NULL; + break; ++ } + } + } + +@@ -257,11 +263,14 @@ p9pdu_vreadf(struct p9_fcall *pdu, int p + if (*wnames) { + int i; + +- for (i = 0; i < *nwname; i++) ++ for (i = 0; i < *nwname; i++) { ++ if (!(*wnames)[i]) ++ break; + kfree((*wnames)[i]); ++ } ++ kfree(*wnames); ++ *wnames = NULL; + } +- kfree(*wnames); +- *wnames = NULL; + } + } + break; diff --git a/queue-5.4/net-rfkill-gpio-set-gpio-direction.patch b/queue-5.4/net-rfkill-gpio-set-gpio-direction.patch new file mode 100644 index 00000000000..ee605a1df9c --- /dev/null +++ b/queue-5.4/net-rfkill-gpio-set-gpio-direction.patch @@ -0,0 +1,45 @@ +From 23484d817082c3005252d8edfc8292c8a1006b5b Mon Sep 17 00:00:00 2001 +From: Rouven Czerwinski +Date: Thu, 7 Dec 2023 08:58:36 +0100 +Subject: net: rfkill: gpio: set GPIO direction + +From: Rouven Czerwinski + +commit 23484d817082c3005252d8edfc8292c8a1006b5b upstream. + +Fix the undefined usage of the GPIO consumer API after retrieving the +GPIO description with GPIO_ASIS. The API documentation mentions that +GPIO_ASIS won't set a GPIO direction and requires the user to set a +direction before using the GPIO. + +This can be confirmed on i.MX6 hardware, where rfkill-gpio is no longer +able to enabled/disable a device, presumably because the GPIO controller +was never configured for the output direction. + +Fixes: b2f750c3a80b ("net: rfkill: gpio: prevent value glitch during probe") +Cc: stable@vger.kernel.org +Signed-off-by: Rouven Czerwinski +Link: https://msgid.link/20231207075835.3091694-1-r.czerwinski@pengutronix.de +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/rfkill/rfkill-gpio.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/net/rfkill/rfkill-gpio.c ++++ b/net/rfkill/rfkill-gpio.c +@@ -116,6 +116,14 @@ static int rfkill_gpio_probe(struct plat + return -EINVAL; + } + ++ ret = gpiod_direction_output(rfkill->reset_gpio, true); ++ if (ret) ++ return ret; ++ ++ ret = gpiod_direction_output(rfkill->shutdown_gpio, true); ++ if (ret) ++ return ret; ++ + rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev, + rfkill->type, &rfkill_gpio_ops, + rfkill); diff --git a/queue-5.4/series b/queue-5.4/series index 28679370d9e..e117f59ffff 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -36,3 +36,7 @@ usb-serial-option-add-quectel-eg912y-module-support.patch usb-serial-option-add-foxconn-t99w265-with-new-baseline.patch usb-serial-option-add-quectel-rm500q-r13-firmware-support.patch bluetooth-hci_event-fix-not-checking-if-hci_op_inquiry-has-been-sent.patch +input-soc_button_array-add-mapping-for-airplane-mode-button.patch +net-9p-avoid-freeing-uninit-memory-in-p9pdu_vreadf.patch +net-rfkill-gpio-set-gpio-direction.patch +drm-i915-reject-async-flips-with-bigjoiner.patch