]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ipa: terminate message handler arrays
authorAlex Elder <elder@linaro.org>
Fri, 12 Mar 2021 15:12:48 +0000 (09:12 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:19 +0000 (14:30 +0200)
commit4f8e661e91e9fd6318a376b5d9201783b5bae950
treeadef690226902acd92f8ce346e2ab6274e056ac8
parent0c60c808e466dadb93b9abb147b10b9330652947
net: ipa: terminate message handler arrays

[ Upstream commit 3a9ef3e11c5d33e5cb355b4aad1a4caad2407541 ]

When a QMI handle is initialized, an array of message handler
structures is provided, defining how any received message should
be handled based on its type and message ID.  The QMI core code
traverses this array when a message arrives and calls the function
associated with the (type, msg_id) found in the array.

The array is supposed to be terminated with an empty (all zero)
entry though.  Without it, an unsupported message will cause
the QMI core code to go past the end of the array.

Fix this bug, by properly terminating the message handler arrays
provided when QMI handles are set up by the IPA driver.

Fixes: 530f9216a9537 ("soc: qcom: ipa: AP/modem communications")
Reported-by: Sujit Kautkar <sujitka@chromium.org>
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ipa/ipa_qmi.c