base-hw: check managing_system property for SMC

* When issuing a secure-monitor-call on behalf of a PD session client
  first check the permission via the 'managing_system' property.

Fix #4321
This commit is contained in:
Stefan Kalkowski 2021-11-24 16:22:08 +01:00 committed by Christian Helmuth
parent 14de84fae6
commit 7eb3da71b5

View File

@ -21,8 +21,14 @@ using State = Genode::Pd_session::Managing_system_state;
State Pd_session_component::managing_system(State const & s)
{
static constexpr addr_t SMCCC_NOT_SUPPORTED = 0xffffffffUL;
State ret;
ret.r[0] = Hw::Psci_smc_functor::call(s.r[0], s.r[1], s.r[2], s.r[3]);
ret.r[0] = (_managing_system == Managing_system::DENIED)
? SMCCC_NOT_SUPPORTED
: Hw::Psci_smc_functor::call(s.r[0], s.r[1], s.r[2], s.r[3]);
return ret;
}