diff options
author | Krzysztof Kozlowski <[email protected]> | 2023-02-22 15:44:12 +0100 |
---|---|---|
committer | Vinod Koul <[email protected]> | 2023-04-12 15:30:35 +0530 |
commit | 2367e0ecb498764e95cfda691ff0828f7d25f9a4 (patch) | |
tree | 57e3c0fa3120a5763c10300deb5575375cdbf65e /lib/mpi/mpiutil.c | |
parent | 208a03ee9db815f28059d3399ee31577aeba0dd7 (diff) |
soundwire: qcom: gracefully handle too many ports in DT
There are two issues related to the number of ports coming from
Devicetree when exceeding in total QCOM_SDW_MAX_PORTS. Both lead to
incorrect memory accesses:
1. With DTS having too big value of input or output ports, the driver,
when copying port parameters from local/stack arrays into 'pconfig'
array in 'struct qcom_swrm_ctrl', will iterate over their sizes.
2. If DTS also has too many parameters for these ports (e.g.
qcom,ports-sinterval-low), the driver will overflow buffers on the
stack when reading these properties from DTS.
Add a sanity check so incorrect DTS will not cause kernel memory
corruption.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Srinivas Kandagatla <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions