Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c0463a9 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Eric Van Hensbergen
Browse files

9p: Use kthread_stop instead of sending a SIGKILL.



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: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 8a03d9a4
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -256,7 +256,7 @@ static void v9fs_mux_poll_stop(struct v9fs_mux_data *m)
	vpt->muxnum--;
	vpt->muxnum--;
	if (!vpt->muxnum) {
	if (!vpt->muxnum) {
		dprintk(DEBUG_MUX, "destroy proc %p\n", vpt);
		dprintk(DEBUG_MUX, "destroy proc %p\n", vpt);
		send_sig(SIGKILL, vpt->task, 1);
		kthread_stop(vpt->task);
		vpt->task = NULL;
		vpt->task = NULL;
		v9fs_mux_poll_task_num--;
		v9fs_mux_poll_task_num--;
	}
	}
@@ -438,11 +438,8 @@ static int v9fs_poll_proc(void *a)


	vpt = a;
	vpt = a;
	dprintk(DEBUG_MUX, "start %p %p\n", current, vpt);
	dprintk(DEBUG_MUX, "start %p %p\n", current, vpt);
	allow_signal(SIGKILL);
	while (!kthread_should_stop()) {
	while (!kthread_should_stop()) {
		set_current_state(TASK_INTERRUPTIBLE);
		set_current_state(TASK_INTERRUPTIBLE);
		if (signal_pending(current))
			break;


		list_for_each_entry_safe(m, mtmp, &vpt->mux_list, mux_list) {
		list_for_each_entry_safe(m, mtmp, &vpt->mux_list, mux_list) {
			v9fs_poll_mux(m);
			v9fs_poll_mux(m);