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=-6.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 32CADC433DF for ; Tue, 18 Aug 2020 19:46:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02D0420786 for ; Tue, 18 Aug 2020 19:46:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TRDwzjpv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbgHRTqp (ORCPT ); Tue, 18 Aug 2020 15:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbgHRTqn (ORCPT ); Tue, 18 Aug 2020 15:46:43 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAFE0C061389 for ; Tue, 18 Aug 2020 12:46:43 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id s14so3733834plp.4 for ; Tue, 18 Aug 2020 12:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ylBQHIGj+jC+wMGAW+WiPoCXXWUQK9WgH6fcVkJtSBg=; b=TRDwzjpv9nxBnOSNPospJ+g2+lM26x7LrfAWZDm2gvCsnlrIhyGQMvVZ+nN+hu7WkX O/oo+OEjbZ2O9PmpH/HltGohEtaT4mQAuhz2mTIFpqD9eXrS0bAzADnlvGV+CZhjlU6D 56u72kcTdOBo0I+2qXN79Jwyll3yLdhk3jnEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ylBQHIGj+jC+wMGAW+WiPoCXXWUQK9WgH6fcVkJtSBg=; b=Wib92TExi3EbHdlBLKCuhrG5Q9ZnjuJO9rtm4pHVgagusgcP5SKiEq49ATp6fcpQxi 1WMP5fDPuZbQzcxC5W23dtqyiABm8zi8qUMYSICossjwZyDo0qnVCNj66Ef1VZvDojCY XUuTgmrh5TfesWF41j6gcsgrayaU7RyyfrfDt1dm/UL/xyxQB0rGZ9LDqVE1H8D33pEP 9pFj10kg/VLN0Iqa3yXIVD578DMisEk0VPzim0WzRyHElVqnZ8tLBZP6w2HtpvPdrJiL DX4yMfXVcxU4oKp8PTV67hy0b25Z1H3WVLMtMme2gYeGkFPrUJ+k64cqxq5dT2+fwQPv 6l6g== X-Gm-Message-State: AOAM532D1amxKKbsYn+gwmdHiLr1ZFkkqKOG9IzOFN99obK8NmgwV0a4 cHi9diZycw5PqfUnKFYdcNm0jh1v9PiaCw== X-Google-Smtp-Source: ABdhPJxQpoCNUK9oxMIJWJCcBhsLXV3qhwZ1vk6NlnSPUfnJzoewH/BG+Ra1OO11qvGzKQ2Um0GcDw== X-Received: by 2002:a17:90b:148b:: with SMTP id js11mr1261981pjb.234.1597780003259; Tue, 18 Aug 2020 12:46:43 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j5sm25754806pfg.80.2020.08.18.12.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 12:46:42 -0700 (PDT) Date: Tue, 18 Aug 2020 12:46:41 -0700 From: Kees Cook To: Christoph Hellwig Cc: Al Viro , Michael Ellerman , x86@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 09/11] x86: remove address space overrides using set_fs() Message-ID: <202008181246.A03BB9CEA@keescook> References: <20200817073212.830069-1-hch@lst.de> <20200817073212.830069-10-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200817073212.830069-10-hch@lst.de> Sender: linux-arch-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Mon, Aug 17, 2020 at 09:32:10AM +0200, Christoph Hellwig wrote: > Stop providing the possibility to override the address space using > set_fs() now that there is no need for that any more. To properly > handle the TASK_SIZE_MAX checking for 4 vs 5-level page tables on > x86 a new alternative is introduced, which just like the one in > entry_64.S has to use the hardcoded virtual address bits to escape > the fact that TASK_SIZE_MAX isn't actually a constant when 5-level > page tables are enabled. > > Signed-off-by: Christoph Hellwig Awesome. :) Reviewed-by: Kees Cook -- Kees Cook 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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 53FC8C433E1 for ; Tue, 18 Aug 2020 19:50:52 +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 DB634205CB for ; Tue, 18 Aug 2020 19:50:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TRDwzjpv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB634205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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 4BWM3F1fSqzDqXw for ; Wed, 19 Aug 2020 05:50:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::644; helo=mail-pl1-x644.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TRDwzjpv; dkim-atps=neutral Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (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 4BWLyb0sqbzDqcl for ; Wed, 19 Aug 2020 05:46:46 +1000 (AEST) Received: by mail-pl1-x644.google.com with SMTP id f10so9693721plj.8 for ; Tue, 18 Aug 2020 12:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ylBQHIGj+jC+wMGAW+WiPoCXXWUQK9WgH6fcVkJtSBg=; b=TRDwzjpv9nxBnOSNPospJ+g2+lM26x7LrfAWZDm2gvCsnlrIhyGQMvVZ+nN+hu7WkX O/oo+OEjbZ2O9PmpH/HltGohEtaT4mQAuhz2mTIFpqD9eXrS0bAzADnlvGV+CZhjlU6D 56u72kcTdOBo0I+2qXN79Jwyll3yLdhk3jnEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ylBQHIGj+jC+wMGAW+WiPoCXXWUQK9WgH6fcVkJtSBg=; b=JWNdVbNhLiC7Hreq4/RCVcqSLGZwJayiBug06ZwbSjfcXoVpn8pCY1d50guufAC5Qs p4vJIDhIfFOC91I+YUvOxvjf7pf3uXC1bVhbwc75Q9Vc8lfFUOHrNLH0jV5eSUmtWNeY oyVcZAibaOLblG7Qaie8IzYqY7i7DUBcX+A55am9Wn6Z0sKL64BwReLBbBAlIyQIyxBT Tu7wkFHPxq7AZz1aBcWluQ1D2P4ePrMiX3VKbxEyZ5ba4rVQcJzZ3ezswPivzcAKHwPh hwt1MgHnRVRAuz1U5XW7lRYf8TVSepOBnUNu9FXMpxsOFRn5nhtQ1GvF+VucJY7sroLy EjOw== X-Gm-Message-State: AOAM532fLJdY8Q0UZtUh1wHrwaK2BoerRIoF9VlCM9utUTiS4bd4Rbh/ 8yxMJ1oJJn7zSwl9QVvwjL4mhA== X-Google-Smtp-Source: ABdhPJxQpoCNUK9oxMIJWJCcBhsLXV3qhwZ1vk6NlnSPUfnJzoewH/BG+Ra1OO11qvGzKQ2Um0GcDw== X-Received: by 2002:a17:90b:148b:: with SMTP id js11mr1261981pjb.234.1597780003259; Tue, 18 Aug 2020 12:46:43 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j5sm25754806pfg.80.2020.08.18.12.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 12:46:42 -0700 (PDT) Date: Tue, 18 Aug 2020 12:46:41 -0700 From: Kees Cook To: Christoph Hellwig Subject: Re: [PATCH 09/11] x86: remove address space overrides using set_fs() Message-ID: <202008181246.A03BB9CEA@keescook> References: <20200817073212.830069-1-hch@lst.de> <20200817073212.830069-10-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200817073212.830069-10-hch@lst.de> 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, x86@kernel.org, linux-kernel@vger.kernel.org, Al Viro , linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Aug 17, 2020 at 09:32:10AM +0200, Christoph Hellwig wrote: > Stop providing the possibility to override the address space using > set_fs() now that there is no need for that any more. To properly > handle the TASK_SIZE_MAX checking for 4 vs 5-level page tables on > x86 a new alternative is introduced, which just like the one in > entry_64.S has to use the hardcoded virtual address bits to escape > the fact that TASK_SIZE_MAX isn't actually a constant when 5-level > page tables are enabled. > > Signed-off-by: Christoph Hellwig Awesome. :) Reviewed-by: Kees Cook -- Kees Cook