Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1016607pxb; Wed, 6 Apr 2022 06:48:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4xbMT/ZInasctf5aI14D3F8WQinSG6SDijW827fNJN2GeVkGrIdY0wwi87AfT5bqxszKt X-Received: by 2002:a05:6a00:1256:b0:4fb:1374:2f65 with SMTP id u22-20020a056a00125600b004fb13742f65mr9152299pfi.72.1649252916657; Wed, 06 Apr 2022 06:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252916; cv=none; d=google.com; s=arc-20160816; b=eyGyZaADKQpqUOIr2m41eq7ABQLaYFRW4wyqcc24AoMlrcRabT1+sofqXHfaKPzsnU fCsASQLMZDY3XmKL2Hd+LQtIwgNDmMDpKarZtlkuWGpL8D4CVVNIAgkCoayVJVNPaF/d rQsqCnyp7VwQV0o0GTJtMsZv5kSUyzUvQXYcySXzkAmKn/XI9x7bhivlScWphgaluEUH ShX35ekPgwe3Ih74fWG29GA3Eg6VuoFqbwRmberneDx4grOpj/+WxR2xLNgXiDeIzoEP r0I3650ZU53V4+fdaTk7XScderF1iiFI5m/papfGuf7JfMPtgx2zPOte+1zAlX1xFs+G S82g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9gyMZMEirlHM5Ax64JcXPRruRA9YwXXMqz+hZX/daWc=; b=UCRIbPVBJ2B1OQ2ZgMbG7FlXzy6gC+RgVL1cKAUTIjEC6YtmZmsxm0RrnQrOr7MhSL 1CmV2nfCJ7JPoruAQU9CsSbTziExHo1nyJ44cQT5nEc3VYIylU4nXcd4IePTJfKxGqpl VhvfOAuH4zTrp+bBUTAf2REfZsmGsQ8sPeANZTARNhIhBEJFBPcdkiBia/zBlfZuMLv1 1MFMMwKFDT1JC6NPWEqlJwSGfdZhDEM+NYnTdDgO5weqezYJjHZ4+Vtjn2LleiJSkp1b Z6g0eCQEWfwQNfS8/dIV9KML1FlmtQoabYaOMU87TL7XymuTgumqpaWpm5PKq2RBuPZt LRUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YlQwB8he; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s8-20020a170902ea0800b00156a809ef6asi9638822plg.402.2022.04.06.06.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YlQwB8he; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48327614F44; Wed, 6 Apr 2022 04:43:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1843368AbiDFBks (ORCPT + 99 others); Tue, 5 Apr 2022 21:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349083AbiDEJtF (ORCPT ); Tue, 5 Apr 2022 05:49:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6EE0A9954; Tue, 5 Apr 2022 02:40:21 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 6131461368; Tue, 5 Apr 2022 09:40:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 739ADC385A1; Tue, 5 Apr 2022 09:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151620; bh=FRqpS+ncOPgVVYOIeYZRCM3+5pFDlgJHad2SKWV8qzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YlQwB8hepa67lIyl9waxsGNAEUK5mVFIxBDaz6QMRu1+Iusp9wHjpJZ+Y32q8CJRD nz9FtGLpMp9j3N5luAH3Z5zUVZEMwoszKmg9R6U2xTIiCnQVyxDeipwekQf38xdL4W pgkgb6+kdgsdt52jUI6cv4XkJPEwHyMkLSuAl0wU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pin-Yen Lin , Jernej Skrabec , Robert Foss , Sasha Levin Subject: [PATCH 5.15 454/913] drm/bridge: anx7625: Fix overflow issue on reading EDID Date: Tue, 5 Apr 2022 09:25:16 +0200 Message-Id: <20220405070353.457356586@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pin-Yen Lin [ Upstream commit d5c6f647aec9ed524aedd04a3aec5ebc21d39007 ] The length of EDID block can be longer than 256 bytes, so we should use `int` instead of `u8` for the `edid_pos` variable. Fixes: 8bdfc5dae4e3 ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP") Signed-off-by: Pin-Yen Lin Reviewed-by: Jernej Skrabec Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220210103827.402436-1-treapking@chromium.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/analogix/anx7625.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index ea414cd349b5..392a9c56e9a0 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -791,7 +791,8 @@ static int segments_edid_read(struct anx7625_data *ctx, static int sp_tx_edid_read(struct anx7625_data *ctx, u8 *pedid_blocks_buf) { - u8 offset, edid_pos; + u8 offset; + int edid_pos; int count, blocks_num; u8 pblock_buf[MAX_DPCD_BUFFER_SIZE]; u8 i, j; -- 2.34.1