]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: gmac5+: fix potential integer overflow on 32 bit multiply
authorColin Ian King <colin.king@canonical.com>
Fri, 1 May 2020 14:10:16 +0000 (15:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 May 2020 18:57:21 +0000 (11:57 -0700)
commit9375b9ec285c330a680f5a6b782169c750790b1e
tree2bd48e1c658e69d2db09d0b4d20ddbfc85257544
parentf82cf94da6c54947d95b2e4ad25f40b5f6888f2b
net: stmmac: gmac5+: fix potential integer overflow on 32 bit multiply

The multiplication of cfg->ctr[1] by 1000000000 is performed using a
32 bit multiplication (since cfg->ctr[1] is a u32) and this can lead
to a potential overflow. Fix this by making the constant a ULL to
ensure a 64 bit multiply occurs.

Fixes: 466e1ef518a9 ("net: stmmac: Add basic EST support for GMAC5+")
Addresses-Coverity: ("Unintentional integer overflow")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac5.c