diff options
author | Markus Mayer <mmayer@broadcom.com> | 2020-08-22 13:50:00 -0700 |
---|---|---|
committer | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-22 22:53:28 +0200 |
commit | f42ae4bbf94c15aa720afb9d176ecbfe140d792e (patch) | |
tree | 2c56fcfe66fbd954c81a5b6371eb149c6b7a5c2a /drivers/misc/ibmasm/dot_command.c | |
parent | 4da1edcf8f226d53c02c6b0e3077d581115b30d0 (diff) |
memory: brcmstb_dpfe: fix array index out of bounds
We would overrun the error_text array if we hit a TIMEOUT condition,
because we were using the error code "ETIMEDOUT" (which is 110) as an
array index.
We fix the problem by correcting the array index and by providing a
function to retrieve error messages rather than accessing the array
directly. The function includes a bounds check that prevents the array
from being overrun.
Link: https://lore.kernel.org/linux-arm-kernel/38d00022-730c-948a-917c-d86382df8cb9@canonical.com/
Link: https://lore.kernel.org/r/20200822205000.15841-1-mmayer@broadcom.com
Fixes: 2f330caff577 ("memory: brcmstb: Add driver for DPFE")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Diffstat (limited to 'drivers/misc/ibmasm/dot_command.c')
0 files changed, 0 insertions, 0 deletions