OpenCloudOS-Kernel/drivers/ntb/test
Dan Carpenter 45e1058b77 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: 578b881ba9 ("NTB: Add tool test client")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
2022-08-09 11:54:41 -04:00
..
Kconfig New feature to add support for NTB virtual MSI interrupts, the ability 2019-07-21 09:46:59 -07:00
Makefile New feature to add support for NTB virtual MSI interrupts, the ability 2019-07-21 09:46:59 -07:00
ntb_msi_test.c NTB: Fix an error code in ntb_msit_probe() 2021-09-04 18:36:04 -04:00
ntb_perf.c NTB: perf: Fix an error code in perf_setup_inbuf() 2021-09-04 18:36:04 -04:00
ntb_pingpong.c ntb: ntb_pingpong: remove redundant initialization of variables msg_data and spad_data 2021-09-05 18:04:46 -04:00
ntb_tool.c NTB: ntb_tool: uninitialized heap data in tool_fn_write() 2022-08-09 11:54:41 -04:00