Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp750220pxb; Tue, 5 Apr 2022 21:41:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEdLOgX5j20fgWv02SQNZqLxj8AHq2FLzg0+MLk7Xv/zd4FRdaak0An4/a7Q9LZqm1APz0 X-Received: by 2002:a17:902:f612:b0:14c:e978:f99e with SMTP id n18-20020a170902f61200b0014ce978f99emr6886362plg.23.1649220100614; Tue, 05 Apr 2022 21:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649220100; cv=none; d=google.com; s=arc-20160816; b=PZfuX2Jf37oNVVlzGOvwSguHjXwc9F4q5/LTXUvlFipaaZ9Gx8XsPvr3y+QR9OvL9h E99GuW8t6LSf4DdMd/SUkBWAc9ffgLn32h3kmor2XVlkwUKqYvQLa9yKNUhTfFUh4CjW m7l+/u19kDMCSZ7DMZMZ2vFI0pBmK7snno9LAdA1nXVIC8Bg90Yud2M5Bavfd3958p5v A/nCsbiWN60Y+jKDUyxoug5tmuzvHePRug9YbMPFLiCN5+HvuC1M16hKvqtDlRKMBCDe 0b+6hFEZHtvdN8lMg2/LkpasxokTGEwC/cbjFqGP5tHl5BICsSfUfN5OMz8+9JHIANEU ibCA== 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=zQvKJ+X360ljBlPV0/Qu6ZmNw7cNm9JtupVlkEyGQ1A=; b=B9ZqxhF6L6DqEXSU6D/jlLsMvnJoAfjPB9GQMaDygBUtxzZqrc1+KZArW1iwklQ/oX t5hECuO2B0H/Sto1hNDHKGMc4kkIslzMHZErfTEFe9JVYzcZeznVVlnNrhyhIKoa3+E7 aVKdm4yopf3ZK94TzWMBBj9dcfbv+Xr3toAxw5Ey2P1tNUnQSLF/BUNQYNacDWk2KYt8 XCefD0ccJzYU9q8xQGV8j5QOpBTJIVPUPcd8HKPQJZYYB2swwAUDekpAuPvU3YIAd1D2 iHiZ7Dtwp8TmoyKbDrkBL0ATxVhSSgL7bZXwCekginJetzu45fPJ+PwUoSCYATWWAxAK hc9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XIfGGpCv; 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 q9-20020a635049000000b003816ff876bfsi15135108pgl.5.2022.04.05.21.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:41:40 -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=XIfGGpCv; 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 12BA1EEA67; Tue, 5 Apr 2022 20:01:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382083AbiDEMAk (ORCPT + 99 others); Tue, 5 Apr 2022 08:00:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236378AbiDEIQn (ORCPT ); Tue, 5 Apr 2022 04:16:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 849166FA02; Tue, 5 Apr 2022 01:04:01 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3AAD7B81BBC; Tue, 5 Apr 2022 08:03:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82335C385A4; Tue, 5 Apr 2022 08:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145830; bh=+dtZf56pDcVGj1Y2yGsngkE8Pr8vjsaRXriBUUn+Sa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XIfGGpCvyIJgGXR2Jwu/4cS+3RAQHWFaiLZj2mGrr8eWoQDFUNjbb20RnW0/A2Qby irIo1Swi9CoruaIV83NPsY/5xlhA+x+pB1t1yudRIpJVoYw0c64ZNPSTOm+Eq53kgn dwnV3hcojviaJYRSXtOItVg2wZ7UI+jBs4dx9qG8= 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.17 0544/1126] drm/bridge: anx7625: Fix overflow issue on reading EDID Date: Tue, 5 Apr 2022 09:21:31 +0200 Message-Id: <20220405070423.600520464@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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 2346dbcc505f..e596cacce9e3 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -846,7 +846,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