Commit c5ccd028 authored by David S. Miller's avatar David S. Miller

net/ipv4/route.c: Handle large offsets properly in procfs read operation.

parent 2a1b4473
......@@ -2429,6 +2429,11 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
if ((offset & 3) || (length & 3))
return -EIO;
if (offset >= sizeof(struct ip_rt_acct) * 256) {
*eof = 1;
return 0;
}
if (offset + length >= sizeof(struct ip_rt_acct) * 256) {
length = sizeof(struct ip_rt_acct) * 256 - offset;
*eof = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment