OFS / linux-dfl-backport

Backport version of the linux-dfl (Device Feature List) kernel driver for FPGA devices. This is an out-of-tree driver, designed to be built, packaged, and installed as a stand-alone set of driver modules.
GNU General Public License v2.0
3 stars 11 forks source link

fpga: prevent integer overflow in dfl_feature_ioctl_set_irq() #62

Closed Muralix closed 2 years ago

Muralix commented 2 years ago

The "hdr.count * sizeof(s32)" multiplication can overflow on 32 bit systems leading to memory corruption. Use array_size() to fix that.

Fixes: 322b598be4d9 ("fpga: dfl: introduce interrupt trigger setting API") Signed-off-by: Dan Carpenter dan.carpenter@oracle.com Acked-by: Xu Yilun yilun.xu@intel.com Link: https://lore.kernel.org/r/YxBAtYCM38dM7yzI@kili Signed-off-by: Xu Yilun yilun.xu@intel.com (cherry picked from commit 939bc5453b8cbdde9f1e5110ce8309aedb1b501a)