lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CBA48B605613B640864883107238931C0DA8F1@nice.asicdesigners.com>
Date:	Thu, 9 Jan 2014 05:48:30 +0000
From:	Dimitrios Michailidis <dm@...lsio.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>,
	Kumar A S <kumaras@...lsio.com>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [patch] cxgb4: silence shift wrapping static checker warning

> I don't know how large "tp->vlan_shift" is but static checkers worry
> about shift wrapping bugs here.

Indeed.

> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Acked-by: Dimitris Michailidis <dm@...lsio.com>

> diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
> b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
> index cb05be905def..81e8402a74b4 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
> @@ -423,7 +423,7 @@ u64 cxgb4_select_ntuple(struct net_device *dev,
>  	 * in the Compressed Filter Tuple.
>  	 */
>  	if (tp->vlan_shift >= 0 && l2t->vlan != VLAN_NONE)
> -		ntuple |= (F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift;
> +		ntuple |= (u64)(F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift;
> 
>  	if (tp->port_shift >= 0)
>  		ntuple |= (u64)l2t->lport << tp->port_shift;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ