aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/cppc_acpi.c
diff options
context:
space:
mode:
authorXinyu Zhang <[email protected]>2024-10-23 21:15:19 +0000
committerJens Axboe <[email protected]>2024-10-23 23:02:48 +0000
commit2ff949441802a8d076d9013c7761f63e8ae5a9bd (patch)
tree951cb6cae0706b37556dc03ff2785da718e77ab9 /drivers/acpi/cppc_acpi.c
parentMerge tag 'md-6.12-20241018' of https://git.kernel.org/pub/scm/linux/kernel/g... (diff)
downloadkernel-2ff949441802a8d076d9013c7761f63e8ae5a9bd.tar.gz
kernel-2ff949441802a8d076d9013c7761f63e8ae5a9bd.zip
block: fix sanity checks in blk_rq_map_user_bvec
blk_rq_map_user_bvec contains a check bytes + bv->bv_len > nr_iter which causes unnecessary failures in NVMe passthrough I/O, reproducible as follows: - register a 2 page, page-aligned buffer against a ring - use that buffer to do a 1 page io_uring NVMe passthrough read The second (i = 1) iteration of the loop in blk_rq_map_user_bvec will then have nr_iter == 1 page, bytes == 1 page, bv->bv_len == 1 page, so the check bytes + bv->bv_len > nr_iter will succeed, causing the I/O to fail. This failure is unnecessary, as when the check succeeds, it means we've checked the entire buffer that will be used by the request - i.e. blk_rq_map_user_bvec should complete successfully. Therefore, terminate the loop early and return successfully when the check bytes + bv->bv_len > nr_iter succeeds. While we're at it, also remove the check that all segments in the bvec are single-page. While this seems to be true for all users of the function, it doesn't appear to be required anywhere downstream. CC: [email protected] Signed-off-by: Xinyu Zhang <[email protected]> Co-developed-by: Uday Shankar <[email protected]> Signed-off-by: Uday Shankar <[email protected]> Fixes: 37987547932c ("block: extend functionality to map bvec iterator") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/acpi/cppc_acpi.c')
0 files changed, 0 insertions, 0 deletions