public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: dhowells@redhat.com, james.l.morris@oracle.com, serge@hallyn.com,
	keyrings@vger.kernel.org, linux-security-module@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>
Subject: Re: keys: GPF in request_key
Date: Wed, 01 Feb 2017 13:11:32 +0000	[thread overview]
Message-ID: <21519.1485954692@warthog.procyon.org.uk> (raw)
In-Reply-To: <CACT4Y+arJJW0Ge9UxcLB77dM82gEENaEYgAcJdTSRLv1X0wnZw@mail.gmail.com>

Dmitry Vyukov <dvyukov@google.com> wrote:

> Code: 41 54 49 89 f4 53 49 89 d7 48 89 fb 48 83 ec 08 e8 d1 50 67 ff
> 49 8d 7c 24 10 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80>
> 3c 02 00 0f 85 35 02 00 00 49 83 7c 24 10 00 0f 84 bb 01 00

This disassembles to:

   0:   41 54                   push   %r12
   2:   49 89 f4                mov    %rsi,%r12
   5:   53                      push   %rbx
   6:   49 89 d7                mov    %rdx,%r15
   9:   48 89 fb                mov    %rdi,%rbx
   c:   48 83 ec 08             sub    $0x8,%rsp
  10:   e8 d1 50 67 ff          callq  0xffffffffff6750e6
  15:   49 8d 7c 24 10          lea    0x10(%r12),%rdi
  1a:   48 b8 00 00 00 00 00    movabs $0xdffffc0000000000,%rax
  21:   fc ff df 
  24:   48 89 fa                mov    %rdi,%rdx
  27:   48 c1 ea 03             shr    $0x3,%rdx
  2b:*  80 3c 02 00             cmpb   $0x0,(%rdx,%rax,1)               <-- trapping instruction
  2f:   0f 85 35 02 00 00       jne    0x26a
  35:   49 83 7c 24 10 00       cmpq   $0x0,0x10(%r12)
  3b:   0f                      .byte 0xf
  3c:   84                      .byte 0x84
  3d:   bb                      .byte 0xbb
  3e:   01 00                   add    %eax,(%rax)

I can see that RAX got loaded from the instruction at 0x1a, but the code
doesn't look very much like what I get out of the compiler (your compiled
function is also at least double the size of what I get, presumably due to
kasan?).

Can you disassemble __key_link_begin() for me and send me your config?

In particular, 0xdffffc0000000000 looks very weird.  Is this code validating
the pointer in R12?

David

  reply	other threads:[~2017-02-01 13:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 12:19 keys: GPF in request_key Dmitry Vyukov
2017-02-01 13:11 ` David Howells [this message]
2017-02-01 13:23   ` Dmitry Vyukov
2017-02-01 13:22 ` David Howells
2017-02-01 13:48 ` David Howells
2017-02-01 14:07   ` Dmitry Vyukov
2017-02-01 14:54     ` David Howells
2017-02-01 15:26       ` Dmitry Vyukov
2017-02-01 15:42         ` David Howells
2017-02-01 15:50           ` Dmitry Vyukov
2017-02-01 16:50             ` David Howells
2017-02-01 17:13               ` Dmitry Vyukov

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=21519.1485954692@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=dvyukov@google.com \
    --cc=james.l.morris@oracle.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=serge@hallyn.com \
    --cc=syzkaller@googlegroups.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