Skip to contentSkip to conversation

kernel/exit.c : Fix missing read_unlock

PATCH Maninder Singh 1 participant 1 message May 22, 2015

lore
Share & tools
lore
#0 lore raw

EP-F6AA0618C49C4AEDA73BFF1B39950BAB

Hi Oleg,

Quoted 26 lines
Quoted 8 lines

Hi,

From: Maninder Singh <[email protected]>

Subject: [PATCH 1/1] kernel/exit.c : Fix missing task_unlock

This patch adds missing read_unlock if do_wait_thread or ptrace_do_wait returns non zero.

Confused...

wait_consider_task() should drop tasklist_lock if it returns non-zero?

Quoted 12 lines
kernel/exit.c +3 -1
@@ -1486,12 +1486,16 @@ repeat:
 	tsk = current;
 	do {
 		retval = do_wait_thread(wo, tsk);
-		if (retval)
+		if (retval) {
+			read_unlock(&tasklist_lock);
 			goto end;
+		}
 
Quoted 9 lines

kernel/exit.c repeat: · line 1498

Quoted 6 lines
kernel/exit.c +3 -1
 		retval = ptrace_do_wait(wo, tsk);
-		if (retval)
+		if (retval) {
+			read_unlock(&tasklist_lock);
 			goto end;
+		}

Well, the patch is obviously wrong. Because, again, tasklist_lock was already unlocked if (say) wait_task_zombie() reaps a child.

Yes, agree, My wrong

Quoted 2 lines

If you think there is a case which forgets to unlock, please tell us more.

I have checked It is getting unlocked in wait_task_zombie Sorry for unnecessary disturbance.

Quoted 1 line

Oleg.

Thanks

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±þG«�éÿŠ{ayºʇڙë,j­¢f£¢·hš�ï�êÿ‘êçz_è®(­éšŽŠÝ¢j"�ú¶m§ÿÿ¾«þG«�éÿ¢¸?™¨è­Ú&£ø§~�á¶iO•æ¬z·švØ^¶m§ÿÿà ÿ¶ìÿ¢¸?–I¥