diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-07-20 21:28:18 +0300 |
---|---|---|
committer | Jon Mason <jdmason@kudzu.us> | 2022-08-09 11:54:41 -0400 |
commit | 45e1058b77feade4e36402828bfe3e0d3363177b (patch) | |
tree | 40208c34f31e95d8b8c0d2a9b68e1f84328a2c87 /drivers/ntb/hw | |
parent | a44252d5c3bbd76efa7b65819712f0e2b1de54c0 (diff) |
NTB: ntb_tool: uninitialized heap data in tool_fn_write()
The call to:
ret = simple_write_to_buffer(buf, size, offp, ubuf, size);
will return success if it is able to write even one byte to "buf".
The value of "*offp" controls which byte. This could result in
reading uninitialized data when we do the sscanf() on the next line.
This code is not really desigined to handle partial writes where
*offp is non-zero and the "buf" is preserved and re-used between writes.
Just ban partial writes and replace the simple_write_to_buffer() with
copy_from_user().
Fixes: 578b881ba9c4 ("NTB: Add tool test client")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb/hw')
0 files changed, 0 insertions, 0 deletions