Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754904AbbEULo0 (ORCPT ); Thu, 21 May 2015 07:44:26 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:25499 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752331AbbEULoY (ORCPT ); Thu, 21 May 2015 07:44:24 -0400 X-AuditID: cbfee68f-f793b6d000005f66-ec-555dc50ed1c4 Date: Thu, 21 May 2015 11:44:14 +0000 (GMT) From: Maninder Singh Subject: Re: [EDT][PATCH] kernel/exit.c : Fix missing read_unlock To: Ingo Molnar Cc: "akpm@linux-foundation.org" , "oleg@redhat.com" , "mhocko@suse.cz" , "peterz@infradead.org" , "riel@redhat.com" , "ionut.m.alexa@gmail.com" , "peter@hurleysoftware.com" , "linux-kernel@vger.kernel.org" , Vaneet Narang , AKHILESH KUMAR , Peter Zijlstra Reply-to: maninder1.s@samsung.com MIME-version: 1.0 X-MTR: 20150521113107540@maninder1.s Msgkey: 20150521113107540@maninder1.s X-EPLocale: en_US.windows-1252 X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-MLAttribute: X-RootMTR: 20150521113107540@maninder1.s X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N X-ConfirmMail: N,general Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 Message-id: <271480435.535731432208649976.JavaMail.weblogic@ep2mlwas07b> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCIsWRmVeSWpSXmKPExsWyRsSkWpfvaGyoQdN6QYvLu+awOTB6fN4k F8AYxWWTkpqTWZZapG+XwJUxf8oexoIH0hUbj7A2MDZIdzFycggJqEks2vuYDcSWEDCR2Dpn KiOELSZx4d56oDgXUM1SRolts+6wwBT9+LODGSIxh1Hi/6a3YB0sAqoSLV9OsIPYbAL6Emf3 rgMq4uAQFnCUuHpOAyQsIqAicejGKhaQXmaBK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D9rAyPM0Yu/P4aK80scu70DqldAYuqZg4wgd0oIaErcb5CCCPNJrFn4lgWmfNep 5cwwq+5vmQvVKiGxteUJK4jNDHT+lO6H7BC2gcSRRXNY0b3CK+Ah0fzrMuMERtlZSFKzkLTP QtKOrGYBI8sqRtHUguSC4qT0CiO94sTc4tK8dL3k/NxNjOAk9GzRDsZ/560PMQpwMCrx8HKo x4YKsSaWFVfmHmKU4GBWEuH12wcU4k1JrKxKLcqPLyrNSS0+xGgKjLSJzFKiyfnABJlXEm9o bGJuamxqYWBobm6mJM77/1xuiJBAemJJanZqakFqEUwfEwenVANj1uYZT17ohD+Ve7HZ98i5 0heHt3d//fhi3f+waxuS+y4aqb8oZF99roHxsqCuYnBZxeLYw+s7N75nqHjRefy8Rs5vEUmX iXfWt31e4rNix1ED8XWn7u+NFasw/dx2SFTG2C72X6Qau5zV8jzWpGil5i32u5i2ikzp5tRb rnLm1Nad3MfrV3VcUmIpzkg01GIuKk4EAO+k5/xYAwAA DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t4LBiWhB018700 Content-Length: 2666 Lines: 86 EP-F6AA0618C49C4AEDA73BFF1B39950BAB Hi Ingo, >> >> Hi, >> >> >> >> From: Maninder Singh >> >> >> >> Subject: [PATCH 1/1] kernel/exit.c : Fix missing task_unlock >> >> >> Subject: [PATCH 1/1] kernel/exit.c : Fix missing read_unlock >> >> >> This patch adds missing read_unlock if do_wait_thread or ptrace_do_wait >> >> returns non zero. >> >> Reported By Prevent Under Missing unlock category(program hangs):- >> missing_unlock: returning without unlocking tasklist_lock >> >> >> >> Signed-off-by: Maninder Singh >> >> Signed-off-by: Vaneet Narang >> >> Reviewd-by: Akhilesh Kumar >> >> --- >> >> kernel/exit.c | 8 ++++++-- >> >> 1 files changed, 6 insertions(+), 2 deletions(-) >> >> >> >> diff --git a/kernel/exit.c b/kernel/exit.c >> >> index 22fcc05..31a061f 100644 >> >> --- a/kernel/exit.c >> >> +++ b/kernel/exit.c >> >> @@ -1486,12 +1486,16 @@ repeat: >> >> tsk = current; >> >> do { >> >> retval = do_wait_thread(wo, tsk); >> >> - if (retval) >> >> + if (retval) { >> >> + read_unlock(&tasklist_lock); >> >> goto end; >> >> + } >> >> >> >> retval = ptrace_do_wait(wo, tsk); >> >> - if (retval) >> >> + if (retval) { >> >> + read_unlock(&tasklist_lock); >> >> goto end; >> >> + } >> >> >> >> if (wo->wo_flags & __WNOTHREAD) >> >> break; >> > >> >That's surprising and the changelog is lacking. >> >> >So the last time that code was touched upstream was 7 years ago: >> >> > commit 64a16caf5e3417ee32f670debcb5857b02a9e08e >> > Author: Oleg Nesterov >> > Date: Wed Jun 17 16:27:40 2009 -0700 >> >> > do_wait: simplify retval/tsk_result/notask_error mess >> >> >please explain whether what you fix is: >> >> > 1) an ancient bug that somehow nobody ever triggered (plus analysis >> > of why it wasn't triggered) >> >> > 2) a new bug introduced by commit XYZ (plus analysis) >> >> > 3) something else >> >> This issue is reported by Prevent Under category Missing Unlock, So >> we think it should be reported to maintainers. >Huh? In what way does your reply answer my questions? we sent this fix because we were doing static analysis of kernel code by tool coverity analyzer (Prevent), and it shows this unlock mismatch, Thats why we think to report this whether it is right or not . >Your patch is breaking the kernel, and badly so. Sorry for the noise . >Thanks, > Ingo Thanks????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?