When block layer fails to map iov, it calls bio_unmap_user to undo mapping. Which is good if pages were mapped - but if they were provided by someone else and just copied then bad things happen - pages are released once here, and once by caller, leading to user triggerable BUG at include/linux/mm.h:246.

Signed-off-by: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by Petr Vandrovec and committed by Jens Axboe 53cc0b29 f6f7b52e

+1 -1
+1 -1
block/blk-map.c
··· 224 224 */ 225 225 bio_get(bio); 226 226 bio_endio(bio, 0); 227 - bio_unmap_user(bio); 227 + __blk_rq_unmap_user(bio); 228 228 return -EINVAL; 229 229 } 230 230