Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3697832pxy; Tue, 4 May 2021 08:03:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxauI8o1B6AsVT4hOkpAJrjWNRWXuBfRTf5e2lZbP4vw94O3O1AZJHA8mXVxu1z/iZMJ7te X-Received: by 2002:a05:6402:4370:: with SMTP id d16mr26261561edc.185.1620140589362; Tue, 04 May 2021 08:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620140589; cv=none; d=google.com; s=arc-20160816; b=FJJeCmUfMVUvPsrUB8zXvrH8gXCUEZ2c5nVI2L8iXoUwnMXQbYTBxaf98y5meA2UWr ugQV8ohQibeg+nKnro76z3/jc8MQ8iUdFlWbJ/ik6B6aqcXHWndfBqGwXk5HX589WL8U Edmi6K6dE0/LUgFGlXEryi9ddPMJKK08yKxNlb0Qne4zptAM/Ibze0qUczRqFnB/xBeh sgRegMbhWXHjt+U+WgV9WpoS0U7dFXdJAy72gbvUtdPaB4opUIctd/6W24VUvhzP10yV BOe7X4WN5FGDUWDmbOXQo9e5iYgOGUdKlcRvs1wLvQOiaawu9j+T/U1ANugR0yDZU2O3 yXZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IxWQcmXS2jOkHYwAt2gj66bGdjzbjRHMf4MKM8nnh4g=; b=IVX0HLxRzq7DwD8yF8Y1uOIPIipYS+r42vAfIcAj3onH3h9V8+rfXLNxPSX7eBagx9 XFnO/oT4/l1ihkMitxyQPhKdg0QbSZKTuHy7O1E1+QX5OlfxNcg5jkIuc27grYR+kIsX J3NYQTXtQI5RLaI2pFXuYyHtvf/eFUeGy21oAy8EhBMppBNct96R0NEARVFqkSQzHhOy Tw6oHYaz6mDN0dqeqUd+5s7h+xIn4GH/6q1jEQHMyYfF3FMpA83WHsuI/M6JURel4FGJ rTfiibGyDsi/6hns8vkyNrNt8g8rfSrUy3Au3ao0uQTgS+HKrcW/+exy5gPj/xmHYO0i 5WAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iEaatpHo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si2815594ejy.364.2021.05.04.08.02.39; Tue, 04 May 2021 08:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iEaatpHo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbhEDNZt (ORCPT + 99 others); Tue, 4 May 2021 09:25:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22509 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbhEDNZs (ORCPT ); Tue, 4 May 2021 09:25:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620134693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IxWQcmXS2jOkHYwAt2gj66bGdjzbjRHMf4MKM8nnh4g=; b=iEaatpHoENdx9l2wEsfc1GQVO0n5IOQAEIdkkJvsVlLtvgU0Llj8tNkLPQ43IvrOrNgU28 qjCXc48As/h64AxBPM4x6j3sJ3+Grd+aKae+oIYkk7rR7BreZiqd8Ej6k9TMBVIWD1pvbJ FVPxGO9Gi/LNQv7m9XOGb2eZkLIFJ6c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-600-3pj-KjMFPT-HYHOAtZsW5A-1; Tue, 04 May 2021 09:24:52 -0400 X-MC-Unique: 3pj-KjMFPT-HYHOAtZsW5A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5FEA107ACE3; Tue, 4 May 2021 13:24:50 +0000 (UTC) Received: from treble (ovpn-115-93.rdu2.redhat.com [10.10.115.93]) by smtp.corp.redhat.com (Postfix) with SMTP id BF35D2C01B; Tue, 4 May 2021 13:24:49 +0000 (UTC) Date: Tue, 4 May 2021 08:24:49 -0500 From: Josh Poimboeuf To: David Laight Cc: Andy Lutomirski , X86 ML , LKML , David Kaplan , Andrew Cooper , David Woodhouse , Kees Cook , Jann Horn Subject: Re: Do we need to do anything about "dead =?utf-8?B?wrVvcHM/Ig==?= Message-ID: <20210504132449.wmvxtubhuzuqc3xr@treble> References: <20210503233010.x5lzpw4dq3gueg47@treble> <20210504031616.covixup7rhdil3yq@treble> <5937e5a2f1014e2da4a07e249745ceb1@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5937e5a2f1014e2da4a07e249745ceb1@AcuMS.aculab.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 04, 2021 at 01:06:06PM +0000, David Laight wrote: > From: Josh Poimboeuf > > Sent: 04 May 2021 04:16 > ... > > I was actually thinking more along the lines of > > > > val = 0; > > > > if (user_supplied_idx < ARRAY_SIZE) // trained to speculatively be 'true' > > val = boring_non_secret_array[user_supplied_idx]; > > > > if (val & 1) > > do_something(); > > > > In other words, the victim code wouldn't be accessing the secret > > intentionally. So there's no reason for it to avoid doing > > data-dependent branches. > > Isn't that one of the very boring standard spectre cases? Classic v1 as described in the Spectre paper was a data-dependent load/store, not a data-dependent branch. -- Josh