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)
commit92f78f81ac4d0fa9b44cf394893adf25d2a8131f
treee0c3f4a4ba3013fd541581f39cb6c6f03d0cb50e
parent27f2533bcc6e909b85d3c1b738fa1f203ed8a835
net: ipa: verify command channel TLV count

In commit 8797972afff3d ("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