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:
Bahadir Balban
2008-02-11 11:11:17 +00:00
parent 0c7d2bbfd1
commit e0492d672f
5 changed files with 19 additions and 18 deletions

View File

@@ -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);
}