netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
To: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"colin.king@canonical.com" <colin.king@canonical.com>,
	"qiang.zhao@nxp.com" <qiang.zhao@nxp.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net/wan/fsl_ucc_hdlc: fix out of bounds write on array utdm_info
Date: Wed, 15 Jan 2020 17:29:02 +0000	[thread overview]
Message-ID: <335a44aa9bfbec197385c1e0a9cc35cc29fb307d.camel@infinera.com> (raw)
In-Reply-To: <20200114145448.361888-1-colin.king@canonical.com>

On Tue, 2020-01-14 at 14:54 +0000, Colin King wrote:
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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 <colin.king@canonical.com>

This should be sent to stable as well
Cc: <stable@vger.kernel.org> # 4.19.x+

> ---
>  drivers/net/wan/fsl_ucc_hdlc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index 94e870f48e21..9edd94679283 100644
> --- 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_info = {
>         },
>  };
> 
> -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)
>  {
> --
> 2.24.0
> 


  reply	other threads:[~2020-01-15 17:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 14:54 [PATCH] net/wan/fsl_ucc_hdlc: fix out of bounds write on array utdm_info Colin King
2020-01-15 17:29 ` Joakim Tjernlund [this message]
2020-01-15 22:06 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=335a44aa9bfbec197385c1e0a9cc35cc29fb307d.camel@infinera.com \
    --to=joakim.tjernlund@infinera.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=qiang.zhao@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).