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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 08FC7C43331 for ; Fri, 3 Apr 2020 17:27:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75A13206F5 for ; Fri, 3 Apr 2020 17:27:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75A13206F5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D3F7C8E0008; Fri, 3 Apr 2020 13:27:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEF7A8E0007; Fri, 3 Apr 2020 13:27:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDDBB8E0008; Fri, 3 Apr 2020 13:27:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id A28DA8E0007 for ; Fri, 3 Apr 2020 13:27:39 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5FCC8180AD81A for ; Fri, 3 Apr 2020 17:27:39 +0000 (UTC) X-FDA: 76667225838.21.legs93_7ce8843a03630 X-HE-Tag: legs93_7ce8843a03630 X-Filterd-Recvd-Size: 3081 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Apr 2020 17:27:37 +0000 (UTC) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKQ5j-009k01-D3; Fri, 03 Apr 2020 17:26:51 +0000 Date: Fri, 3 Apr 2020 18:26:51 +0100 From: Al Viro To: Russell King - ARM Linux admin Cc: Catalin Marinas , Kees Cook , Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , airlied@linux.ie, daniel@ffwll.ch, torvalds@linux-foundation.org, akpm@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Christian Borntraeger Subject: Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end Message-ID: <20200403172651.GJ23230@ZenIV.linux.org.uk> References: <27106d62fdbd4ffb47796236050e418131cb837f.1585811416.git.christophe.leroy@c-s.fr> <20200402162942.GG23230@ZenIV.linux.org.uk> <67e21b65-0e2d-7ca5-7518-cec1b7abc46c@c-s.fr> <20200402175032.GH23230@ZenIV.linux.org.uk> <202004021132.813F8E88@keescook> <20200403005831.GI23230@ZenIV.linux.org.uk> <20200403112609.GB26633@mbp> <20200403133719.GC25745@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200403133719.GC25745@shell.armlinux.org.uk> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Apr 03, 2020 at 02:37:19PM +0100, Russell King - ARM Linux admin wrote: > > I think uaccess_enable() could indeed switch the kernel domain if > > KERNEL_DS is set and move this out of set_fs(). It would reduce the > > window the kernel domain permissions are overridden. Anyway, > > uaccess_enable() appeared much later on arm when Russell introduced PAN > > (SMAP) like support by switching the user domain. > > Yes, that would be a possibility. Another possibility would be to > eliminate as much usage of KERNEL_DS as possible That's definitely worth doing, but that's another long-term project ;-/ > - I've just found > one instance in sys_oabi-compat.c that can be eliminated (epoll_ctl) > but there's several there that can't with the current code structure, > and re-coding the contents of some fs/* functions to work around that > is a very bad idea. If there's some scope for rejigging some of the > fs/* code, it may be possible to elimate some other cases in there. Well, your do_locks() definitely can be converted. epoll_wait()... not sure, need to look into that. Is that about the layout mismatch between struct oabi_epoll_event and struct epoll_event? In case of semtimedop... Hell knows, I would probably consider moving that thing into ipc/sem.c under ifdef...