From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755368AbdEDQLr (ORCPT ); Thu, 4 May 2017 12:11:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40626 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753825AbdEDQLe (ORCPT ); Thu, 4 May 2017 12:11:34 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BACC561D1C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BACC561D1C Date: Thu, 4 May 2017 11:11:29 -0500 From: Josh Poimboeuf To: David Laight Cc: "x86@kernel.org" , Andrey Konovalov , "linux-kernel@vger.kernel.org" , Vlad Yasevich , Neil Horman , "David S . Miller" , "linux-sctp@vger.kernel.org" , netdev , Marcelo Ricardo Leitner , Dmitry Vyukov , Kostya Serebryany , syzkaller , Eric Dumazet , Cong Wang Subject: Re: [PATCH] x86/asm: Don't use rbp as temp register in csum_partial_copy_generic() Message-ID: <20170504161129.syz46qyxge3nupki@treble> References: <4b03a961efda5ec9bfe46b7b9c9ad72d1efad343.1493909486.git.jpoimboe@redhat.com> <063D6719AE5E284EB5DD2968C1650D6DCFFE581C@AcuExch.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DCFFE581C@AcuExch.aculab.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 04 May 2017 16:11:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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