Commit a2d3153
ublk: use unchecked copy helpers for bio page data
Bio pages may originate from slab caches that lack a usercopy region
(e.g. jbd2 frozen metadata buffers allocated via jbd2_alloc()).
When CONFIG_HARDENED_USERCOPY is enabled, copy_to_iter() calls
check_copy_size() which rejects these slab pages, triggering a
kernel BUG in usercopy_abort().
This is a false positive: the data is ordinary block I/O content —
the same data the loop driver writes to its backing file via
vfs_iter_write(). The bvec length is always trusted, so the size
check in check_copy_size() is not needed either.
Switch to _copy_to_iter()/_copy_from_iter() which skip the
check_copy_size() wrapper while the underlying copy_to_user()
remains unchanged.
Acked-by: Caleb Sander Mateos <[email protected]>
Fixes: 2299cee ("ublk: use copy_{to,from}_iter() for user copy")
Signed-off-by: Ming Lei <[email protected]>1 parent 6a0b974 commit a2d3153
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
1322 | 1330 | | |
1323 | | - | |
| 1331 | + | |
1324 | 1332 | | |
1325 | | - | |
| 1333 | + | |
1326 | 1334 | | |
1327 | 1335 | | |
1328 | 1336 | | |
| |||
0 commit comments