From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751590AbbJYOqi (ORCPT ); Sun, 25 Oct 2015 10:46:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41417 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbbJYOqh (ORCPT ); Sun, 25 Oct 2015 10:46:37 -0400 Date: Sun, 25 Oct 2015 16:42:56 +0100 From: Oleg Nesterov To: Pedro Alves Cc: Andrew Morton , Dmitry Vyukov , Alexander Potapenko , Denys Vlasenko , Eric Dumazet , Jan Kratochvil , Julien Tinnes , Kees Cook , Kostya Serebryany , Linus Torvalds , "Michael Kerrisk (man-pages)" , Robert Swiecki , Roland McGrath , syzkaller@googlegroups.com, linux-kernel@vger.kernel.org, "gdb@sourceware.org" Subject: Re: [PATCH 0/2] wait/ptrace: always assume __WALL if the child is traced Message-ID: <20151025154256.GA2043@redhat.com> References: <20151020171740.GA29290@redhat.com> <5628F569.4070602@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5628F569.4070602@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/22, Pedro Alves wrote: > > In any case, to make sure existing gdb binaries would still work > with your kernel change, I ran GDB's testsuite with this: > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c > index cbcdd95..864ba2e 100644 > --- a/gdb/nat/linux-waitpid.c > +++ b/gdb/nat/linux-waitpid.c > @@ -149,3 +149,17 @@ my_waitpid (int pid, int *status, int flags) > errno = out_errno; > return ret; > } > + > +#include > + > +pid_t > +waitpid (pid_t pid, int *status, int options) > +{ > + static pid_t (*waitpid2) (pid_t pid, int *status, int options) = NULL; > + > + if (waitpid2 == NULL) > + waitpid2 = dlsym (RTLD_NEXT, "waitpid"); > + > + options |= __WALL; > + return waitpid2 (pid, status, options); > +} > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks a lot Pedro! So gdb should be fine, strace too. Perhaps we should change the kernel this way and forget about /sbin/init fixes. Oleg.