Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1983233imm; Wed, 16 May 2018 06:12:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpBHX4vMPyTz55HzVerfYt9Va9r2+I+vbQMzAFhbRmEz6W59AUOLz/2yuKrfhAUhW+IX/jA X-Received: by 2002:a65:43cb:: with SMTP id n11-v6mr688468pgp.287.1526476331213; Wed, 16 May 2018 06:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526476331; cv=none; d=google.com; s=arc-20160816; b=bFc8H9yzxzTQM/vK9ycck+DAngbJaJGIG/tYYF6SHMocjNs/EfPrlLoZOvGiitX69J 9A8MD4dltKmL5TWExB1eH0EaWOntum+COkOz8emQ9901IggK0KfF+PNQCtiVXrFfLI6S 5FBPwKszWZTpFQfl5ro2ZS4hEYa9VsFkkU906yjiNTIbzh9B+1vALahePDTkeS5z5xfh /squKR+YR8CBNRWK5mzna9UMb+SVCm/i4LHbirZ0tTBdSOUMVlLMopxkpD16XmR4e683 pXPenGcUdPTwYk07bcrcijFJN+Mphu7W54l3e2rWFo+Kl2q8pSEYLasfcWMDeW9PJn4i nelw== 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=oaP0QnHQ8Vbs41Vvp8BIkdm7i5f61mqVC8WfS1IJRuc=; b=dq+Asdxfe0tizq7W8GL8Z0FJbpUwgNPcrv5iufSGJCFlZqpjOYfT1R4EWnkPNt4rvx Z/GYCdMlW3crVeDpRRNUHZL7k1R9CYJaNIewwTF6rvoEJ8Up9r1t+td4dwUpLos7ixuN ftaDrFi1vpR883gcBKVlw09jOVJBwNRxDHUzZY18TUmxYuSP1aWn+asFyZ0J4Lj7StXb SMrJd8hprmlC46M99LD5RHTbUvNvrTBruNAw+byBE3AIlz9UCWPELXrBqYDcHQ/l829A i+q93/gCxG5kwzIlohqg/LHtTDj32GuwXIfLwGUTNzDZdAIYUBf1z4myizbGHe3bNBUo O46A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=DqoKlWHU; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u26-v6si2061884pgv.199.2018.05.16.06.11.56; Wed, 16 May 2018 06:12:11 -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=@oracle.com header.s=corp-2017-10-26 header.b=DqoKlWHU; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752516AbeEPNLj (ORCPT + 99 others); Wed, 16 May 2018 09:11:39 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:40204 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410AbeEPNLh (ORCPT ); Wed, 16 May 2018 09:11:37 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4GDBMGW027116; Wed, 16 May 2018 13:11:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=oaP0QnHQ8Vbs41Vvp8BIkdm7i5f61mqVC8WfS1IJRuc=; b=DqoKlWHUzaVEXYSr7m5B+zDGVqYz/CkgIWYwI76t4b4JThGnHGO47H7EXl4gyDV0bDnc cxq0kNygM/4ZShwswY6jTiW0qPiKZg47VGznV9XZxUGL1QPPVwUeXwn+fWxQmIIu1cBT 3L6T+FwpEh8Ugo1cG55kVcDNyfVJyGIjpp+vs3hp2SLonK0zknz6lfRqKCqMpCXFxjo9 J9nL8uQ5HQAWUUes9n73Z6pKfNlagVs6isw4Bnoq1mpjO6dau8XRMErCgJ2gkqWGLdzN QpM0MGP49lLLoU41cydxGB4LQN1OXhbiKkyFUk2mMjb+6UT9AYgSNs/Q3jRG8qO21Wki xA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2hx29w4r43-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 May 2018 13:11:22 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4GDBH0B014035 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 May 2018 13:11:17 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4GDBG8V030461; Wed, 16 May 2018 13:11:16 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 16 May 2018 06:11:16 -0700 Date: Wed, 16 May 2018 16:11:08 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: "Gustavo A. R. Silva" , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/11] media: tm6000: fix potential Spectre variant 1 Message-ID: <20180516131108.xcvsw6m4qrmqgykh@mwanda> References: <20180423152455.363d285c@vento.lan> <3ab9c4c9-0656-a08e-740e-394e2e509ae9@embeddedor.com> <20180423161742.66f939ba@vento.lan> <99e158c0-1273-2500-da9e-b5ab31cba889@embeddedor.com> <20180426204241.03a42996@vento.lan> <20180515085953.65bfa107@vento.lan> <20180515141655.idzuh2jfdkuu5grs@mwanda> <20180515160033.156f119c@vento.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180515160033.156f119c@vento.lan> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805160135 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 15, 2018 at 04:00:33PM -0300, Mauro Carvalho Chehab wrote: > Yeah, that's the same I'm getting from media upstream. > > > drivers/media/cec/cec-pin-error-inj.c:170 cec_pin_error_inj_parse_line() > > warn: potential spectre issue 'pin->error_inj_args' > > This one seems a false positive, as the index var is u8 and the > array has 256 elements, as the userspace input from 'op' is > initialized with: > > u8 v; > u32 op; > > if (!kstrtou8(token, 0, &v)) > op = v; > It's hard to silence this because Smatch stores the current user controlled range list, not what it was initially. I wrote all this code to detect bounds checking errors, so there wasn't any need to save the range list before the bounds check. Since "op" is a u32, I can't even go by the type of the index.... > > drivers/media/dvb-core/dvb_ca_en50221.c:1479 dvb_ca_en50221_io_write() > > warn: potential spectre issue 'ca->slot_info' (local cap) > > This one seems a real issue to me. Sent a patch for it. > > > drivers/media/dvb-core/dvb_net.c:252 handle_one_ule_extension() warn: > > potential spectre issue 'p->ule_next_hdr' > > I failed to see what's wrong here, or if this is exploited. Oh... Huh. This is a bug in smatch. That line looks like: p->ule_sndu_type = ntohs(*(__be16 *)(p->ule_next_hdr + ((p->ule_dbit ? 2 : 3) * ETH_ALEN))); Smatch see the ntohs() and marks everything inside it as untrusted network data. I'll fix this. regards, dan carpenter