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, 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 98952C43465 for ; Sun, 20 Sep 2020 18:12:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 325A3207EA for ; Sun, 20 Sep 2020 18:12:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 325A3207EA 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 6989090000B; Sun, 20 Sep 2020 14:12:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 67011900009; Sun, 20 Sep 2020 14:12:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5376690000B; Sun, 20 Sep 2020 14:12:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0002.hostedemail.com [216.40.44.2]) by kanga.kvack.org (Postfix) with ESMTP id 3818D900009 for ; Sun, 20 Sep 2020 14:12:17 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ED7253629 for ; Sun, 20 Sep 2020 18:12:16 +0000 (UTC) X-FDA: 77284234272.27.soap06_05114ea2713e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id CD28A3D663; Sun, 20 Sep 2020 18:12:16 +0000 (UTC) X-HE-Tag: soap06_05114ea2713e X-Filterd-Recvd-Size: 3219 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by imf19.hostedemail.com (Postfix) with ESMTP; Sun, 20 Sep 2020 18:12:16 +0000 (UTC) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kK3om-002bUn-Fx; Sun, 20 Sep 2020 18:12:08 +0000 Date: Sun, 20 Sep 2020 19:12:08 +0100 From: Al Viro To: Andy Lutomirski Cc: Christoph Hellwig , Andrew Morton , Jens Axboe , Arnd Bergmann , David Howells , linux-arm-kernel , X86 ML , LKML , "open list:MIPS" , Parisc List , linuxppc-dev , linux-s390 , sparclinux , linux-block , Linux SCSI List , Linux FS Devel , linux-aio , io-uring@vger.kernel.org, linux-arch , Linux-MM , Network Development , keyrings@vger.kernel.org, LSM List Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag Message-ID: <20200920181208.GO3421308@ZenIV.linux.org.uk> References: <20200919224122.GJ3421308@ZenIV.linux.org.uk> <36CF3DE7-7B4B-41FD-9818-FDF8A5B440FB@amacapital.net> <20200919232411.GK3421308@ZenIV.linux.org.uk> <20200920025745.GL3421308@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sun, Sep 20, 2020 at 09:59:36AM -0700, Andy Lutomirski wrote: > As one example, look at __sys_setsockopt(). It's called for the > native and compat versions, and it contains an in_compat_syscall() > check. (This particularly check looks dubious to me, but that's > another story.) If this were to be done with equivalent semantics > without a separate COMPAT_DEFINE_SYSCALL and without > in_compat_syscall(), there would need to be some indication as to > whether this is compat or native setsockopt. There are other > setsockopt implementations in the net stack with more > legitimate-seeming uses of in_compat_syscall() that would need some > other mechanism if in_compat_syscall() were to go away. > > setsockopt is (I hope!) out of scope for io_uring, but the situation > isn't fundamentally different from read and write. Except that setsockopt() had that crap very widespread; for read() and write() those are very rare exceptions. Andy, please RTFS. Or dig through archives. The situation with setsockopt() is *NOT* a good thing - it's (probably) the least of the evils. The last thing we need is making that the norm.