|
@@ -72,8 +72,12 @@ int ksys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
- /* Careful about overflows. Len == 0 means "as much as possible" */
|
|
|
|
- endbyte = offset + len;
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Careful about overflows. Len == 0 means "as much as possible". Use
|
|
|
|
+ * unsigned math because signed overflows are undefined and UBSan
|
|
|
|
+ * complains.
|
|
|
|
+ */
|
|
|
|
+ endbyte = (u64)offset + (u64)len;
|
|
if (!len || endbyte < len)
|
|
if (!len || endbyte < len)
|
|
endbyte = -1;
|
|
endbyte = -1;
|
|
else
|
|
else
|