From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D58FEC43461 for ; Thu, 3 Sep 2020 23:28:21 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33D212078E for ; Thu, 3 Sep 2020 23:28:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="gWGJKo5x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33D212078E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BjH6p5NrbzDrGp for ; Fri, 4 Sep 2020 09:28:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=2a00:1450:4864:20::243; helo=mail-lj1-x243.google.com; envelope-from=torvalds@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=google header.b=gWGJKo5x; dkim-atps=neutral Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BjH4V52lMzDqvx for ; Fri, 4 Sep 2020 09:26:18 +1000 (AEST) Received: by mail-lj1-x243.google.com with SMTP id a15so5822613ljk.2 for ; Thu, 03 Sep 2020 16:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eoc+5mie1+ZuNTuaPcGzSI2qJ6owz7A4Ofr10ghZJJ4=; b=gWGJKo5xiJNWPTtwqGkQlOlOwg3GjNMHWAbbLf6G2umLeN+ziH7HLU4o7mqfu6xrQX 0nqy/1qDWFPlTHlbUl4hIrosGA73uytx27UrMGezo0ol7EOlqSXT8KqCo6mWmcDs1cwA at576v5S6IW6A1SwuGUswjPYeT1mwL3S6Pfko= 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; bh=eoc+5mie1+ZuNTuaPcGzSI2qJ6owz7A4Ofr10ghZJJ4=; b=W9hGrOtK2w1LaWyBzvJt+PHktiGdfWA7+VvgGoSs7uO+Gr6wf2XyPyT4cvrXNNxDFU uf7fekPwPIAM4SakO83GlFx+cGBEZJLDAs9MbKXUlMm1orWassCqjHt1Jb5nSxvA/4wE wS2tsGC9TpJMKSA395uNUgcWAZC7MqFWWdeiG1eo5ph4uu7mZ5knY5/tAVECJL1AZpxu tE9dO4phr5ntLH3Ua6nOeuZ4KaHsJ76RoHtw1WkhFF2xQifoJEXrFMq9VtxSJeIP9AtK 4aNjGJbnPQQ/FKnD3rF4OJyKSG0G7JhKDz/EhQOPuLliNEG9zckMiYvYWpxLu9I4RB77 KQVQ== X-Gm-Message-State: AOAM5310GiiWFtPY9AatNz4fNicO5PKHWbAn2b3HnGVCX2ug576H/zUH HyisTKIkVQ4+9/Hm+qbdAYdEtZPO1/ufiA== X-Google-Smtp-Source: ABdhPJwggO17z7Xfzf0SYlT1zM7YCf2AMTnsr6OcVHjVAzjT4VsGxssVLM58CrjaS4dVgbd6AQ27dQ== X-Received: by 2002:a2e:8193:: with SMTP id e19mr2663305ljg.80.1599175572693; Thu, 03 Sep 2020 16:26:12 -0700 (PDT) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id t5sm881761ljg.111.2020.09.03.16.26.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Sep 2020 16:26:11 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id z19so2862489lfr.4 for ; Thu, 03 Sep 2020 16:26:10 -0700 (PDT) X-Received: by 2002:a19:4a88:: with SMTP id x130mr2429205lfa.31.1599175570612; Thu, 03 Sep 2020 16:26:10 -0700 (PDT) MIME-Version: 1.0 References: <20200903142242.925828-1-hch@lst.de> <20200903142242.925828-13-hch@lst.de> <9ab40244a2164f7db2ff0c1d23ab59a0@AcuMS.aculab.com> In-Reply-To: <9ab40244a2164f7db2ff0c1d23ab59a0@AcuMS.aculab.com> From: Linus Torvalds Date: Thu, 3 Sep 2020 16:25:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 12/14] x86: remove address space overrides using set_fs() To: David Laight Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arch@vger.kernel.org" , Kees Cook , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Luis Chamberlain , Al Viro , "linux-fsdevel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , Alexey Dobriyan Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Sep 3, 2020 at 2:30 PM David Laight wrote: > > A non-canonical (is that the right term) address between the highest > valid user address and the lowest valid kernel address (7ffe to fffe?) > will fault anyway. Yes. But we actually warn against that fault, because it's been a good way to catch places that didn't use the proper "access_ok()" pattern. See ex_handler_uaccess() and the WARN_ONCE(trapnr == X86_TRAP_GP, "General protection fault in user access. Non-canonical address?"); warning. It's been good for randomized testing - a missing range check on a user address will often hit this. Of course, you should never see it in real life (and hopefully not in testing either any more). But belt-and-suspenders.. Linus