okl4: fix return value if IPC failed

Otherwise RPC calls to dead/invalid destinations are rated as successful,
which leads to wrong execution paths later on. Triggered by bomb.run where
rm_session.attach() returned as successful with local address set to 0, which
causes un-handled page-faults later on.

Fixes #1480
This commit is contained in:
Alexander Boettcher 2015-04-13 23:00:34 +02:00 committed by Christian Helmuth
parent eee0bf5ab2
commit 50d6d2e922
1 changed files with 4 additions and 1 deletions

View File

@ -193,8 +193,11 @@ void Ipc_client::_call()
((L4_ErrorCode() & ERROR_MASK) == ERROR_CANCELED))
throw Genode::Blocking_canceled();
if (L4_IpcFailed(rcv_tag))
if (L4_IpcFailed(rcv_tag)) {
kdb_emergency_print("Ipc failed\n");
/* set return value for ipc_generic part if call failed */
ret(ERR_INVALID_OBJECT);
}
/* copy request message from the UTCBs message registers */
copy_utcb_to_msgbuf(rcv_tag, _rcv_msg);