Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAABDC678D4 for ; Thu, 2 Mar 2023 07:49:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbjCBHtE (ORCPT ); Thu, 2 Mar 2023 02:49:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbjCBHtA (ORCPT ); Thu, 2 Mar 2023 02:49:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF6B136E9; Wed, 1 Mar 2023 23:48:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ADB88B811D5; Thu, 2 Mar 2023 07:48:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BE5FC433D2; Thu, 2 Mar 2023 07:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677743337; bh=FQxdqTVGL5Tmo2kQBo5EKP1J2REHE/x51/IRsTKSVWs=; h=From:To:Cc:Subject:Date:From; b=XspEgExULtgYyT2/JSwBsz6FMWvp73M05fblk0rUDtaIkFTNpa3sdJCl6KS+PB82O 0LdrLpkJ3AJUGRWSrxuDxTRFwww4PHuL8dwQU+E3j9ZvDAicnUkuLaraD9IcFZxu8l RjPkuwP7WBg+veLyRJJhKrXA00wQHuwtfLADH41PV4xo293Pe9wtVthupiOvAckp6a H3GgcdBwxKozZR+64id5HFNFjaFmaJoWMa3xVoHHgslcFcby4bM8TWbnU+N4yx/4IZ b2Ltl7/MMiFVggQcODjkdw2E6CpHAXmjw3abDL0ZKFi8jEE8PGJRw6K/t/m4eZDZO8 0PKvdSU99bu4w== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pXdgq-0002yX-KC; Thu, 02 Mar 2023 08:49:25 +0100 From: Johan Hovold To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Abhinav Kumar , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH] drm/edid: fix info leak when failing to get panel id Date: Thu, 2 Mar 2023 08:47:04 +0100 Message-Id: <20230302074704.11371-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure to clear the transfer buffer before fetching the EDID to avoid leaking slab data to the logs on errors that leave the buffer unchanged. Fixes: 69c7717c20cc ("drm/edid: Dump the EDID when drm_edid_get_panel_id() has an error") Cc: stable@vger.kernel.org # 6.2 Cc: Douglas Anderson Signed-off-by: Johan Hovold --- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3841aba17abd..8707fe72a028 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2797,7 +2797,7 @@ u32 drm_edid_get_panel_id(struct i2c_adapter *adapter) * the EDID then we'll just return 0. */ - base_block = kmalloc(EDID_LENGTH, GFP_KERNEL); + base_block = kzalloc(EDID_LENGTH, GFP_KERNEL); if (!base_block) return 0; -- 2.39.2