diff options
author | Nilay Shroff <[email protected]> | 2024-11-24 18:25:53 +0530 |
---|---|---|
committer | Keith Busch <[email protected]> | 2024-12-02 10:02:47 -0800 |
commit | 84909f7decbd8981a24be829f110c248ecb8c51a (patch) | |
tree | 50b81ce7c83c18d3282150ad65ea2990ab03a3b5 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | ec9b3ac6e5630e320d926ea13a06d86d2a6bdde1 (diff) |
nvmet: use kzalloc instead of ZERO_PAGE in nvme_execute_identify_ns_nvm()
The nvme_execute_identify_ns_nvm function uses ZERO_PAGE for copying
SG list with all zeros. As ZERO_PAGE would not necessarily return the
virtual-address of the zero page, we need to first convert the page
address to kernel virtual-address and then use it as source address
for copying the data to SG list with all zeros. Using return address
of ZERO_PAGE(0) as source address for copying data to SG list would
fill the target buffer with random/garbage value and causes the
undesired side effect.
As other identify implemenations uses kzalloc for allocating a zero
filled buffer, we decided use kzalloc for allocating a zero filled
buffer in nvme_execute_identify_ns_nvm function and then use this
buffer for copying all zeros to SG list buffers. So esentially, we
now avoid using ZERO_PAGE.
Reported-by: Yi Zhang <[email protected]>
Fixes: 64a51080eaba ("nvmet: implement id ns for nvm command set")
Link: https://lore.kernel.org/all/CAHj4cs8OVyxmn4XTvA=y4uQ3qWpdw-x3M3FSUYr-KpE-nhaFEA@mail.gmail.com/
Signed-off-by: Nilay Shroff <[email protected]>
Tested-by: Yi Zhang <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions