Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8275288f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "loop: Check for overflow while configuring loop" into kernel.lnx.4.19.r32-rel

parents 407736d1 c11d42df
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1410,6 +1410,11 @@ 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);