linux/drivers/net/ethernet/broadcom/bnxt
Yamin Friedman f06d0ca458 linux/dim: Fix overflow in dim calculation
While using net_dim, a dim_sample was used without ever initializing the
comps value. Added use of DIV_ROUND_DOWN_ULL() to prevent potential
overflow, it should not be a problem to save the final result in an int
because after the division by epms the value should not be larger than a
few thousand.

[ 1040.127124] UBSAN: Undefined behaviour in lib/dim/dim.c:78:23
[ 1040.130118] signed integer overflow:
[ 1040.131643] 134718714 * 100 cannot be represented in type 'int'

Fixes: 398c2b05bb ("linux/dim: Add completions count to dim_sample")
Signed-off-by: Yamin Friedman <yaminf@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-25 11:34:39 -07:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
bnxt.c linux/dim: Fix overflow in dim calculation 2019-07-25 11:34:39 -07:00
bnxt.h bnxt_en: add page_pool support 2019-07-08 15:15:25 -07:00
bnxt_coredump.h
bnxt_dcb.c bnxt_en: Suppress error messages when querying DSCP DCB capabilities. 2019-06-30 16:00:26 -07:00
bnxt_dcb.h
bnxt_debugfs.c linux/dim: Move implementation to .c files 2019-06-25 13:46:39 -07:00
bnxt_debugfs.h
bnxt_devlink.c bnxt: pass switch ID through devlink_port_attrs_set() 2019-04-04 17:42:36 -07:00
bnxt_devlink.h Revert "devlink: Add a generic wake_on_lan port parameter" 2019-02-12 12:13:22 -05:00
bnxt_dim.c linux/dim: Move implementation to .c files 2019-06-25 13:46:39 -07:00
bnxt_ethtool.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-07-08 19:48:57 -07:00
bnxt_ethtool.h
bnxt_fw_hdr.h
bnxt_hsi.h bnxt_en: Update firmware interface to 1.10.0.69. 2019-05-05 21:42:16 -07:00
bnxt_nvm_defs.h
bnxt_sriov.c bnxt_en: Propagate trusted VF attribute to firmware. 2019-02-19 10:45:14 -08:00
bnxt_sriov.h
bnxt_tc.c net: flow_offload: rename tc_cls_flower_offload to flow_cls_offload 2019-07-09 14:38:51 -07:00
bnxt_tc.h net: flow_offload: rename tc_cls_flower_offload to flow_cls_offload 2019-07-09 14:38:51 -07:00
bnxt_ulp.c bnxt_en: Cap the returned MSIX vectors to the RDMA driver. 2019-06-30 16:00:26 -07:00
bnxt_ulp.h
bnxt_vfr.c drivers: net: use flow block API 2019-07-09 14:38:50 -07:00
bnxt_vfr.h
bnxt_xdp.c bnxt_en: add page_pool support 2019-07-08 15:15:25 -07:00
bnxt_xdp.h bnxt_en: optimized XDP_REDIRECT support 2019-07-08 15:15:24 -07:00