aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorGiovanni Cabiddu <[email protected]>2024-10-21 13:37:53 +0100
committerAlex Williamson <[email protected]>2024-10-30 13:38:38 -0600
commit9283b7392570421c22a6c8058614f5b76a46b81c (patch)
tree75d64d490c3784cc0e97a5880f440725cfda7c18 /tools/perf/scripts/python/stackcollapse.py
parent12cd88a9116acf79416a39adcd8bb1337ae7cee1 (diff)
vfio/qat: fix overflow check in qat_vf_resume_write()
The unsigned variable `size_t len` is cast to the signed type `loff_t` when passed to the function check_add_overflow(). This function considers the type of the destination, which is of type loff_t (signed), potentially leading to an overflow. This issue is similar to the one described in the link below. Remove the cast. Note that even if check_add_overflow() is bypassed, by setting `len` to a value that is greater than LONG_MAX (which is considered as a negative value after the cast), the function copy_from_user(), invoked a few lines later, will not perform any copy and return `len` as (len > INT_MAX) causing qat_vf_resume_write() to fail with -EFAULT. Fixes: bb208810b1ab ("vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices") CC: [email protected] # 6.10+ Link: https://lore.kernel.org/all/[email protected] Reported-by: Zijie Zhao <[email protected]> Signed-off-by: Giovanni Cabiddu <[email protected]> Reviewed-by: Xin Zeng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions