Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2012349imm; Wed, 16 May 2018 06:37:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqSAb4KSwkZRCauPlW7InFHWYFNTrn2asVlmVHr/TFTBlZ/FtWSrD3XHM/DAqf/voAD3p+P X-Received: by 2002:a17:902:b589:: with SMTP id a9-v6mr966444pls.161.1526477864103; Wed, 16 May 2018 06:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526477864; cv=none; d=google.com; s=arc-20160816; b=Z41bC9e30X90aTYunRIe1CONxZpEz8EmFE6YJDQux5hHHytRQV4jEoPiavUCjtK35j Q6nxoKWQhZYg+Ob1X40zR/iYK47bMXxj4dY4Y3ZMHxA6EvGlgXNSWqeKOBETnLHyO7ah 7Hdi2gpic74BnBlbsor11ahGMOBc2vSamD5rDIy9Pgh6+zomZSB5dqII4z9kVPDRbOSg f1UbbGPhUK2o9utjIsPUaa1YA+vUa6Z+CvyCdYDZ9E+amVPuVKTU+9YwBPDSDQHZVTWC hz2epC6bIEbqdCvOdI68lA70Q7sHTtW8SSK4HY/YEI9T9DYCRlXnAQEtsFdzeRPa0/bi sbYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=0qXxwtR3KT0Hu+FzmU9qtP/gL00lLBIFs4i8tRw/aY0=; b=rIfAMaEvvJDlLPIPFkggP3rXhtyuSgv0GslAU55Ht4jBfXxRaKg+kCs39qFdv7Co8F z7SucZjM7STqYDPHkv8DUsPRbdShstVSoN0vCnaASVMULG8jZ05QQGiemfXWaOmJEfev 8ZoEV1lzI4/+Hb74T+MNXw4yRWP/tuOYOQN2dsW5POtI/MgIdyY02chaYpWJKLaGM55+ Vmrq02YwXqRAD/TI0AISOgnzUKwT2HyHa/qsSDWeRdcgZE4XQVkeqMzQ5oJxk+CKOuDH AFi29D1f3gTfePb7/cbrh85Ts9F40FxrS3kgo3t03FTQ0qEoUPjBMs9YO8nfIZY9+ZyP Gpcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=MTmtvsfo; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12-v6si2153255pgc.515.2018.05.16.06.37.29; Wed, 16 May 2018 06:37:44 -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=bombadil.20170209 header.b=MTmtvsfo; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752573AbeEPNhL (ORCPT + 99 others); Wed, 16 May 2018 09:37:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44612 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309AbeEPNhJ (ORCPT ); Wed, 16 May 2018 09:37:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To: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=0qXxwtR3KT0Hu+FzmU9qtP/gL00lLBIFs4i8tRw/aY0=; b=MTmtvsfoM2G9I+6+PG0M4pL2Z XDdZrbLIHumrBdk8xoF9AjFKKVGU5kOwyVRb4V392yOWNoRZv72143eUuqpTRL4+ziXOmyx0IE/Uy JsaG5oLzFvU2x8LmNXfYMDFHUOhoRIDFLv4UxYoZI2tgVQ5f8Q7uGN7oxf8Y0snMEf6UvNeiQgfYE vyt+9rmAwBBEkLd9evJxig7/0YJeiAq6Rp0ci/zBFLQfOKwq0z1dTMl/4WrV0Uq91G8sd0wvGAYOW z1gS3ughvMC5yJFBXShjewKuX+5n8/D6NbUJWrT6fqBsgYZs7vW/t9auZKZH1cvfm6JPtf1gkSkrx LtTIwjclA==; Received: from 179.187.99.131.dynamic.adsl.gvt.net.br ([179.187.99.131] helo=vento.lan) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIwc2-0007OP-IF; Wed, 16 May 2018 13:37:02 +0000 Date: Wed, 16 May 2018 10:36:56 -0300 From: Mauro Carvalho Chehab To: Dan Carpenter 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: <20180516103656.208043d4@vento.lan> In-Reply-To: <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> <20180516131108.xcvsw6m4qrmqgykh@mwanda> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, 16 May 2018 16:11:08 +0300 Dan Carpenter escreveu: > 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.... Yeah, I was thinking that is would be harder to clean this up on smatch. I proposed a patch to the ML that simplifies the logic, making easier for both humans and Smatch to better understand how the arrays are indexed. > > > > 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. Thanks! Regards, Mauro