]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
net: ipa: fix ipa_cmd_table_valid()
authorAlex Elder <elder@linaro.org>
Mon, 26 Jul 2021 17:40:07 +0000 (12:40 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 09:19:05 +0000 (10:19 +0100)
commit1778a59f8abcef147a55e708483ed1c15478497e
tree7ee33d13735aa6f44e42bb26b042de52c59258ef
parentc68b72c2cf8f3ae0e061a534639a4141d0d2a318
net: ipa: fix ipa_cmd_table_valid()

BugLink: https://bugs.launchpad.net/bugs/1947781
[ Upstream commit f2c1dac0abcfa93e8b20065b8d6b4b2b6f9990aa ]

Stop supporting different sizes for hashed and non-hashed filter or
route tables.  Add BUILD_BUG_ON() calls to verify the sizes of the
fields in the filter/route table initialization immediate command
are the same.

Add a check to ipa_cmd_table_valid() to ensure the size of the
memory region being checked fits within the immediate command field
that must hold it.

Remove two Boolean parameters used only for error reporting.  This
actually fixes a bug that would only show up if IPA_VALIDATE were
defined.  Define ipa_cmd_table_valid() unconditionally (no longer
dependent on IPA_VALIDATE).

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/ipa/ipa_cmd.c
drivers/net/ipa/ipa_cmd.h
drivers/net/ipa/ipa_table.c