kernel: msg: async messages no longer hold a pointer to the thread/port that sent them
this prevents a race condition where an event is sent as a port is being destroyed. when the server gets around to handling the event, it now refers to a different port that was created in the mean-time.
This commit is contained in:
+4
-4
@@ -83,8 +83,8 @@ kern_status_t port_connect(struct port *port, struct channel *remote)
|
||||
msg->msg_status = KMSG_ASYNC;
|
||||
msg->msg_type = KERN_MSG_TYPE_EVENT;
|
||||
msg->msg_event = KERN_MSG_EVENT_CONNECTION;
|
||||
msg->msg_sender_thread = current_thread();
|
||||
msg->msg_sender_port = port;
|
||||
msg->msg_sender_thread_id = current_thread()->tr_id;
|
||||
msg->msg_sender_port_id = port->p_base.ob_id;
|
||||
|
||||
unsigned long flags;
|
||||
channel_lock_irqsave(remote, &flags);
|
||||
@@ -112,8 +112,8 @@ kern_status_t port_disconnect(struct port *port)
|
||||
msg->msg_status = KMSG_ASYNC;
|
||||
msg->msg_type = KERN_MSG_TYPE_EVENT;
|
||||
msg->msg_event = KERN_MSG_EVENT_DISCONNECTION;
|
||||
msg->msg_sender_thread = current_thread();
|
||||
msg->msg_sender_port = port;
|
||||
msg->msg_sender_thread_id = current_thread()->tr_id;
|
||||
msg->msg_sender_port_id = port->p_base.ob_id;
|
||||
|
||||
unsigned long flags;
|
||||
channel_lock_irqsave(port->p_remote, &flags);
|
||||
|
||||
Reference in New Issue
Block a user