aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/net_dropmonitor.py
diff options
context:
space:
mode:
authorEric Biggers <[email protected]>2018-09-07 12:16:24 -0700
committerMimi Zohar <[email protected]>2018-10-10 12:56:14 -0400
commit691115c3513ec83edf68ba6575ae85630bc94b8b (patch)
tree8e77e6e14650f10a67a314380362f9430254e151 /tools/perf/scripts/python/net_dropmonitor.py
parente6123c524064a571616ec978b1317f1696eff0ae (diff)
vfs: require i_size <= SIZE_MAX in kernel_read_file()
On 32-bit systems, the buffer allocated by kernel_read_file() is too small if the file size is > SIZE_MAX, due to truncation to size_t. Fortunately, since the 'count' argument to kernel_read() is also truncated to size_t, only the allocated space is filled; then, -EIO is returned since 'pos != i_size' after the read loop. But this is not obvious and seems incidental. We should be more explicit about this case. So, fail early if i_size > SIZE_MAX. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions