]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: verify command channel TLV count
authorAlex Elder <elder@linaro.org>
Fri, 10 Jun 2022 15:46:10 +0000 (10:46 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Jun 2022 11:01:58 +0000 (12:01 +0100)
commit97135eb24013b0ec50e7fc27719aad22ab2da8b5
treee0c3f4a4ba3013fd541581f39cb6c6f03d0cb50e
parentb03c3e42a7ccc4726786b7a879373cb77edc7a0a
net: ipa: verify command channel TLV count

In commit 1115a04dca4dc ("net: ipa: remove command info pool"), the
maximum number of IPA commands that would be sent in a single
transaction was defined.  That number can't exceed the size of the
TLV FIFO on the command channel, and we can check that at runtime.

To add this check, pass a new flag to gsi_channel_data_valid() to
indicate the channel being checked is being used for IPA commands.
Knowing that we can also verify the channel direction is correct.

Use a new local variable that refers to the command-specific portion
of the data being checked.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/gsi.c