public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Peter Kosyh <pkosyh@yandex.ru>
Cc: stable@vger.kernel.org, Netanel Belgazal <netanel@amazon.com>,
	Arthur Kiyanovski <akiyano@amazon.com>,
	Guy Tzalik <gtzalik@amazon.com>,
	Saeed Bishara <saeedb@amazon.com>,
	Zorik Machulsky <zorik@amazon.com>,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH 5.10 1/1] eth: ena: Check return value of xdp_convert_buff_to_frame
Date: Mon, 3 Oct 2022 15:59:08 +0200	[thread overview]
Message-ID: <YzrqrC2soSLjxfLD@kroah.com> (raw)
In-Reply-To: <20221003114819.349535-2-pkosyh@yandex.ru>

On Mon, Oct 03, 2022 at 02:48:19PM +0300, Peter Kosyh wrote:
> Return value of a function 'xdp_convert_buff_to_frame' is dereferenced
> without checking for null, but it is usually checked for this function.
> 
> This fixed in upstream commit <e8223eeff02> while refactoring.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Peter Kosyh <pkosyh@yandex.ru>
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> index 52414ac2c901..9e6b2bd73dac 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -237,6 +237,8 @@ static int ena_xdp_tx_map_buff(struct ena_ring *xdp_ring,
>  	u32 size;
>  
>  	tx_info->xdpf = xdp_convert_buff_to_frame(xdp);
> +	if (unlikely(!tx_info->xdpf))
> +		goto error_report_dma_error;
>  	size = tx_info->xdpf->len;
>  	ena_buf = tx_info->bufs;
>  
> -- 
> 2.37.0
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

  reply	other threads:[~2022-10-03 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03 11:48 [PATCH 5.10 0/1] eth: ena: Check return value of xdp_convert_buff_to_frame Peter Kosyh
2022-10-03 11:48 ` [PATCH 5.10 1/1] " Peter Kosyh
2022-10-03 13:59   ` Greg Kroah-Hartman [this message]
2022-10-05 10:45     ` Greg Kroah-Hartman

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=YzrqrC2soSLjxfLD@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akiyano@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=lvc-project@linuxtesting.org \
    --cc=netanel@amazon.com \
    --cc=pkosyh@yandex.ru \
    --cc=saeedb@amazon.com \
    --cc=stable@vger.kernel.org \
    --cc=zorik@amazon.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