This is a note to let you know that I've just added the patch titled
drm/i915/audio: fix check for av_enc_map overflow
to the 4.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: drm-i915-audio-fix-check-for-av_enc_map-overflow.patch and it can be found in the queue-4.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From 72a6d72c2cd03bba7b70117b63dea83d2de88057 Mon Sep 17 00:00:00 2001
From: Jani Nikula jani.nikula@intel.com Date: Wed, 14 Feb 2018 19:38:40 +0200 Subject: drm/i915/audio: fix check for av_enc_map overflow
From: Jani Nikula jani.nikula@intel.com
commit 72a6d72c2cd03bba7b70117b63dea83d2de88057 upstream.
Turns out -1 >= ARRAY_SIZE() is always true. Move the bounds check where we know pipe >= 0 and next to the array indexing where it makes most sense.
Fixes: 9965db26ac05 ("drm/i915: Check for fused or unused pipes") Fixes: 0b7029b7e43f ("drm/i915: Check for fused or unused pipes") Cc: stable@vger.kernel.org # v4.10+ Cc: Mika Kahola mika.kahola@intel.com Cc: Rodrigo Vivi rodrigo.vivi@intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Cc: Joonas Lahtinen joonas.lahtinen@linux.intel.com Cc: intel-gfx@lists.freedesktop.org Reviewed-by: Dhinakaran Pandiyan dhinakaran.pandiyan@intel.com Reviewed-by: Mika Kahola mika.kahola@intel.com Signed-off-by: Jani Nikula jani.nikula@intel.com Link: https://patchwork.freedesktop.org/patch/msgid/20180214173840.25360-1-jani.ni... (cherry picked from commit cdb3db8542d854bd678d60cd28861b042e191672) Signed-off-by: Rodrigo Vivi rodrigo.vivi@intel.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
--- drivers/gpu/drm/i915/intel_audio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -754,11 +754,11 @@ static struct intel_encoder *get_saved_e { struct intel_encoder *encoder;
- if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map))) - return NULL; - /* MST */ if (pipe >= 0) { + if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map))) + return NULL; + encoder = dev_priv->av_enc_map[pipe]; /* * when bootup, audio driver may not know it is
Patches currently in stable-queue which might be from jani.nikula@intel.com are
queue-4.15/drm-i915-audio-fix-check-for-av_enc_map-overflow.patch queue-4.15/documentation-sphinx-fix-directive-import-error.patch queue-4.15/drm-i915-check-for-fused-or-unused-pipes.patch
linux-stable-mirror@lists.linaro.org