Skip to content
Commit a280ef90 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski
Browse files

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: 0daa55d0

 ("octeontx2-af: cn10k: debugfs for dumping LMTST map table")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211117073454.GD5237@kili


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 48b71a9e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment