Message ID | 20240307041411.3792061-2-zhanggenjian@126.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix the UAF issue caused by the loop driver | expand |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index d8821c9cb170..fced67ab1068 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1397,11 +1397,6 @@ loop_get_status(struct loop_device *lo, struct loop_info64 *info) info->lo_number = lo->lo_number; info->lo_offset = lo->lo_offset; info->lo_sizelimit = lo->lo_sizelimit; - - /* loff_t vars have been assigned __u64 */ - if (lo->lo_offset < 0 || lo->lo_sizelimit < 0) - return -EOVERFLOW; - info->lo_flags = lo->lo_flags; memcpy(info->lo_file_name, lo->lo_file_name, LO_NAME_SIZE); memcpy(info->lo_crypt_name, lo->lo_crypt_name, LO_NAME_SIZE);