lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 15 May 2011 16:40:17 +0200
From:	Jan Kratochvil <jan.kratochvil@...hat.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Oleg Nesterov <oleg@...hat.com>, vda.linux@...glemail.com,
	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org, indan@....nu
Subject: waitpid(WNOHANG) should report SIGCHLD-notified signals  [Re: [PATCH
 09/11] job control: reorganize wait_task_stopped()]

On Thu, 12 May 2011 19:32:28 +0200, Tejun Heo wrote:
[...]
> 	  while (1) {
> 		  siginfo_t si = {};
> 
> 		  waitid(P_PID, child, &si,
> 			 WSTOPPED | WCONTINUED | WNOWAIT | WNOHANG);
> 		  if (!si.si_pid)
> 			  break;
> 	  }
> 
> 	  kill(control, SIGKILL);
> 	  kill(child, SIGKILL);
> 	  return 0;
>   }
> 
> waitid(2) should always succeed as it's never consuming wait state,
> but it does, with or without the patch.  All transitions need to be
> made water tight to remove the bug.

It may be not related, I do not inderstand the kernel internals being
discussed.

I was told by Roland McGrath that after SIGCHLD of a ptrace even from tracee
invokes sighandler for that SIGCHLD in the tracer then waitpid(WNOHANG) still
may return 0 as the signal is not yet ready.  I was not able to reproduce it
with a testcase myself.

But if it is a case it should be fixed as there is no later notification when
to call waitpid(WNOHANG) again.  And sure the debugger cannot busy-loop poll
it.


Thanks,
Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ