stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Dave Airlie <airlied@redhat.com>,
	Lyude <lyude@redhat.com>, Daniel Vetter <daniel.vetter@ffwll.ch>,
	Imre Deak <imre.deak@intel.com>
Subject: [PATCH 3.18 52/60] drm/mst: Fix error handling during MST sideband message reception
Date: Tue, 25 Jul 2017 12:16:43 -0700	[thread overview]
Message-ID: <20170725191621.533720576@linuxfoundation.org> (raw)
In-Reply-To: <20170725191614.043749784@linuxfoundation.org>

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Imre Deak <imre.deak@intel.com>

commit 448421b5e93b9177c5698f0cf6f5e72d2995eeca upstream.

Handle any error due to partial reads, timeouts etc. to avoid parsing
uninitialized data subsequently. Also bail out if the parsing itself
fails.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Lyude <lyude@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Lyude <lyude@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170719114330.26540-2-imre.deak@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/drm_dp_mst_topology.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2081,11 +2081,17 @@ static void drm_dp_get_one_sb_msg(struct
 		ret = drm_dp_dpcd_read(mgr->aux, basereg + curreply,
 				    replyblock, len);
 		if (ret != len) {
-			DRM_DEBUG_KMS("failed to read a chunk\n");
+			DRM_DEBUG_KMS("failed to read a chunk (len %d, ret %d)\n",
+				      len, ret);
+			return;
 		}
+
 		ret = drm_dp_sideband_msg_build(msg, replyblock, len, false);
-		if (ret == false)
+		if (!ret) {
 			DRM_DEBUG_KMS("failed to build sideband msg\n");
+			return;
+		}
+
 		curreply += len;
 		replylen -= len;
 	}

  parent reply	other threads:[~2017-07-25 19:17 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 19:15 [PATCH 3.18 00/60] 3.18.63-stable review Greg Kroah-Hartman
2017-07-25 19:15 ` [PATCH 3.18 01/60] disable new gcc-7.1.1 warnings for now Greg Kroah-Hartman
2017-07-25 19:15 ` [PATCH 3.18 03/60] x86/rtc: Remove duplicate const specifier Greg Kroah-Hartman
2017-07-25 19:15 ` [PATCH 3.18 04/60] [media] ir-core: fix gcc-7 warning on bool arithmetic Greg Kroah-Hartman
2017-07-25 19:15 ` [PATCH 3.18 05/60] CIFS: Fix handle_cancelled_mid callback initialization Greg Kroah-Hartman
2017-07-25 19:15 ` [PATCH 3.18 06/60] ath9k: fix tx99 use after free Greg Kroah-Hartman
2017-07-25 19:15 ` [PATCH 3.18 07/60] ath9k: fix tx99 bus error Greg Kroah-Hartman
2017-07-25 19:15 ` [PATCH 3.18 08/60] NFC: fix broken device allocation Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 09/60] nfc: Ensure presence of required attributes in the activate_target handler Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 10/60] nfc: Fix the sockaddr length sanitization in llcp_sock_connect Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 11/60] include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 12/60] stddef.h: move offsetofend inside #ifndef/#endif guard, neaten Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 13/60] NFC: Add sockaddr length checks before accessing sa_family in bind handlers Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 14/60] Bluetooth: use constant time memory comparison for secret values Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 15/60] ASoC: compress: Derive substream from stream based on direction Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 16/60] PM / Domains: Fix unsafe iteration over modified list of device links Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 17/60] PM / Domains: Fix unsafe iteration over modified list of domain providers Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 18/60] scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 19/60] powerpc/64: Fix atomic64_inc_not_zero() to return an int Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 20/60] powerpc: Fix emulation of mcrf in emulate_step() Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 21/60] powerpc: Fix emulation of mfocrf " Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 22/60] powerpc/asm: Mark cr0 as clobbered in mftb() Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 23/60] af_key: Fix sadb_x_ipsecrequest parsing Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 24/60] PCI/PM: Restore the status of PCI devices across hibernation Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 25/60] xhci: fix 20000ms port resume timeout Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 26/60] xhci: Fix NULL pointer dereference when cleaning up streams for removed host Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 27/60] usb: storage: return on error to avoid a null pointer dereference Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 28/60] USB: cdc-acm: add device-id for quirky printer Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 29/60] usb: renesas_usbhs: fix usbhsc_resume() for !USBHSF_RUNTIME_PWCTRL Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 30/60] md: dont use flush_signals in userspace processes Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 31/60] Raid5 should update rdev->sectors after reshape Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 32/60] s390/syscalls: Fix out of bounds arguments access Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 34/60] f2fs: Dont clear SGID when inheriting ACLs Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 35/60] vfio: Fix group release deadlock Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 36/60] vfio: New external user group/file match Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 37/60] MIPS: Fix mips_atomic_set() retry condition Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 38/60] MIPS: Fix mips_atomic_set() with EVA Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 39/60] MIPS: Negate error syscall return in trace Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 40/60] x86/acpi: Prevent out of bound access caused by broken ACPI tables Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 41/60] MIPS: Save static registers before sysmips Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 42/60] MIPS: Actually decode JALX in `__compute_return_epc_for_insn Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 43/60] MIPS: Fix unaligned PC interpretation in `compute_return_epc Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 44/60] MIPS: math-emu: Prevent wrong ISA mode instruction emulation Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 45/60] Input: i8042 - fix crash at boot time Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 46/60] NFS: only invalidate dentrys that are clearly invalid Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 47/60] udf: Fix deadlock between writeback and udf_setsize() Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 48/60] target: Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 50/60] Revert "perf/core: Drop kernel samples even though :u is specified" Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 51/60] staging: rtl8188eu: add TL-WN722N v2 support Greg Kroah-Hartman
2017-07-25 19:16 ` Greg Kroah-Hartman [this message]
2017-07-25 19:16 ` [PATCH 3.18 53/60] drm/mst: Avoid dereferencing a NULL mstb in drm_dp_mst_handle_up_req() Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 54/60] drm/mst: Avoid processing partially received up/down message transactions Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 55/60] KVM: PPC: Book3S HV: Context-switch EBB registers properly Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 56/60] of: device: Export of_device_{get_modalias, uvent_modalias} to modules Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 57/60] spmi: Include OF based modalias in device uevent Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 58/60] tracing: Fix kmemleak in instance_rmdir Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 59/60] alarmtimer: dont rate limit one-shot timers Greg Kroah-Hartman
2017-07-25 19:16 ` [PATCH 3.18 60/60] MIPS: Send SIGILL for BPOSGE32 in `__compute_return_epc_for_insn Greg Kroah-Hartman
2017-07-26  3:10 ` [PATCH 3.18 00/60] 3.18.63-stable review Guenter Roeck
2017-07-26 14:23 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170725191621.533720576@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=imre.deak@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).