diff options
| author | Xu Yang <xu.yang_2@nxp.com> | 2024-12-02 11:34:53 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-04 18:11:58 +0300 |
| commit | 990c2a26f703f6558042d97e7abdeb3360bb6a63 (patch) | |
| tree | 1411b98b37e9061dc46f662b083f6e819454e2ed /include/linux | |
| parent | 04d5b4c23f3b7cbf44a71a338dae0c7aabd86c29 (diff) | |
| download | linux-990c2a26f703f6558042d97e7abdeb3360bb6a63.tar.xz | |
usb: chipidea: host: Improve port index sanitizing
Coverity from Synopsys complains "Illegal address computation (OVERRUN)"
on status_reg.
After below code executed,
port_index = wIndex & 0xff;
port_index -= (port_index > 0);
the static analysis tool see the value of port_index is now between 0 and
254 (inclusive).
However, ehci_def.h define port_status as below:
#define HCS_N_PORTS_MAX 15
u32 port_status[HCS_N_PORTS_MAX];
So the tool think illegal array pointer may be obtained.
status_reg = &ehci->regs->port_status[port_index];
This will follow "846cbf98cbef USB: EHCI: Improve port index sanitizing" to
improve port index sanitizing.
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20241202083453.704533-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
