]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: tcmu: Allocate zeroed pages for data area
authorBodo Stroesser <bostroesser@gmail.com>
Wed, 13 Oct 2021 17:16:06 +0000 (19:16 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 19 Oct 2021 02:38:35 +0000 (22:38 -0400)
commit3c07307d1091b8b30a8f0bd9e2cda30d3129689c
treec91cb46bd1cc51c2a1af64732e2e230bba800993
parent0ecce49db874233f326f51bca1c269536f793d3e
scsi: target: tcmu: Allocate zeroed pages for data area

Tcmu populates the data area (used for communication with userspace) with
pages that are allocated by calling alloc_page(GFP_NOIO).  Therefore
previous content of the allocated pages is exposed to user space. Avoid
this by adding __GFP_ZERO flag.

Zeroing the pages does (nearly) not affect tcmu throughput, because
allocated pages are re-used for the data transfers of later SCSI cmds.

Link: https://lore.kernel.org/r/20211013171606.25197-1-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_user.c