OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] 9p: Use kthread_stop instead of sending a SIGKILL.
[PATCH] 9p: Use kthread_stop instead of sending a SIGKILL. [message #16995] Tue, 12 December 2006 22:26 Go to next message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
Since the kthread api does not bump the reference count on
processes that tracked it is not safe allow user space to
kill the threads, as I still retain a pointer to the task_struct.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 fs/9p/mux.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/fs/9p/mux.c b/fs/9p/mux.c
index 944273c..bef02a8 100644
--- a/fs/9p/mux.c
+++ b/fs/9p/mux.c
@@ -254,7 +254,7 @@ static void v9fs_mux_poll_stop(struct v9fs_mux_data *m)
 	vpt->muxnum--;
 	if (!vpt->muxnum) {
 		dprintk(DEBUG_MUX, "destroy proc %p\n", vpt);
-		send_sig(SIGKILL, vpt->task, 1);
+		kthread_stop(vpt->task);
 		vpt->task = NULL;
 		v9fs_mux_poll_task_num--;
 	}
@@ -436,11 +436,8 @@ static int v9fs_poll_proc(void *a)
 
 	vpt = a;
 	dprintk(DEBUG_MUX, "start %p %p\n", current, vpt);
-	allow_signal(SIGKILL);
 	while (!kthread_should_stop()) {
 		set_current_state(TASK_INTERRUPTIBLE);
-		if (signal_pending(current))
-			break;
 
 		list_for_each_entry_safe(m, mtmp, &vpt->mux_list, mux_list) {
 			v9fs_poll_mux(m);
-- 
1.4.4.1.g278f

_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: [PATCH] 9p: Use kthread_stop instead of sending a SIGKILL. [message #17271 is a reply to message #16995] Thu, 18 January 2007 05:04 Go to previous message
Eric Van Hensbergen is currently offline  Eric Van Hensbergen
Messages: 3
Registered: January 2007
Junior Member
On 12/12/06, Eric W. Biederman <ebiederm@xmission.com> wrote:
>
> Since the kthread api does not bump the reference count on
> processes that tracked it is not safe allow user space to
> kill the threads, as I still retain a pointer to the task_struct.
>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

Finally unstacking to my patch queue.

Acked-by: Eric Van Hensbergren <ericvh@gmail.com>
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Previous Topic: Re: NFS causing oops when freeing namespace
Next Topic: [PATCH 2/2] Extract and use wake_up_klogd()
Goto Forum:
  


Current Time: Wed Sep 10 06:58:08 GMT 2025

Total time taken to generate the page: 0.07643 seconds