From 50d6d2e9222917aaa35a0a6e922b6107542cd90a Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 13 Apr 2015 23:00:34 +0200 Subject: [PATCH] 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 --- repos/base-okl4/src/base/ipc/ipc.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repos/base-okl4/src/base/ipc/ipc.cc b/repos/base-okl4/src/base/ipc/ipc.cc index dbcbffec1..100253d88 100644 --- a/repos/base-okl4/src/base/ipc/ipc.cc +++ b/repos/base-okl4/src/base/ipc/ipc.cc @@ -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);