Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3770046imm; Mon, 11 Jun 2018 01:14:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLh5EEfdFdFPBC90YP2F59SfFW6gAB4FodwEPs2a1bQf4S1ILG4RMB6MrXmXEBeaW+yBthW X-Received: by 2002:a62:5911:: with SMTP id n17-v6mr16450746pfb.162.1528704864259; Mon, 11 Jun 2018 01:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528704864; cv=none; d=google.com; s=arc-20160816; b=06tWZzLqa6rg81mMXQRrHjzhcqPATtBZkcR03x4gOVzuhO3xHtUy6Yw5M/Ok+J7K6E KwdfBJ8KjicDGxtt5f146eUq9WEA/4ZZtoOPw+7dqQF3YSZyHFbx6bBrAR4TN14W9gX2 mSQxakUvSZViowQvxQ6vzOnCd8RXHpLDQIdU6ps5OnWiUQJ+ecML2A5ekmisUQtMOX5T L+CMJG+22FJT3Tr4qcIoPv/NuoVncNwtg5UnD97XJ7PZDHfbZ1XoYXoyouiygS/UhWkI eKC8OJc8eOF5WrmrZom6mgaVL80xuyVn8WtrbvsyhteOgUtaYPz8WpDVsFI3iu0Otyv8 5WNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=naRPeXZHrCh/GeFuNRWkZVSdhp0Q1xMrypMje1D7e2o=; b=juN1Ma6YuavTBin8XDgg1bJEFndhxnHAAJ9hdKztW9hvIiY3vWx2mStBoRAy9mj0w8 HzMT/DIYB+7EolA4in8pYe1ZPvOVZePSD8ZkZBnbKi4CsKU5LqHaUy5uXB9M72BQhqp9 vDgBR0aSSe8ujjQLhZ+BZ9KgZdKQaRm87bilKmBuh0KdARM83Vdn57jZpWaDaNJm7SxK hMcYLOXFNObBH8JfiEDamxxKef3J8wSGt1/cp6I7X5st1vQh4KtZxB8PXiz9VHIutSCj ESERv384qoymPU0Ja9awDP7cbRQdlETlPr0Lm27sR6JL0Fmp0LMzQ7kUI7Yfh2y1v+Sv cTLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F4WGqK/W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd3-v6si20336577plb.171.2018.06.11.01.14.09; Mon, 11 Jun 2018 01:14:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F4WGqK/W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754125AbeFKINp (ORCPT + 99 others); Mon, 11 Jun 2018 04:13:45 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:52203 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754039AbeFKINn (ORCPT ); Mon, 11 Jun 2018 04:13:43 -0400 Received: by mail-it0-f66.google.com with SMTP id n7-v6so9330858itn.1 for ; Mon, 11 Jun 2018 01:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=naRPeXZHrCh/GeFuNRWkZVSdhp0Q1xMrypMje1D7e2o=; b=F4WGqK/W0p7mrVBNGD2bW81NuKWZgh0V2SYA5xw6buttxTa+hY5/sbl6a2xqogs/MI yro17dMvbiJcKYjY9Q9WPavDjedXMAm7PXT8JVbsIJoUUeEbhD+K5bywUYEjfdA0Dr2x cgUV4FqWWX3hMYaWuPIkM8hxCuQWMUFQaH23M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=naRPeXZHrCh/GeFuNRWkZVSdhp0Q1xMrypMje1D7e2o=; b=PiJ+G9LqkXprmtP9sXzZLwPMlXSa1c9S6RA9+ptSIJ90ObeBcK7qrt6J93J4Fv/36x 499Du4seRiZinLpFYqsK4mPQmO2vHFrWb7ayp2WCofObxEWPQrDIiN4fxPLwY8OyDLsh yr6j0vKYxwqJyz27vmpmrM/YnjI0sa2dj8vCNHfKph9t7SwkWpmTjXNsauxSk528Z7mM i3OJghDX4nK7DNEi34FKWzuTFuTS+kjiNjPxFjPnyb3V41cs2SOzkJEv5UQQqiF56K6Q c3rJbASVpDa9QlihNfDFx3KNA2Dezs6fkl5oRXFFJzHTnypGd13Lt44/ZZirozXrirlE 3xTA== X-Gm-Message-State: APt69E2r9fxDskqxso81WQANfpurub7qTeQxJGyHrLmsG5w4NZviFZqD 5IhCISUlQmo8uyuG1j5MGA3Xs8u1qbM4u+7wn7/4cw== X-Received: by 2002:a24:298e:: with SMTP id p136-v6mr9307807itp.42.1528704822738; Mon, 11 Jun 2018 01:13:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bbc7:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 01:13:42 -0700 (PDT) In-Reply-To: References: <001a11449aa2faf11805643af581@google.com> <20180202221829.tdiji2332t7orcxj@gmail.com> <20180526072203.GA724@sol.localdomain> From: Ard Biesheuvel Date: Mon, 11 Jun 2018 10:13:42 +0200 Message-ID: Subject: Re: WARNING: kernel stack regs has bad 'bp' value (3) To: Dmitry Vyukov Cc: Eric Biggers , syzbot , Herbert Xu , David Miller , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , LKML , Josh Poimboeuf , syzkaller-bugs Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8 June 2018 at 11:54, Dmitry Vyukov wrote: > On Sat, May 26, 2018 at 9:22 AM, Eric Biggers wrote: >> On Sat, May 12, 2018 at 10:43:08AM +0200, Dmitry Vyukov wrote: >>> On Fri, Feb 2, 2018 at 11:18 PM, Eric Biggers wrote: >>> > On Fri, Feb 02, 2018 at 02:57:32PM +0100, Dmitry Vyukov wrote: >>> >> On Fri, Feb 2, 2018 at 2:48 PM, syzbot >>> >> wrote: >>> >> > Hello, >>> >> > >>> >> > syzbot hit the following crash on upstream commit >>> >> > 7109a04eae81c41ed529da9f3c48c3655ccea741 (Thu Feb 1 17:37:30 2018 +0000) >>> >> > Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide >>> >> > >>> >> > So far this crash happened 4 times on net-next, upstream. >>> >> > C reproducer is attached. >>> >> > syzkaller reproducer is attached. >>> >> > Raw console output is attached. >>> >> > compiler: gcc (GCC) 7.1.1 20170620 >>> >> > .config is attached. >>> >> >>> >> >>> >> From suspicious frames I see salsa20_asm_crypt there, so +crypto maintainers. >>> >> >>> > >>> > Looks like the x86 implementations of Salsa20 (both i586 and x86_64) need to be >>> > updated to not use %ebp/%rbp. >>> >>> Ard, >>> >>> This was bisected as introduced by: >>> >>> commit 83dee2ce1ae791c3dc0c9d4d3a8d42cb109613f6 >>> Author: Ard Biesheuvel >>> Date: Fri Jan 19 12:04:34 2018 +0000 >>> >>> crypto: sha3-generic - rewrite KECCAK transform to help the >>> compiler optimize >>> >>> https://gist.githubusercontent.com/dvyukov/47f93f5a0679170dddf93bc019b42f6d/raw/65beac8ddd30003bbd4e9729236dc8572094abf7/gistfile1.txt >> >> Note that syzbot's original C reproducer (from Feb 1) for this actually >> triggered the warning through salsa20-asm, which I've just proposed to "fix" by >> https://patchwork.kernel.org/patch/10428863/. sha3-generic is apparently >> another instance of the same bug, where the %rbp register is used for data. > > > Mailed "crypto: don't optimize keccakf()" to fix this. > > Amusingly __optimize("O3") always lead to degraded performance as gcc does not > inline across different optimizations levels, so keccakf() wasn't inlined > into its callers and keccakf_round() wasn't inlined into keccakf(). That does not make sense. The -O3 definitely made the code run slightly faster on AArch64, but I don't remember the exact numbers or the compiler version. In any case, it wasn't an improvement worth obsessing about compared to the 14x speedup I got on A53 from rewriting the code itself.