Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1927454imm; Sat, 12 May 2018 02:51:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZriveVJNWspapq/P7mI9MOPt6ntpuHURcyN9IgD+zyKw7xYgZ9ATYHDEYxdsWH6NrKU7n9o X-Received: by 2002:a65:56cb:: with SMTP id w11-v6mr2138404pgs.175.1526118697449; Sat, 12 May 2018 02:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526118697; cv=none; d=google.com; s=arc-20160816; b=Mjh3OB0/5ONvWvZbsJJfESeKtH0qHexvLR5GfBy2ibWABCYxsN0RbMOUQgWCgPcdYp oMQ98bNyabrwDaoUdGNWjKmsimVpN/lhPnlNAv7Tdxro4bgzigXL7UXQvP5HpML35C1U e03ksQ0MOOD4BfFZLAp7dzvS1NeUV8/5NAZYgwWByHsB7xA32tiAKkybEQOIs9D+wVax K8l+Qnr/Dtx30alsibMDE6GAM9nIbi2jlUMF1koOELPBBtF/sp0oDvwkEH7sLMnvHdTZ wHrsMbLrmA7Z4YJBpOw1pI/s4U9oQ5lsDEKF8q7shBPkA7sqIqM7PfGQLRyPFZTSpql/ CskQ== 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=8yspBEF3qS5v7Jmii+Unh36guqpcRgfi/lrtlJ9/kos=; b=UoOH54VeCWBhcg0MLtEC8z0xGLFp6nWJWcrVxiVlCOM6OjemluDk6qKhaoSuSFa6jR exNdQ6+6wiCBOSJlwH2nrnK1tjJqa4oJG4Nj+BdaGDb0Fz3StJ2XEKfSNFCXL/opkwZ8 y0HpxWvcTpfUPxooXzMWJaJX6Zy/8MPFjmI7Y7UYJmCnUXM7fEYLIlvxIb679RSQbZbe isB7noUfE3VUgqAgfziMowxTN6p5BubWCHcBTZyk7sMhHxIhLCbn27oDuNkkAL8sxvF6 w5TVs3eyaw5fmxihHqE6HT7GqXSe34n/LAdjHS/iVOk9g2tFnXSOaKa2Go+ylluIDcUO V3UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TO9nCurv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13-v6si5587839plt.142.2018.05.12.02.51.10; Sat, 12 May 2018 02:51:37 -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=@google.com header.s=20161025 header.b=TO9nCurv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750905AbeELJu7 (ORCPT + 99 others); Sat, 12 May 2018 05:50:59 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:40708 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbeELJu5 (ORCPT ); Sat, 12 May 2018 05:50:57 -0400 Received: by mail-pf0-f193.google.com with SMTP id f189-v6so3823338pfa.7 for ; Sat, 12 May 2018 02:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8yspBEF3qS5v7Jmii+Unh36guqpcRgfi/lrtlJ9/kos=; b=TO9nCurvJzgKHOmyO+wdOKa78guihrKTmH76p1NYCDJ3L7ZoLJjVY0DFTecJP5XQLj qG/AGPhv7DnkM2KR/Lj4nyrMy8cFZ1b7JHTHL5MjO4sNxUVlDua7CjAM3AT1qyyfqzsq CXgUC3PtXyrozctAJzHVtO3IM+CmJZXlBtlVcgUlobKI137tK7hUZuNHen119eIo7c29 mr+aqP1D2/cHT7fdobMVdJIejL4WO/0jE8FG023nyNhUS3/iVRoqKYSPpODx4U5aykRY KBAEYRQL+Klsek2KPp86+V130rC60GvTbPBhi9GcG7zgySSQJKNKDcuf6FasBipmkUgI 2Peg== 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=8yspBEF3qS5v7Jmii+Unh36guqpcRgfi/lrtlJ9/kos=; b=BH46OvalFxK4shsURzMeaOAG/3K+u+Ti+FEYNA+t1PXcH+hi1p1TVb02TlWEanoRXq Ihzu72rLQ2k76FDh2sQGDH/7LmEDwZrR4qO5HWYsIIuwJsX8oG6neYGjhK9F2/r3TACn ioM/uYMuqnLJjKbGEE9Rb4h8ce3P7gV4q3vnUGeIwkNAqmd7A63OZkXfm2MK5YyzwKRT FwRXwAUkA+prEm2rmrrJ8fsvLd7NORZFz1AZLEINKEt3lgnUKMHSQGz6FVHlCvSKPMa8 M4y/hfPWhTOlEB2cPbGS3NEOUNf8puqRpWEOHmq7aubWCECxxboqGccBTNKK7AMpqbVV 6hmw== X-Gm-Message-State: ALKqPweSS2iMcGNUAQod39P4MGlFC7jkC/3eu34FpxMJ10yMbnKsKwYm /p6IJQwgleHREjYpwYR27fYha10LudR3Su9EqjPxHg== X-Received: by 2002:a62:1fc8:: with SMTP id l69-v6mr2473739pfj.49.1526118656583; Sat, 12 May 2018 02:50:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:9518:0:0:0:0 with HTTP; Sat, 12 May 2018 02:50:36 -0700 (PDT) In-Reply-To: References: <001a11449aa2faf11805643af581@google.com> <20180202221829.tdiji2332t7orcxj@gmail.com> From: Dmitry Vyukov Date: Sat, 12 May 2018 11:50:36 +0200 Message-ID: Subject: Re: WARNING: kernel stack regs has bad 'bp' value (3) To: Ard Biesheuvel Cc: Arnd Bergmann , 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 Sat, May 12, 2018 at 11:09 AM, Ard Biesheuvel wrote: > (+ Arnd) > > On 12 May 2018 at 10:43, 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 > > Ouch. > > I'm not an expert in x86 assembly. Could someone please check the > generated code to see what's going on? The C code changes are not that > intricate, they basically unroll a loop, replacing accesses to > 'array[indirect_index[i]]' with 'array[constant]'. > > As mentioned in the commit log, the speedup is more than significant > for architectures with lots of GPRs so I'd prefer fixing the patch > over reverting it (if there is anything wrong with the code in the > first place) I suspect the problem is with __attribute__((__optimize__("O3"))). It makes compiler use rbp register, which must not be used.