Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp732682ybb; Fri, 3 Apr 2020 10:47:30 -0700 (PDT) X-Google-Smtp-Source: APiQypLa4D2c/ulrx5MU4Xk74+ZH5+V0MQTqsjlBcbtGjtpSMBxDcywdzZhGsSGMarvyWJYYVwB5 X-Received: by 2002:aca:5208:: with SMTP id g8mr3734650oib.169.1585936049858; Fri, 03 Apr 2020 10:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585936049; cv=none; d=google.com; s=arc-20160816; b=un5ChS51lkHDHhQWAp26Ed0ve8y6U4gv0byPlxfPF2QYt82jI6z1IPTT5UGc36v9Br cXvhopwSv0nSb57LrjZ3ZV/O+F88bYi8HknHvS6fWulqMImDoQ0Gn1zKQRhPQY5nngem gIpedbau0TuMljXDMUlwZr6AFBw8Y2ODzbHmSPJ4VyIekEb1mD00m4hcK39FBe3Ho6sX Zg/1rnQkAr1yiXCr9g95vIqQLohgYPkgBIH8N6VH/LV1nQ5jaeGdIJn16810PJnLVrFS 0Bq87cATDQBMQ+0WenyPkYizVV9/SOBvCqbVAwowFLk62O2q1RgbIY436nLz363+muQ+ jeeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=w55D/fg68LfPyA++qFaZcO5NfXN8nqsA4pUUcuHHKsY=; b=XFj5bLT8ieQ8ME7CRRY5p6MC6pnA+3tM1/Mh+wFc5uTPJLtIZIgDggg5Ame/HE8KV0 xBKqKo0/xPJd1hC2x2KF7wMnqtqUF0UEferYOVHrizno/1YOrZ9LX2NEGkj8Dc4oWjqa Y6EMx3S1pzhH35hl2yw0ONCeo/yd3r+04xYEvWpVxq5lsfSnPmoY7fVD09KZ0/CsJivf bdnM0yGlPtm6T1YP4d4194m8peALDTFquDQYMJZsTbfy4S23yoh+cnSUZ3Suw5cEuZdX WDi2NNqQr8AEQMeIIFYRQiSL9fUw7cHuwNdPdYWRMPf/cfy11unWvlCzSOPIuGTuMx8K Hd4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w73si3996211oiw.206.2020.04.03.10.47.16; Fri, 03 Apr 2020 10:47:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404295AbgDCR1e (ORCPT + 99 others); Fri, 3 Apr 2020 13:27:34 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:37964 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727167AbgDCR1e (ORCPT ); Fri, 3 Apr 2020 13:27:34 -0400 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...