Commits
Kishon Vijay Abraham I committed 11a275d4011
PCI: endpoint: pci-epf-ntb: Fix possible Out of Bound Array Access struct epf_ntb_ctrl has db_data structure member which is an array of length 32. epf_ntb_configure_db() can be passed a db_count value which is more than 32 that can cause an Out of Bound Array Access. This was reported by Klokworks Array 'peer_ctrl->db_data' of size 32 may use index value(s) 0..USHRT_MAX-1 * pci-epf-ntb.c:213: 'db_count' is passed as argument '$3' to function 'epf_ntb_configure_db'. * pci-epf-ntb.c:213: Index value(s) 0..USHRT_MAX-1 may be used to access array of size 32 while calling 'epf_ntb_configure_db'. * pci-epf-ntb.c:213: Result of expression '$3+(-1)' is [0,65534]. * pci-epf-ntb.c:213: Function argument '$3' is [1,65535]. * pci-epf-ntb.c:213: Value(s) [0,65534] is used as violation index in function 'epf_ntb_configure_db'. * pci-epf-ntb.c:180: Array 'peer_ctrl->db_data' of size 32 is used. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>