diff options
| author | Dan Carpenter <[email protected]> | 2019-05-07 08:36:34 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2019-05-24 18:40:10 +0000 |
| commit | 110080cea0d0e4dfdb0b536e7f8a5633ead6a781 (patch) | |
| tree | 175c7135a67aeec7d97deae544bb373b8887ad04 /tools/perf/scripts/python/sctop.py | |
| parent | parport: Fix mem leak in parport_register_dev_model (diff) | |
| download | kernel-110080cea0d0e4dfdb0b536e7f8a5633ead6a781.tar.gz kernel-110080cea0d0e4dfdb0b536e7f8a5633ead6a781.zip | |
genwqe: Prevent an integer overflow in the ioctl
There are a couple potential integer overflows here.
round_up(m->size + (m->addr & ~PAGE_MASK), PAGE_SIZE);
The first thing is that the "m->size + (...)" addition could overflow,
and the second is that round_up() overflows to zero if the result is
within PAGE_SIZE of the type max.
In this code, the "m->size" variable is an u64 but we're saving the
result in "map_size" which is an unsigned long and genwqe_user_vmap()
takes an unsigned long as well. So I have used ULONG_MAX as the upper
bound. From a practical perspective unsigned long is fine/better than
trying to change all the types to u64.
Fixes: eaf4722d4645 ("GenWQE Character device and DDCB queue")
Signed-off-by: Dan Carpenter <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions
