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] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB027DE02@AcuExch.aculab.com>
Date:   Tue, 7 Feb 2017 14:33:57 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Jiri Pirko' <jiri@...nulli.us>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "idosch@...lanox.com" <idosch@...lanox.com>,
        "eladr@...lanox.com" <eladr@...lanox.com>,
        "mlxsw@...lanox.com" <mlxsw@...lanox.com>
Subject: RE: [patch net-next] spectrum: acl_tcam: Fix catchall prio value

From: Jiri Pirko
> Sent: 07 February 2017 14:27
> From: Jiri Pirko <jiri@...lanox.com>
> 
> This fixes an issue reported by smatch:
> mlxsw_sp_acl_tcam_chunk_create() warn: impossible condition '(priority == (-1)) => (0-u32max ==
> u64max)'
...
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
> b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
> index a0a968e..1ec3dd0 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
> @@ -561,7 +561,7 @@ mlxsw_sp_acl_tcam_region_entry_remove(struct mlxsw_sp *mlxsw_sp,
>  	mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
>  }
> 
> -#define MLXSW_SP_ACL_TCAM_CATCHALL_PRIO (-1UL)
> +#define MLXSW_SP_ACL_TCAM_CATCHALL_PRIO (-1U)

Either (-1) or (~0u) is probably better.

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ