public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tycho Andersen <tycho@tycho.ws>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Kees Cook <keescook@chromium.org>,
	Oleg Nesterov <oleg@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: siginfo pid not populated from ptrace?
Date: Mon, 12 Nov 2018 11:55:38 -0700	[thread overview]
Message-ID: <20181112185538.GK3645@cisco> (raw)
In-Reply-To: <87efbqi1xa.fsf@xmission.com>

On Mon, Nov 12, 2018 at 12:30:25PM -0600, Eric W. Biederman wrote:
> Tycho Andersen <tycho@tycho.ws> writes:
> 
> > Hi Oleg,
> >
> > I've been running some tests on my seccomp series, and in one of the
> > tests on v4.20-rc2, I noticed,
> >
> > [ RUN      ] global.syscall_restart
> > seccomp_bpf.c:2784:global.syscall_restart:Expected getpid() (1492) == info._sifields._kill.si_pid (0)
> > global.syscall_restart: Test failed at step #22
> >
> > which seems unrelated to my series (the kernel was stock v4.20 with my
> > patches on top).
> >
> > I've been running a lot of tests, and only seen this once, so it seems
> > like a fairly rare race. I tried to look through the code but didn't
> > see anything obvious. Thoughts?
> 
> My guess would be pid namespaces, or stopping for a signal other than
> SIGSTOP.
> 
> If you can get this to reproduce at all it would be interesting to see
> si_signo and si_code.  So that we can see just which signal is in info,
> and how it should be decoded. 

Sure, here's what I see,

seccomp_bpf.c:2784:global.syscall_restart:Expected getpid() (2195) == info._sifields._kill.si_pid (0)
seccomp_bpf.c:2785:global.syscall_restart:si_signo: 19
seccomp_bpf.c:2786:global.syscall_restart:si_code: 0

> I see this test at line 2736 in 4.20-rc1 so there are almost 50 lines of
> change in your version of seccomp_bpf.c.  So I hope I am reading the
> proper test.

Yes, sorry, that's additional test stuff from my user trap series. I
haven't manage to reproduce it on stock v4.20-rc2, unfortunately. It
could be that this is some memory corruption introduced by my series,
but I'm running these tests with KASAN so hopefully it would complain?

Tycho

  reply	other threads:[~2018-11-12 18:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 17:11 siginfo pid not populated from ptrace? Tycho Andersen
2018-11-12 18:30 ` Eric W. Biederman
2018-11-12 18:55   ` Tycho Andersen [this message]
2018-11-12 19:22     ` Eric W. Biederman
2018-11-12 19:24     ` Tycho Andersen
2018-11-27 23:21       ` Tycho Andersen
2018-11-28  0:38         ` Kees Cook
2018-11-28  1:17           ` Kees Cook
2018-11-28  4:44             ` Eric W. Biederman
2018-11-29 21:17               ` Kees Cook
2018-11-29 23:22                 ` Tycho Andersen
2018-12-01 15:04                 ` Eric W. Biederman
2018-12-06  1:00                   ` Kees Cook
2018-12-06 14:40                     ` Eric W. Biederman
2018-12-06 18:48                       ` Linus Torvalds
2018-12-06 19:20                         ` Tycho Andersen
2018-12-06 21:11                           ` Eric W. Biederman
2018-12-06 21:34                             ` Kees Cook
2018-12-06 22:43                               ` Eric W. Biederman
2018-12-06 22:55                                 ` Kees Cook
2018-12-10 15:37                             ` Oleg Nesterov
2018-12-10 15:44                               ` Tycho Andersen
2018-12-10 17:36                               ` Eric W. Biederman
2018-12-10 14:57                           ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181112185538.GK3645@cisco \
    --to=tycho@tycho.ws \
    --cc=ebiederm@xmission.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox