Received: by 10.192.165.148 with SMTP id m20csp4548053imm; Tue, 24 Apr 2018 04:46:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/mxMJgaxVFP5dYX8NlWUQVml7uiItqSQWHClRis/PvKxEX5GOXewYXUPzmbojZRYbE7h0Q X-Received: by 10.98.76.202 with SMTP id e71mr18356461pfj.171.1524570372352; Tue, 24 Apr 2018 04:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524570372; cv=none; d=google.com; s=arc-20160816; b=DHWDBDfuAyeEptuQ8XK9fFuT95L7JBCYEjwRaRhXq1TfGki7+3qNqVyt6UYx64tB8S Vwv8Dd7+uJ2anrNO2AnGllxO05O7cvZuZCvKz4Q02W6geVE/FCXOsRt1CbpxtGX3ifaZ xdOggNBOA8CKIYARW81Bt9IhsiefQYoPioVhSBsfCzvtnKIwxxRvo6Xb4B/TIAkw2iVr dGiLdbB0FdTBo/fIUsB9N9/11TMnqtLqLePXBIFz1VHnm3Rn9m8/GvTx1RBYIUaWp7c9 UYFu15ZJqh5UBN6WmbvxSnoZtVGoNoETVIKXj2S0x1WqMQQsC74yUouTscANZWQsyIFS ZEbA== 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:dkim-signature:arc-authentication-results; bh=1FPTq5HJFCBzmLPMUvCpltUOATCE8nfSX6u4EY+CO8c=; b=K8knT+CskFF7o2mmurlGt3sGIiUgXptLc2UMqbR5kqoCh8A5NOg67MAxlzos6xlB/S rzPP77/eTfXpBnKvvb4blwga9mO/6tB4EttVM/FMGJZ/0ImRJAPfBUGnO9J6tRIvqEL+ EckNsbGXPoiSPRznnlCOLmebpzDg8SXITQDfTzJn6hhgxHPYchU10ag0BR31oysV2OFJ Xh6eOu6ZPLezmNAdH16N9rRNkmgXWaBAvIMlilxgKAbIjKq8+sCBH7NiTAYGPYj+wt6R gKHTDJzHwVrPl0debdA508sj2I5E1fKPqbDLxvaqlJ7A0Oiq+q6zmIfUIQene7LutpiY rmag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=feJGcrks; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9-v6si13677919pll.67.2018.04.24.04.45.58; Tue, 24 Apr 2018 04:46:12 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=feJGcrks; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756147AbeDXLVo (ORCPT + 99 others); Tue, 24 Apr 2018 07:21:44 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37182 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbeDXLVl (ORCPT ); Tue, 24 Apr 2018 07:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1FPTq5HJFCBzmLPMUvCpltUOATCE8nfSX6u4EY+CO8c=; b=feJGcrksG0Bp9oBOql8nlV4KF EQ2mU1iba5iLKN3dv5x3fqSaQrkagtm0TevyqdcJMP+sA05RapySjR8+4DLN5Fv5yd1u9iTlhCwMs NAWuxOtE5xK+g7gqWj6zj+flmLg5H8W0ANMDj8f9TDmZOvPNTV6hNcNqpKVK2hkKykLnWAnN1W/Dz UUGWa6FyYfdXfMJTJ20/H/S8NxwNRZdAyMPVw0q5MVsY353udLhyKyTs3lBiqxXHb1MwkERGcQcE7 LQehtGO+lLv5tJTBxJl4oZXbtSuHm+v/u0d8XPJMjlxLa+SBnkOo8RAIyS9x1H2YYSYhS878q3LFY 9/1FQigHw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAw0o-00083G-Q0; Tue, 24 Apr 2018 11:21:31 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 40B34203BFAEE; Tue, 24 Apr 2018 13:21:29 +0200 (CEST) Date: Tue, 24 Apr 2018 13:21:29 +0200 From: Peter Zijlstra To: Dan Carpenter Cc: Mauro Carvalho Chehab , "Gustavo A. R. Silva" , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/11] media: tm6000: fix potential Spectre variant 1 Message-ID: <20180424112129.GT4129@hirez.programming.kicks-ass.net> References: <3d4973141e218fb516422d3d831742d55aaa5c04.1524499368.git.gustavo@embeddedor.com> <20180423152455.363d285c@vento.lan> <20180424093500.xvpcm3ibcu7adke2@mwanda> <20180424103609.GD4064@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180424103609.GD4064@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 24, 2018 at 12:36:09PM +0200, Peter Zijlstra wrote: > > Then usespace probes which part of the descr[] array is now in cache and > from that it can infer the initial out-of-bound value. Just had a better look at v4l_fill_fmtdesc() and actually read the comment. The code cannot be compiled as a array because it is big and sparse. But the log(n) condition tree is a prime candidate for the branchscope side-channel, which would be able to reconstruct a significant number of bits of the original value. A denser tree gives more bits etc.