Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402AbeAGBU6 (ORCPT + 1 other); Sat, 6 Jan 2018 20:20:58 -0500 Received: from mail-io0-f173.google.com ([209.85.223.173]:37412 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbeAGBUy (ORCPT ); Sat, 6 Jan 2018 20:20:54 -0500 X-Google-Smtp-Source: ACJfBotkB3+y4HVjDq2nxjy2QG28RFhKE3yihOpi5d6wTG9MYGS4vHku0nneh/Ug4q7rSiG7TUaOGvHxEdcXTq4jKQo= MIME-Version: 1.0 In-Reply-To: References: <151520099201.32271.4677179499894422956.stgit@dwillia2-desk3.amr.corp.intel.com> <151520102670.32271.8447983009852138826.stgit@dwillia2-desk3.amr.corp.intel.com> From: Linus Torvalds Date: Sat, 6 Jan 2018 17:20:52 -0800 X-Google-Sender-Auth: T1KrPp1UvvQLBOioNiJJThNfe6A Message-ID: Subject: Re: [PATCH 06/18] x86, barrier: stop speculation for failed access_ok To: Dan Williams Cc: Linux Kernel Mailing List , linux-arch@vger.kernel.org, Andi Kleen , Arnd Bergmann , Greg Kroah-Hartman , Peter Zijlstra , Network Development , "the arch/x86 maintainers" , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Alan Cox Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sat, Jan 6, 2018 at 3:31 PM, Dan Williams wrote: > > I assume if we put this in uaccess_begin() we also need audit for > paths that use access_ok but don't do on to call uaccess_begin()? A > quick glance shows a few places where we are open coding the stac(). > Perhaps land the lfence in stac() directly? Yeah, we should put it in uaccess_begin(), and in the actual user accessor helpers that do stac. Some of them probably should be changed to use uaccess_begin() instead while at it. One question for the CPU people: do we actually care and need to do this for things that might *write* to something? The speculative write obviously is killed, but does it perhaps bring in a cacheline even when killed? Because maybe we don't need the lfence in put_user(), only in get_user()? Linus