len = bv->bv_len - *offset;
bv_buf = kmap_local_page(bv->bv_page) + bv->bv_offset + *offset;
+ /*
+ * Bio pages may originate from slab caches without a usercopy region
+ * (e.g. jbd2 frozen metadata buffers). This is the same data that
+ * the loop driver writes to its backing file — no exposure risk.
+ * The bvec length is always trusted, so the size check in
+ * check_copy_size() is not needed either. Use the unchecked
+ * helpers to avoid false positives on slab pages.
+ */
if (dir == ITER_DEST)
- copied = copy_to_iter(bv_buf, len, uiter);
+ copied = _copy_to_iter(bv_buf, len, uiter);
else
- copied = copy_from_iter(bv_buf, len, uiter);
+ copied = _copy_from_iter(bv_buf, len, uiter);
kunmap_local(bv_buf);