mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Paul Turner <pjt@google.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	Kostya Serebryany <kcc@google.com>
Subject: Re: Out-of-bounds access in get_wchan (arch/x86/kernel/process_64.c)
Date: Tue, 10 Sep 2013 15:06:38 -0700	[thread overview]
Message-ID: <20130910220638.GG11427@tassilo.jf.intel.com> (raw)
In-Reply-To: <CACT4Y+Y6r=HV7nFgbu=B=d-4ka3J4yotRjgX1M1xGkNkFn1sOQ@mail.gmail.com>

> Indeed, get_wchan ensures that fp<stack+THREAD_SIZE, but then dereferences fp+8:
> 
> 434                 if (fp < (unsigned long)stack ||
> 435                     fp >= (unsigned long)stack+THREAD_SIZE)
> 436                         return 0;
> 437                 ip = *(u64 *)(fp+8);
> 
> It must check that fp+8<stack+THREAD_SIZE.
> As far as I see, the bug can lead to garbage return values or in the
> worst case to crash.

Thanks for the report.

The change looks good to me. Can you please submit a formal signed off patch
to x86@kernel.org ?

-Andi


-- 
ak@linux.intel.com -- Speaking for myself only

  reply	other threads:[~2013-09-10 22:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 14:41 Dmitry Vyukov
2013-09-10 22:06 ` Andi Kleen [this message]
2013-09-11 18:16   ` Dmitry Vyukov
2013-09-27 19:03     ` Kees Cook
2013-09-28 19:51       ` Wolfram Gloger
2013-09-28 21:01         ` Kees Cook

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=20130910220638.GG11427@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=andreyknvl@google.com \
    --cc=dvyukov@google.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pjt@google.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

Powered by JetHome