Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2496346ybz; Sun, 19 Apr 2020 02:48:48 -0700 (PDT) X-Google-Smtp-Source: APiQypLenTZ/psw9XtAUQ4D46glBiBBOdO1DPcb1INafOdx4SzfkdlomWCIuE8F52UElYtfXM1kG X-Received: by 2002:aa7:d68e:: with SMTP id d14mr10340091edr.78.1587289727868; Sun, 19 Apr 2020 02:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587289727; cv=none; d=google.com; s=arc-20160816; b=T9k65vWG2EJqv57Ei6GfnsyURSn1dcxPMyVR/C/KH/osBcZYse6GM0F3X5PCoLfHHt gwpyBY4kC7peWYCPq/4KJFBFiY3F9fM9ERC/c+PdTbIlM+607HOjirWLtAI+NStvkHFI 44ydU5vQMVOdPmFTYzBTwCJHg4RCpHRjpLylHm1reRDgVwuUsMA2fLOu1n9fKN8Qvd9E Geb/7DIW0gBXqjXh8Xb27EyrWNPWiBUeI548tyCEgWwfkDGbGAy0AgNmVqtcxsG8mnlo R8Dc1WamE9g6Py0DeraVHiNP5F/s64kPcvUUcIX3Rq8W9Sjpy7ar9WRLwcwUW4zZRbwl YVGg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=RaXJ481mUi0DrviGOH+SkNVnZ2LQzKruVx+D2GV8ZOM=; b=ZG9iWsM59PZuDfedFZogVeWt5UE2aSbS0+7IAeTNk1nOcn1Zwl1tBpzCY2KREcniyK QRgbLbuR9mSr671M1+eCkv72vFB+eYhnXI36U3g/U9dqgaA1MyWa+26Wt+58qe2mZcOi Eqe/bh/UWX/JMLQAqrrzllZtWVxEWUsh8GxcfKgFmc6bMHBOwPgT7PQYAlNaBx9eT6Tm xIQ9CCcVkCW9+oKdOWmEnQqhIgKl2O/NZZVEQp6hs9K9BhlXVHTgMeceKrc5umWLhwfv HW8pPqJ08F29N26xXc2/5Q3cN4hcXguyY1HedBT3rIHVi/Dy4ZYDYfeLX9yWWTZVAtJe uaFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=VOe4N8r5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si13843161edq.412.2020.04.19.02.48.24; Sun, 19 Apr 2020 02:48:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=VOe4N8r5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726011AbgDSJrH (ORCPT + 99 others); Sun, 19 Apr 2020 05:47:07 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:20269 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbgDSJrH (ORCPT ); Sun, 19 Apr 2020 05:47:07 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 494lNP3gtMz9tyDp; Sun, 19 Apr 2020 11:47:01 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=VOe4N8r5; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id WZtesNUcJGZq; Sun, 19 Apr 2020 11:47:01 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 494lNP2TXsz9tyDn; Sun, 19 Apr 2020 11:47:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1587289621; bh=RaXJ481mUi0DrviGOH+SkNVnZ2LQzKruVx+D2GV8ZOM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=VOe4N8r5t969r8fxlMuXcUxzMYzBUsuFSfUW2XhIzUu7MpXItbVhlqB095uOkgU/l lioa8xJ0ZOzk1wkoG81P1woBSK39GM50P4XzCZHwfqClIvrU37btIjyDPPuhbLnXVM otq6qm9vH2HX20sBV+snNzhRspQiy4NnvEXEK5XA= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 620498B76F; Sun, 19 Apr 2020 11:47:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id jYx07x_1XUos; Sun, 19 Apr 2020 11:47:04 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 244FD8B752; Sun, 19 Apr 2020 11:47:01 +0200 (CEST) Subject: Re: [PATCH 1/2] signal: Factor copy_siginfo_to_external32 from copy_siginfo_to_user32 To: Christoph Hellwig , "Eric W. Biederman" Cc: Arnd Bergmann , x86@kernel.org, linux-kernel@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, Jeremy Kerr References: <20200414070142.288696-1-hch@lst.de> <20200414070142.288696-3-hch@lst.de> <87pnc5akhk.fsf@x220.int.ebiederm.org> <87k12dakfx.fsf_-_@x220.int.ebiederm.org> <87v9lx3t4j.fsf@x220.int.ebiederm.org> <20200419081353.GF12222@lst.de> From: Christophe Leroy Message-ID: Date: Sun, 19 Apr 2020 11:46:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200419081353.GF12222@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 19/04/2020 à 10:13, Christoph Hellwig a écrit : > On Sat, Apr 18, 2020 at 06:55:56AM -0500, Eric W. Biederman wrote: >>> Is that really an issue to use that set_fs() in the coredump code ? >> >> Using set_fs() is pretty bad and something that we would like to remove >> from the kernel entirely. The fewer instances of set_fs() we have the >> better. >> >> I forget all of the details but set_fs() is both a type violation and an >> attack point when people are attacking the kernel. The existence of >> set_fs() requires somethings that should be constants to be variables. >> Something about that means that our current code is difficult to protect >> from spectre style vulnerabilities. > > Yes, set_fs requires variable based address checking in the uaccess > routines for architectures with a shared address space, or even entirely > different code for architectures with separate kernel and user address > spaces. My plan is to hopefully kill set_fs in its current form a few > merge windows down the road. We'll probably still need some form of > it to e.g. mark a thread as kernel thread vs also being able to execute > user code, but it will be much ore limited than before, called from very > few places and actually be a no-op for many architectures. > Oh nice. Some time ago I proposed a patch to change set_fs() to a flip/flop flag based logic, see https://patchwork.ozlabs.org/project/linuxppc-dev/patch/dd2876b808ea38eb7b7f760ecd6ce06096c61fb5.1580295551.git.christophe.leroy@c-s.fr/ But if we manage to get rid of it completely, that's even better.