[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+sq2CdeKDq6=jDk=mZeSaOVa9N25WvQU8V-k61bYp6ZyN8q-w@mail.gmail.com>
Date: Sat, 20 Feb 2021 00:06:01 +0530
From: Sunil Kovvuri <sunil.kovvuri@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Sunil Goutham <sgoutham@...vell.com>,
Christina Jacob <cjacob@...vell.com>,
Linu Cherian <lcherian@...vell.com>,
Geetha sowjanya <gakula@...vell.com>,
Jerin Jacob <jerinj@...vell.com>,
hariprasad <hkelam@...vell.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Prakash Brahmajyosyula <bprakash@...vell.com>,
Linux Netdev List <netdev@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net] octeontx2-af: Fix an off by one in rvu_dbg_qsize_write()
On Fri, Feb 19, 2021 at 3:31 PM Dan Carpenter <dan.carpenter@...cle.com> wrote:
>
> This code does not allocate enough memory for the NUL terminator so it
> ends up putting it one character beyond the end of the buffer.
>
> Fixes: 8756828a8148 ("octeontx2-af: Add NPA aura and pool contexts to debugfs")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
> drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> index 48a84c65804c..d5f3ad660588 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> @@ -385,7 +385,7 @@ static ssize_t rvu_dbg_qsize_write(struct file *filp,
> u16 pcifunc;
> int ret, lf;
>
> - cmd_buf = memdup_user(buffer, count);
> + cmd_buf = memdup_user(buffer, count + 1);
> if (IS_ERR(cmd_buf))
> return -ENOMEM;
>
> --
> 2.30.0
>
Thanks for the fix.
Powered by blists - more mailing lists