Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4379247imm; Mon, 14 May 2018 06:48:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqe/VrMzr+fQL2uQStwlM9+T049fNKxY/GPSU4x9fXIlbWg8R1zTImmkCbUGXlJNuG/QJ4h X-Received: by 2002:a63:5f4f:: with SMTP id t76-v6mr8279544pgb.400.1526305690115; Mon, 14 May 2018 06:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526305690; cv=none; d=google.com; s=arc-20160816; b=rY9J+DayZWU8IPEdtqtSOolB0LxhLxiK8BPDSwhSTWkxsF+6HVUebasy/jMrUFzTYo y4M1TTc8UqAty5PhfzPLrMJrsmHFDAkjEYNAPhscXaE4aiueIwHevf4eqeIR6MqrNMdQ HdgPyq1kuNvj8aGiLkC7OrbJwf42pDy6G8Hw4xEK4RBJJRXEqm6MroMWrOFA2/kOOaF2 eQLKP7MlL0NQSpQpgCE0wQNjvNdM1ZD5u8FjXKmeY5SrN3Rwz+IIDG/6drJAAZY+CVNX u9209nWqYiSBESNoR3xP7BqC0r5bpdCwsWW7kq0W2XQHyfk6SOsDRgPNifIi4kwYpzr5 7vMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=2yBlPrmYMTtLYuf1hQDXL0t5rkHJhOLx1yf9c/Pf1vs=; b=NqTriMaewweuEy8QVnT4pSxfPFzY5jSLU6jNIhuGU5ff0qd/gQxyOIE8XZ35ZD3x0/ kthgAFf+jT5iRVZCOlTEoJEIENRzfJOLiEhtC1mxWnpZoeiARcWwZ6VszVWJOqLhRxYj 5W+R3jkMUdn1V1/hDq2k+bjnJY1LuUo1tAiqqaHxKn1XZvNC1HES+XTmJDa2Po5DIgDY iw7HcX75ttksxEYhd6MAz8AhJ14aA0+cmtj9PqizTWt/VYMpdWVTYH1l3PcqbY9LDc92 AtWDj7Zhbo+qzDPrypJlHgTAra2vIKc5B7Fb6K7FS2WkZc3XKG4wI3Mj41gzN/o0wHax 4r8g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73-v6si9721830pfh.315.2018.05.14.06.47.55; Mon, 14 May 2018 06:48:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932165AbeENNrU (ORCPT + 99 others); Mon, 14 May 2018 09:47:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57186 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932122AbeENNrS (ORCPT ); Mon, 14 May 2018 09:47:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50B29406E8A4; Mon, 14 May 2018 13:47:18 +0000 (UTC) Received: from treble (ovpn-120-21.rdu2.redhat.com [10.10.120.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 12092215CDA7; Mon, 14 May 2018 13:47:17 +0000 (UTC) Date: Mon, 14 May 2018 08:47:15 -0500 From: Josh Poimboeuf To: Ard Biesheuvel Cc: Dmitry Vyukov , Arnd Bergmann , Eric Biggers , syzbot , Herbert Xu , David Miller , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , LKML , syzkaller-bugs Subject: Re: WARNING: kernel stack regs has bad 'bp' value (3) Message-ID: <20180514134715.vz656l5qp3z7zwsy@treble> References: <001a11449aa2faf11805643af581@google.com> <20180202221829.tdiji2332t7orcxj@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 14 May 2018 13:47:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 14 May 2018 13:47:18 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' 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 12:11:17PM +0200, Ard Biesheuvel wrote: > On 12 May 2018 at 11:50, Dmitry Vyukov wrote: > > 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. > > IIRC, the additional speedup from adding that was significant but not > huge. Given that we don't use O3 anywhere else, I guess we should just > remove it. > > Could you please check whether that makes the issue go away? > > If so, > > Acked-by: Ard Biesheuvel > > for any patch that removes the O3 attribute override from keccakf() The issue only affects CONFIG_FRAME_POINTER (which is no longer the default on x86-64), so maybe -O3 could only be enabled for CONFIG_FRAME_POINTER=n, in which case you'd still get the speedup with the default ORC unwinder. -- Josh