Netdev List
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "x86@kernel.org" <x86@kernel.org>,
	Andrey Konovalov <andreyknvl@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Vlad Yasevich <vyasevich@gmail.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	"David S . Miller" <davem@davemloft.net>,
	"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Kostya Serebryany <kcc@google.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Eric Dumazet <edumazet@google.com>,
	Cong Wang <xiyou.wangcong@gmail.com>
Subject: Re: [PATCH] x86/asm: Don't use rbp as temp register in csum_partial_copy_generic()
Date: Thu, 4 May 2017 11:11:29 -0500	[thread overview]
Message-ID: <20170504161129.syz46qyxge3nupki@treble> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DCFFE581C@AcuExch.aculab.com>

On Thu, May 04, 2017 at 03:56:49PM +0000, David Laight wrote:
> From: Josh Poimboeuf
> > Sent: 04 May 2017 15:52
> > Andrey Konovalov reported the following warning while fuzzing the kernel
> > with syzkaller:
> > 
> >   WARNING: kernel stack regs at ffff8800686869f8 in a.out:4933 has bad 'bp' value c3fc855a10167ec0
> > 
> > The unwinder dump revealed that rbp had a bad value when an interrupt
> > occurred in csum_partial_copy_generic().
> > 
> > That function saves rbp on the stack and then overwrites it, using it as
> > a scratch register.  That's problematic because it breaks stack traces
> > if an interrupt occurs in the middle of the function.
> 
> Does gcc guarantee not to use bp as a scratch register in leaf functions?

At least in practice, gcc doesn't touch rbp in leaf functions.  (I don't
know about guarantees.)

-- 
Josh

  reply	other threads:[~2017-05-04 16:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 14:51 [PATCH] x86/asm: Don't use rbp as temp register in csum_partial_copy_generic() Josh Poimboeuf
2017-05-04 15:56 ` David Laight
2017-05-04 16:11   ` Josh Poimboeuf [this message]
2017-05-05  8:10 ` [tip:x86/urgent] x86/asm: Don't use RBP as a temporary " tip-bot for Josh Poimboeuf

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=20170504161129.syz46qyxge3nupki@treble \
    --to=jpoimboe@redhat.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=andreyknvl@google.com \
    --cc=davem@davemloft.net \
    --cc=dvyukov@google.com \
    --cc=edumazet@google.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=syzkaller@googlegroups.com \
    --cc=vyasevich@gmail.com \
    --cc=x86@kernel.org \
    --cc=xiyou.wangcong@gmail.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