summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-11-17 10:34:54 +0300
committerJakub Kicinski <kuba@kernel.org>2021-11-17 20:25:40 -0800
commita280ef90af01dc133d0a52387e563015686d6294 (patch)
tree2f77ada52e80adab6f8963e2e7b21bcad45bde94 /drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
parent48b71a9e66c2eab60564b1b1c85f4928ed04e406 (diff)
octeontx2-af: debugfs: don't corrupt user memory
The user supplies the "count" value to say how big its read buffer is. The rvu_dbg_lmtst_map_table_display() function does not take the "count" into account but instead just copies the whole table, potentially corrupting the user's data. Introduce the "ret" variable to store how many bytes we can copy. Also I changed the type of "off" to size_t to make using min() simpler. Fixes: 0daa55d033b0 ("octeontx2-af: cn10k: debugfs for dumping LMTST map table") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20211117073454.GD5237@kili Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c')
0 files changed, 0 insertions, 0 deletions