spmi: pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes
authorDavid Collins <collinsd@codeaurora.org>
Fri, 30 Sep 2022 00:50:17 +0000 (17:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2022 12:33:23 +0000 (14:33 +0200)
commitc8669773c74e26ceb2412215a2db40399e3fe119
treea3f52f7d001fa530e0814aaa706b0f9baa65f04f
parent1f1693118c2476cb1666ad357edcf3cf48bf9b16
spmi: pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes

The system crashes due to an access permission violation when
writing to a PMIC peripheral which is not owned by the current
ee.  Add a check for PMIC arbiter version 5 for such invalid
write requests and return an error instead of crashing the
system.

Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Link: https://lore.kernel.org/r/1655004286-11493-8-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20220930005019.2663064-9-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spmi/spmi-pmic-arb.c