All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] net: i40e: prevent access to uninitilized variables in i40e_tx_enable_csum()
Date: Sun, 31 Jan 2016 16:00:30 +0100	[thread overview]
Message-ID: <2765946.QCanWNG0gi@wuerfel> (raw)
In-Reply-To: <56ACE928.3080108@virtuozzo.com>

On Saturday 30 January 2016 19:47:36 Vasily Averin wrote:
> Patch makes safe an access to 'oiph' and 'oudph' variables
> if they was not initilized.
> 
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> index 47bd8b3..779f77e 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> @@ -2363,7 +2363,8 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
>                 }
>                 if ((tx_ring->flags & I40E_TXR_FLAGS_OUTER_UDP_CSUM) &&
>                     (l4_tunnel == I40E_TXD_CTX_UDP_TUNNELING)        &&
> -                   (*cd_tunneling & I40E_TXD_CTX_QW0_EXT_IP_MASK)) {
> +                   (*cd_tunneling & I40E_TXD_CTX_QW0_EXT_IP_MASK)   &&
> +                   oudph && oiph) {
>                         oudph->check = ~csum_tcpudp_magic(oiph->saddr,
>                                         oiph->daddr,
>                                         (skb->len - skb_transport_offset(skb)),

If we can actually get here with oudph==NULL or oiph==NULL, we should back
my patch instead and fix it another way.

In the version we have in net-next, that is not possible.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Vasily Averin <vvs@virtuozzo.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Shannon Nelson <shannon.nelson@intel.com>,
	Carolyn Wyborny <carolyn.wyborny@intel.com>,
	intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH] net: i40e: prevent access to uninitilized variables in i40e_tx_enable_csum()
Date: Sun, 31 Jan 2016 16:00:30 +0100	[thread overview]
Message-ID: <2765946.QCanWNG0gi@wuerfel> (raw)
In-Reply-To: <56ACE928.3080108@virtuozzo.com>

On Saturday 30 January 2016 19:47:36 Vasily Averin wrote:
> Patch makes safe an access to 'oiph' and 'oudph' variables
> if they was not initilized.
> 
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> index 47bd8b3..779f77e 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> @@ -2363,7 +2363,8 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
>                 }
>                 if ((tx_ring->flags & I40E_TXR_FLAGS_OUTER_UDP_CSUM) &&
>                     (l4_tunnel == I40E_TXD_CTX_UDP_TUNNELING)        &&
> -                   (*cd_tunneling & I40E_TXD_CTX_QW0_EXT_IP_MASK)) {
> +                   (*cd_tunneling & I40E_TXD_CTX_QW0_EXT_IP_MASK)   &&
> +                   oudph && oiph) {
>                         oudph->check = ~csum_tcpudp_magic(oiph->saddr,
>                                         oiph->daddr,
>                                         (skb->len - skb_transport_offset(skb)),

If we can actually get here with oudph==NULL or oiph==NULL, we should back
my patch instead and fix it another way.

In the version we have in net-next, that is not possible.

	Arnd

  reply	other threads:[~2016-01-31 15:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25 23:58 [net 0/2][pull request] Intel Wired LAN Driver Updates 2016-01-25 Jeff Kirsher
2016-01-25 23:58 ` [net 1/2] i40e: fix build warnings Jeff Kirsher
2016-01-25 23:58 ` [net 2/2] net: i40e: shut up uninitialized variable warnings Jeff Kirsher
2016-01-30 15:33   ` [net,2/2] " Vasily Averin
2016-01-30 16:47     ` [Intel-wired-lan] [PATCH] net: i40e: prevent access to uninitilized variables in i40e_tx_enable_csum() Vasily Averin
2016-01-30 16:47       ` Vasily Averin
2016-01-31 15:00       ` Arnd Bergmann [this message]
2016-01-31 15:00         ` Arnd Bergmann
2016-01-31 14:59     ` [net,2/2] net: i40e: shut up uninitialized variable warnings Arnd Bergmann
2016-01-26  6:51 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2016-01-25 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=2765946.QCanWNG0gi@wuerfel \
    --to=arnd@arndb.de \
    --cc=intel-wired-lan@osuosl.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.