mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
octeontx2-af: Fix an off by one in rvu_dbg_qsize_write()
[ Upstream commit3a2eb515d1] This code does not allocate enough memory for the NUL terminator so it ends up putting it one character beyond the end of the buffer. Fixes:8756828a81("octeontx2-af: Add NPA aura and pool contexts to debugfs") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a8afe8bce4
commit
dae49384d0
@@ -332,7 +332,7 @@ static ssize_t rvu_dbg_qsize_write(struct file *filp,
|
||||
u16 pcifunc;
|
||||
int ret, lf;
|
||||
|
||||
cmd_buf = memdup_user(buffer, count);
|
||||
cmd_buf = memdup_user(buffer, count + 1);
|
||||
if (IS_ERR(cmd_buf))
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user