All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Aleksandr Burakov <a.burakov@rosalinux.ru>
Cc: Frank Haverkamp <haver@linux.ibm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH 2/2] misc: genwqe: card_dev: Array index overflow fix in ddcb_cmd_fixups()
Date: Wed, 7 Dec 2022 17:23:12 +0100	[thread overview]
Message-ID: <Y5C98NpQr2G1bkvs@kroah.com> (raw)
In-Reply-To: <20221207141808.22922-2-a.burakov@rosalinux.ru>

On Wed, Dec 07, 2022 at 05:18:08PM +0300, Aleksandr Burakov wrote:
> &cmd->asiv of size 96 can overflow because its index (asiv_offs + 8)
> can be equal to 96 (0x58 + 0x08) that is out of range.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
> Fixes: eaf4722d4645 ("GenWQE Character device and DDCB queue")
> ---
>  drivers/misc/genwqe/card_dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c
> index 55fc5b80e649..d58ce2622307 100644
> --- a/drivers/misc/genwqe/card_dev.c
> +++ b/drivers/misc/genwqe/card_dev.c
> @@ -867,7 +867,7 @@ static int ddcb_cmd_fixups(struct genwqe_file *cfile, struct ddcb_requ *req)
>  	struct genwqe_ddcb_cmd *cmd = &req->cmd;
>  	struct dma_mapping *m;
>  
> -	for (i = 0, asiv_offs = 0x00; asiv_offs <= 0x58;
> +	for (i = 0, asiv_offs = 0x00; asiv_offs < 0x58;
>  	     i++, asiv_offs += 0x08) {
>  
>  		u64 u_addr;
> -- 
> 2.25.1
> 

Where is patch 1/2 of this series?

  reply	other threads:[~2022-12-07 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 14:18 [PATCH] media: v4l2-flash: fix NULL dereference in v4l2_flash_s_ctrl() Aleksandr Burakov
2022-12-07 14:18 ` [PATCH 2/2] misc: genwqe: card_dev: Array index overflow fix in ddcb_cmd_fixups() Aleksandr Burakov
2022-12-07 16:23   ` Greg Kroah-Hartman [this message]
2022-12-08 10:55     ` Александр Бураков
2022-12-08 13:16       ` Greg Kroah-Hartman
2023-01-16 21:01 ` [PATCH] media: v4l2-flash: fix NULL dereference in v4l2_flash_s_ctrl() Sakari Ailus

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=Y5C98NpQr2G1bkvs@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=a.burakov@rosalinux.ru \
    --cc=arnd@arndb.de \
    --cc=haver@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.