Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp943521imm; Fri, 12 Oct 2018 09:08:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV61WmHB03n0TsbZWVyIPb8Z9txWA+iovK7JSM3hsgD7fztct/aDcQVkrdKuEN5cxjqSkA0Wj X-Received: by 2002:a63:2f81:: with SMTP id v123-v6mr5848524pgv.223.1539360533417; Fri, 12 Oct 2018 09:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539360533; cv=none; d=google.com; s=arc-20160816; b=TMDCdhrZ+sSLhGpNXqbBBBQNav42haKTSj83tOq9+7PJzv/0bZF6Sr6bsJBwvFgsPG 2fPGy53O3WsPvn+7BKnTHR4xFXerbD4/xAAL0Vrt9icmLSARm8irQ2aFwfOzlvBpQHS9 9y3yE1VCKz338+rYYjJT5nD3KsnkD8seob9Z0Dx/R74VyG0km4O7MzizODXLnVmXbhmB hJ9zRiDIYMjZGXpwstaQYJwTRipdmJ5hvzohthMoPZRVxgLsxxRuNuL5O/Lb1l4ncfrW XX5cH9G0N4tpvYu+ZvllJR9a4FdsxTB8qN5puFufLrkGQZSPJoZyGvnKZupp9tNAgGXL GqFA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hxVCU92OitQCJUgR7B289FyKRi8LK32Fk8IRZIRsdhk=; b=aFuisAsiRBv9LkVY8M5zRRzh8R81+3v9Ut0YkET9wV+X79WZKpskK830m8+Gts64qm +5/5gpMvkVFapJ6gc1aboqAwQVh88KLmIVuEHW5hBnAd1zYlqCfk1KyPDGapOgOE/QHe sxfLAo8SGqx27C04A4+s9d5dOsdfw4WbRpSHVtaD1R7ON7ezLoOTJMGNMKpAJKNReouY nRYIwJaM2dR13kBuphTMl0Gn3iKLdEbJXJ5wnSYnxNRxx/CzLnsYnehfbl1uiOhcE7bz vr91Yt12twN87ZO8hVZtAyI/7gGgLWHpy+XU5RdiAeTWrei3xR3D+TrNXtYiPx3xYgK8 xDSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=2LYV6ybb; 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 a32-v6si1577732pgm.24.2018.10.12.09.08.37; Fri, 12 Oct 2018 09:08:53 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=2LYV6ybb; 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 S1728815AbeJLXlD (ORCPT + 99 others); Fri, 12 Oct 2018 19:41:03 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:33248 "EHLO mail-wr1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728694AbeJLXlC (ORCPT ); Fri, 12 Oct 2018 19:41:02 -0400 Received: by mail-wr1-f50.google.com with SMTP id e4-v6so14027430wrs.0 for ; Fri, 12 Oct 2018 09:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hxVCU92OitQCJUgR7B289FyKRi8LK32Fk8IRZIRsdhk=; b=2LYV6ybbHGeDf85x1+ZqEg9lgGQP450EAbbtT+EPR+JtREaFtxlEL9FMbeV3kBltPr 54N1yUer7PgplVHBkWEQHJlK7+BgAraj5lVHdOct0V/LSIDzP0aRi4pIH1DO5OxNKCZ/ RjTMerON8x9vG3o6QBfThfos/Kt67fD39j2O0nybAKBVmp4VXLaO7Nf7va8XgJSHBmUl L4kTcL0eyBrh4452E77lPEX214bIj47K8P1ldCkgdY4NU2mojWNbDj6qHSWrtFfPstSV 7tcU6jQb29Vo7vsnBVe7q6QzjMUPvMxDsqX7da4M+3VNsz9SWaxvweoKMjSXm10TxNbS j34Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hxVCU92OitQCJUgR7B289FyKRi8LK32Fk8IRZIRsdhk=; b=BDwV1VpKHkKPQHTYiO5+KpgNCtRrujf/lH9UFw9Tw3X1lRBNWMLLHGZrkv5CDMWoax OheoVOlGhU3MtNz+vWkK0/lXUDAbS8ONPVd5N0obFwAsI8E8KcwVYnCBJr10AN4W+5P+ neok8eXLAPUhd8i9sayjkFur948hb3RHRafDgDeyynA7johp1brP5Jz+NCliSnJ7CHTn 3s4HJvMSF6XaUq2wdDddjOIlvtU9UepTbndH0es7micYkWmy07XHTKreSiH7vslTfOsW fCVTIwpHUjN9wDPphml5T2hNYUoiFJyVfzetEzu2uRiLWTtgAr4ix193An1EjCIpQY9i keNg== X-Gm-Message-State: ABuFfoiYTUz2XRJ3GgnZ6DkK0c8+T/YVPlb1unvoBbJdyi/oF2d7b6M5 PCjysOXyo0gQ13zsreKx2jZ83o6lxBRdP2ekDEeCFA== X-Received: by 2002:adf:82e3:: with SMTP id 90-v6mr5572787wrc.131.1539360470691; Fri, 12 Oct 2018 09:07:50 -0700 (PDT) MIME-Version: 1.0 References: <20181011185458.10186-1-kristen@linux.intel.com> <20181012152515.1d816906@alans-desktop> <77F59E25-5244-4CBC-A3CB-DCF863803CD2@amacapital.net> <20181012160219.7d16ef59@alans-desktop> In-Reply-To: <20181012160219.7d16ef59@alans-desktop> From: Andy Lutomirski Date: Fri, 12 Oct 2018 09:07:39 -0700 Message-ID: Subject: Re: [PATCH] x86: entry: flush the cache if syscall error To: One Thousand Gnomes Cc: Andrew Lutomirski , Kees Cook , Kristen Carlson Accardi , Kernel Hardening , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 8:02 AM Alan Cox wrote= : > > > My understanding is that the standard =E2=80=9Cbreadcrumb=E2=80=9D is t= hat a cache line is fetched into L1D, and that the cacheline in question wi= ll go into L1D even if it was previously not cached at all. So flushing L1D= will cause the timing from a probe to be different, but the breadcrumb is = still there, and the attack will still work. > > Flush not write back. The L1D is empty (or full of other stuff the way > the prototype I tested did it as x86 lacked a true L1 flushing primitive) I'm not sure I follow what you're saying. If an attacker is learning some information based on whether a given cacheline is in L1D, I'm asking why the attacker can't learn exactly the same information based on whether the cache line is in L2. Or using any of the other variants that Jann is talking about. Adding ~1600 cycles plus the slowdown due to the fact that the cache got flushed to a code path that we hope isn't hot to mitigate one particular means of exploiting potential bugs seems a bit dubious to me.