Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932823AbbBBQi7 (ORCPT ); Mon, 2 Feb 2015 11:38:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58075 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932477AbbBBQix (ORCPT ); Mon, 2 Feb 2015 11:38:53 -0500 Date: Mon, 2 Feb 2015 08:38:52 -0800 From: Greg KH To: Quentin Casasnovas Cc: David Airlie , stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i915: stack address leak when failing to read registers. Message-ID: <20150202163852.GB7055@kroah.com> References: <1422885516-533-1-git-send-email-quentin.casasnovas@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422885516-533-1-git-send-email-quentin.casasnovas@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1643 Lines: 36 On Mon, Feb 02, 2015 at 02:58:36PM +0100, Quentin Casasnovas wrote: > It is possible for the *_read*() functions to fail, in which case it'll > leave its third argument untouched. Most of the code do not check the > return value of *_read*() functions, and will happily use garbage from the > stack to test various things. For example, ch7xxx_dump_regs() will leak 1 > byte from the stack in case of failure, ivch_dump_regs() 2 bytes, etc. > > Instead of fixing every caller to check the return value, just clear the > output variable so this patch can easily go to -stable. A proper fix would > probably to check the return value everywhere though, since it does not > make much sense to carry on talking to the ship after some error. > > This issue was found by code review while preparing Ksplice updates. > > Signed-off-by: Quentin Casasnovas > --- > drivers/gpu/drm/i915/dvo_ch7017.c | 1 + > drivers/gpu/drm/i915/dvo_ch7xxx.c | 1 + > drivers/gpu/drm/i915/dvo_ivch.c | 1 + > drivers/gpu/drm/i915/dvo_ns2501.c | 2 +- > drivers/gpu/drm/i915/dvo_sil164.c | 1 + > drivers/gpu/drm/i915/dvo_tfp410.c | 1 + > 6 files changed, 6 insertions(+), 1 deletion(-) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/