Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4822815ybl; Wed, 22 Jan 2020 05:25:08 -0800 (PST) X-Google-Smtp-Source: APXvYqw0cdNFgr7/KWBftrcsTFkxBjRu+Y9biMHlDXQd5rqWg2YzctlkAkTTzJ3Tosf9+lcaGPyh X-Received: by 2002:a05:6808:251:: with SMTP id m17mr6779808oie.15.1579699508614; Wed, 22 Jan 2020 05:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699508; cv=none; d=google.com; s=arc-20160816; b=nL7/yVbpSiyH+CIB/TtZuWa9lEH4OoFnqZvuLsaBL2x3sMftKBacETza5lrPkh64Bw /uIwCw55apOBn4Z7Wluj8LAZILCd2UU4BZ5lpSH3lOnr/uNHnTi5Z+HCS7SkejX1GINb 5iUgeT/Fi0skl8Ur48G2c8mjcuNI7VEAVDf0OyXs57Xjleo9lXrKNIDE7pq/cTNDorXq 1kJciWcB4g1MC6XNqLdUa7Rp3+T4TzzoiMtjV58qXPovE0mgR66+Z04p/zW0iuIUdEXS VzWFC2u+zc6cFMduSwPGUNmkR7E4gQUfQUSbxv/Si1BpcOjSIDfISD/5nNhJnriaU5qF /cPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RVM7JTpsBZnFRScVEJG2nbCvgM4YZI0j2qkUjZ5ZxqI=; b=QQo6wmagkkSvYD5kWq0YZ944OFFNm7oFgQKr8G2CQpUkKGJ86b9VE0u4AmrZWNgl3V pQQmS2IDvuQCBSSC61IP/VWFfDvjJ9fibnvwcBGKxso0aLNXNlRfTZmf8X21mZP0xqkl 6qwsNtietKWUZTZ4DeDobHSitVgV/KOvr8/8PRiGPMSpff5OUV2XOIK0qYP5dHkSoX9M rVE4QUK4LJfKVrWZ3UtAN8yFZAvSuq3sY0G9OGUlaxk4JASpt3OddRANlpX2Bx7spcIs O8CTicN3i4I8NzxFoJSNBz4RnajIlGqUTAfKDGU0C2rpDq0Xt+fdwrc+l8LNL/BUsfO/ aR+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VlIWes2z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si1820789oti.229.2020.01.22.05.24.55; Wed, 22 Jan 2020 05:25:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VlIWes2z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730923AbgAVNYE (ORCPT + 99 others); Wed, 22 Jan 2020 08:24:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:42750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729740AbgAVNYD (ORCPT ); Wed, 22 Jan 2020 08:24:03 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ACB35205F4; Wed, 22 Jan 2020 13:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699443; bh=LKn34jeZ7BEJ305ROwgKrRwdo1cq3ycsr0mq4leW8Nw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VlIWes2zpLncb16nB7UnDc1K/NlW3Srk3iJAmFa6N3cMz4Z1XRrpQAloV4tSnMDkk 5XNRxJt1NGQo9zOaehCZ173I4tuJvhqgk+7cCaJIb8VVix4ScnG4HZJTFOFLtzMQ0O tputaoGDI5dHWwzf8a9KgPdRgOhKmombZV43itbs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , "David S. Miller" Subject: [PATCH 5.4 145/222] net/wan/fsl_ucc_hdlc: fix out of bounds write on array utdm_info Date: Wed, 22 Jan 2020 10:28:51 +0100 Message-Id: <20200122092844.113309872@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit ddf420390526ede3b9ff559ac89f58cb59d9db2f ] Array utdm_info is declared as an array of MAX_HDLC_NUM (4) elements however up to UCC_MAX_NUM (8) elements are potentially being written to it. Currently we have an array out-of-bounds write error on the last 4 elements. Fix this by making utdm_info UCC_MAX_NUM elements in size. Addresses-Coverity: ("Out-of-bounds write") Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/fsl_ucc_hdlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -73,7 +73,7 @@ static struct ucc_tdm_info utdm_primary_ }, }; -static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM]; +static struct ucc_tdm_info utdm_info[UCC_MAX_NUM]; static int uhdlc_init(struct ucc_hdlc_private *priv) {