* [Intel-wired-lan] [PATCH] net: i40e: prevent access to uninitilized variables in i40e_tx_enable_csum() [not found] <56ACD7C6.1010808@virtuozzo.com> @ 2016-01-30 16:47 ` Vasily Averin 2016-01-31 15:00 ` Arnd Bergmann 0 siblings, 1 reply; 2+ messages in thread From: Vasily Averin @ 2016-01-30 16:47 UTC (permalink / raw) To: intel-wired-lan 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)), -- 1.9.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Intel-wired-lan] [PATCH] net: i40e: prevent access to uninitilized variables in i40e_tx_enable_csum() 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-31 15:00 ` Arnd Bergmann 0 siblings, 0 replies; 2+ messages in thread From: Arnd Bergmann @ 2016-01-31 15:00 UTC (permalink / raw) To: intel-wired-lan 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-31 15:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <56ACD7C6.1010808@virtuozzo.com>
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-31 15:00 ` Arnd Bergmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox