mirror of
https://github.com/drasko/codezero.git
synced 2026-01-16 04:43:16 +01:00
Kernel inspects and sets sender id instead of userspace.
Modified ipc handling so that from now on the kernel inspects and sets the sender id if the receiver is receiving from L4_ANYTHREAD. This posed a security problem since the receiver could not trust the sender for sender information.
This commit is contained in:
@@ -37,11 +37,6 @@ static inline l4id_t l4_get_sender(void)
|
||||
return (l4id_t)read_mr(MR_SENDER);
|
||||
}
|
||||
|
||||
static inline void l4_set_sender(l4id_t id)
|
||||
{
|
||||
write_mr(MR_SENDER, (unsigned int)id);
|
||||
}
|
||||
|
||||
static inline unsigned int l4_get_tag(void)
|
||||
{
|
||||
return read_mr(MR_TAG);
|
||||
@@ -63,7 +58,6 @@ static inline l4id_t self_tid(void)
|
||||
static inline int l4_send(l4id_t to, unsigned int tag)
|
||||
{
|
||||
l4_set_tag(tag);
|
||||
l4_set_sender(self_tid());
|
||||
|
||||
return l4_ipc(to, L4_NILTHREAD);
|
||||
}
|
||||
@@ -72,7 +66,7 @@ static inline int l4_sendrecv(l4id_t to, l4id_t from, unsigned int tag)
|
||||
{
|
||||
BUG_ON(to == L4_NILTHREAD || from == L4_NILTHREAD);
|
||||
l4_set_tag(tag);
|
||||
l4_set_sender(self_tid());
|
||||
|
||||
return l4_ipc(to, from);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user