Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1892617imm; Sat, 12 May 2018 02:10:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrDcw9QX9xYIVsm6F4J+udKjuYKOJeEPr6VhCwQMruydlbSeHQQs/7cy1z2Dk+0E8dwIsXE X-Received: by 2002:aa7:8386:: with SMTP id u6-v6mr2328083pfm.253.1526116218834; Sat, 12 May 2018 02:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526116218; cv=none; d=google.com; s=arc-20160816; b=HAck8Ws2rKVGrPkJEAazMvlfKukdYkyHhu82GTZw5V/vhFw/s2Kf1KtUVWYYp4e8EF pV69y2kYBST6Go4uH9fDoNU72ZowxplBOf8ok/Vqbjn3CTM9RkO0l2Q9/sP4QQkedZLz 71Vt3c5IfuoB9LelwVLexDvpFzD1shWr9h13oaRcxWDNGGtjDSYTOEu1/1tHd+YFEcH3 S8JbjziKjGuO43mInfqr+p8f4wGCzIfEKiXCIwPPoeNzq7OMpdrzHu7g8oRAitsIJGB4 JKS9e8MWUqRFF0nfJyUugCNJILLx1/HfLUKN7HjrUjxzMnjfZDUo35tR8wKNGbJCE3OI uYGw== 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=ttrKgguPfXIpPvJW0xLl+WyOcI9qKn5jMv9TiSZfAlI=; b=rpwRoV4hD/5LCHEvMGa0chqvo3L/NR2qHYFWBnliL9KHvDgIdoZPbiDq6EfjQ/Cjt0 4GyiGT+qYSAr1gMtSw0TwKqOo6d+8eOxpAABERudh34m9+IJixkcyYpZkoVNPJjAz/kZ VHb0bovedqHQZ6iN8xfkgmjlOjvAeetb/U13UEIPExq/oMXaSXZptedeunLo9G3+j5fJ /DjsVUFMchpTAG3Tjz1TZrVoat1pX8oKvp10OQe8T4rFKMjmPAi0NBZTaSRA4RiXXDEI dg+jgbB920HBtaJmZjLuHF+tITlFCAvbEIa9RLbxkC+cSV1jSqrClpgpAoXjQw2Ba4fx hyaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LuvK2S8U; 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 p17-v6si5046121plo.363.2018.05.12.02.10.04; Sat, 12 May 2018 02:10:18 -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=LuvK2S8U; 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 S1751430AbeELJJw (ORCPT + 99 others); Sat, 12 May 2018 05:09:52 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:34110 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbeELJJu (ORCPT ); Sat, 12 May 2018 05:09:50 -0400 Received: by mail-it0-f65.google.com with SMTP id c5-v6so3965522itj.1 for ; Sat, 12 May 2018 02:09:50 -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=ttrKgguPfXIpPvJW0xLl+WyOcI9qKn5jMv9TiSZfAlI=; b=LuvK2S8Utgel3iK2CAvFVfgbs+s6gQA2W9J726yl402xI6UmXXOoV73OR8TnuMBnc8 FG98CQr58BayxGkvwH24T1v18KERmcDwuPGR94ICl6i/8p/7yVoQPXBykq+L3UYoOSTz 0Z5WJlaev7u6LjOaLW/axFH1wiM/BzrTaLRQw= 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=ttrKgguPfXIpPvJW0xLl+WyOcI9qKn5jMv9TiSZfAlI=; b=gvEWFlbBqoKYrV7nhbob57VGv+63lcK/3NfVznqYgfLQKdzAWSKXTJs1i3ASSSdbeI ul0GPlhUfbTDn27aF7nfkskPNAmmjnIFpNsh8lXhBaUCx2YV+kGRfyECNhdqLh4fqud+ jT0QWQyIAhMvwQrYDiHaNT2Qcjjmpz0d70YzWLPYj1u4XPzfY7M9GQdyzNcF1l0TqPBv WzRsg2qZu72QETqzu3IjKXVKyFX24RsWnZcaCiCCQdw9BY0xy/NAbQTZ5OB/Ceu4JQtO 1xnavswKSvKG8TC6nmcVIA3Dc7nMupcaOiPX2GTb13pUeIsPAnEda35tbwTcGudGAxhv tITw== X-Gm-Message-State: ALKqPwer9WMcKgxEq7oUJpJeOuME0kQtpBqZolXzFNmr93xZjkP9sNyJ XrViMsyUUWDSzNfo0lo5wsmK7RFEHMXBB2YsJUwMIQ== X-Received: by 2002:a24:5390:: with SMTP id n138-v6mr1308648itb.42.1526116189768; Sat, 12 May 2018 02:09:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.134 with HTTP; Sat, 12 May 2018 02:09:48 -0700 (PDT) In-Reply-To: References: <001a11449aa2faf11805643af581@google.com> <20180202221829.tdiji2332t7orcxj@gmail.com> From: Ard Biesheuvel Date: Sat, 12 May 2018 11:09:48 +0200 Message-ID: Subject: Re: WARNING: kernel stack regs has bad 'bp' value (3) To: Dmitry Vyukov , Arnd Bergmann 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 (+ 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) -- Ard.