Received: by 10.192.165.148 with SMTP id m20csp3426751imm; Mon, 23 Apr 2018 06:28:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/wcA0BnSFAOzfGQW/dmGJskWX1h+blObivR+DEXawxgUPnBApbTvZibIURQyegDO5TKzGt X-Received: by 10.99.117.71 with SMTP id f7mr7940898pgn.204.1524490092355; Mon, 23 Apr 2018 06:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524490092; cv=none; d=google.com; s=arc-20160816; b=i1XRscjB1wyaUwngAwz2tNm11MKE5M73juQEHs+/REDrop2PwcytbGlrfArLJ9rq3h EDd71tE2U+tgFYljoAy6LAPMcqK1XU3/RFeYAqaEFAnKNmwQqqSY6/vtokkhGx68ABPb iiLV9zxJ6SrwXwz94slx0gONb19xwODgncaIZMoCR5J1iZ4MyuxFQ7ubSUKPBr7RCdnn ngKHWOirzrg8SrA/3JiZV6Tk61RIiFSNaWJ+5y8TmGLjDlQG3ujb6K845Q3x86Ui4l46 cUHoQD7ciMfkHtpjrvCnNbiN0dgPaFPmGWec+hhtQGGFnCEirbs6Teqi6X/cE6bqO85u e3hA== 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=jw79CUHwj1t5XXQmFlnRkKyiS1LIGSoCuMUObEirbAc=; b=WBVptPj4GmCyz5UxktYW0DOnhwsyqrMAAj6bXfycCvXQ1ho3T8LR97a0wiw1a/5hyL ZG4yKkm/dicNOs0yYPUzrTiqQJ6nQhIu3u57zmAZzO+QWKmJJ/+3hlJFxjY5H3rM6H47 21U+HRt2nR0Sjy569M5HD1n/14xvTvgivwutEIjcOHvg2Caf7ck0RvkMuXzmNGOJTrVL Poz/OweSuQKguWS9Rne9KCj25eQiKVGXf9cMsVtvND6adsD+o04HLuffI78/LgWDUWBe nX24uDyWkoAZGr+Rz+B7LdzjGrhdAWNBxlXqxQs7t64+nQ+fMma9WgyS3G2vnHbzz5Lm Im1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=avHHUAgt; 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 a17si10828814pff.43.2018.04.23.06.27.57; Mon, 23 Apr 2018 06:28: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=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=avHHUAgt; 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 S1755271AbeDWN0y (ORCPT + 99 others); Mon, 23 Apr 2018 09:26:54 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:35182 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753282AbeDWN0v (ORCPT ); Mon, 23 Apr 2018 09:26:51 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3NDGoFx120740; Mon, 23 Apr 2018 13:26:24 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=jw79CUHwj1t5XXQmFlnRkKyiS1LIGSoCuMUObEirbAc=; b=avHHUAgtY8o99WXdbH44yXU5YD5asNuQqtjzreDqmKW2Fa+Mn95yZgueSblDbzOQXr+j 94pRlP15Gtom9BcLecOcVPoSbG735I8WwBz9GwcMka74GHyH9H6uyXkAi4lJrloi//0I Cs9mO1Q+Ik6XNCUwhUbjRMniRrkTqlJRAzMGBnd05sbteYcnns1lthmoO1bWpJnrPVW2 HJ3I+uPsySVAaoivxvipWEsHZHjyoodh7GClgvp8dt0COdJ7gldr2x5nhJ8hS4VfQDKL 1sDFNMv+23+qOVtKxPEvptVtYxG+IlSP+VgIkurE4VjAgy0RiAEeZAelDqd8XcVmgAmx cw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2hfvrbn7yh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Apr 2018 13:26:24 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3NDQNIc027528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Apr 2018 13:26:23 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3NDQNXG006456; Mon, 23 Apr 2018 13:26:23 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Apr 2018 06:26:22 -0700 Date: Mon, 23 Apr 2018 16:26:13 +0300 From: Dan Carpenter To: Mark Rutland Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , "Gustavo A. R. Silva" Subject: Re: Smatch check for Spectre stuff Message-ID: <20180423132613.6bjmwtlnvmm4iu7l@mwanda> References: <20180419051510.GA21898@mwanda> <20180420124750.fgwrsyhuqd26mj34@lakrids.cambridge.arm.com> <20180423125307.fpqn5shjq3rpsyx3@mwanda> <20180423132242.iwpltjacdk3xyktf@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180423132242.iwpltjacdk3xyktf@lakrids.cambridge.arm.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8871 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-1804230138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 02:22:43PM +0100, Mark Rutland wrote: > On Mon, Apr 23, 2018 at 03:53:07PM +0300, Dan Carpenter wrote: > > On Fri, Apr 20, 2018 at 01:47:51PM +0100, Mark Rutland wrote: > > > > What the test does is it looks at array accesses where the user controls > > > > the offset. It asks "is this a read?" and have we used the > > > > array_index_nospec() macro? If the answers are yes, and no respectively > > > > then print a warning. > > > > > > > > http://repo.or.cz/smatch.git/blob/HEAD:/check_spectre.c > > > > > > I just built this and threw it at v4.17-rc1, but I'm having problems > > > with the build_kernel_data.sh step. > > > > > > I get an error: > > > > > > DBD::SQLite::db do failed: unrecognized token: "'end + strlen(" > > > " at ../smatch/smatch_scripts/../smatch_data/db/fill_db_sql.pl line 32, line 294127. > > > > > > ... in my smatch_warns.txt I see that I have the lines: > > > > > > net/netfilter/nf_conntrack_sip.c:1524 sip_help_tcp() SQL: insert or ignore into constraints (str) values('end + strlen("^M > > > ^M > > > ")'); > > > > > > ... and the corresponding line in that file is: > > > > > > for (; end + strlen("\r\n\r\n") <= dptr + datalen; end++) { > > > > > > ... so I guess there's some dodgy escaping somewhere? > > > > > > I only see a small number of potential spectre issues reported: > > > > Yeah... Sorry. I will fix that. It doesn't affect anything unless > > someone starts to add SQL injection strings to the kernel but it's not > > the right thing. > > Good to know! As long as that's not affecting the results, I'll ignore > that for now. > > As an aside, it looks like smatch_data/db/constraints_required.schema is > missing a trailing semicolon, as the other schema files have. On one of > my machines, the distro's sqlite doesn't seem happy without it. > Oops! I'll fix that. regards, dan carpenter