bna: integer overflow bug in debugfs
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 17 Mar 2017 20:52:35 +0000 (23:52 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2017 00:43:16 +0000 (17:43 -0700)
commit13e2d5187f6b965ba3556caedb914baf81b98ed2
treee528165645f358efee4d19771e76ac35e1e607d1
parent6bd845d1cf98b45c634baacb8381436dad3c2dd0
bna: integer overflow bug in debugfs

We could allocate less memory than intended because we do:

bnad->regdata = kzalloc(len << 2, GFP_KERNEL);

The shift can overflow leading to a crash.  This is debugfs code so the
impact is very small.

Fixes: 7afc5dbde091 ("bna: Add debugfs interface.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/brocade/bna/bnad_debugfs.c