Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2638278pxk; Sun, 20 Sep 2020 11:13:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBXwd08xzcLovT5dQWQ6UHQwzR7CxxvHcBKYkOoOy76qyoDGQGaNsNk86PlOfXiP5/O59D X-Received: by 2002:a05:6402:3075:: with SMTP id bs21mr49374129edb.236.1600625622275; Sun, 20 Sep 2020 11:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600625622; cv=none; d=google.com; s=arc-20160816; b=lk7hRk4hdyqtPAlcEHHt9yzLZhVUj6YrUKqHtJCPgNvRRvmOV2r0rjz3tT5NTQT80+ nm3xOlOtBTD4vhdAYPV3MVjGqFP1gnRf2EsBW8cHwGmWPoqLJehFkaPZl2QTGt9LWH6m eBvMQf9vO0InJSFH4ocOmTJ0MyCX8QfAhyX7Qr6Cf9w/SxaT4AfIr5H/q3foopqbMVDQ O/9azSpd6z5+lF+QtHH2nwmYSNTcM+59QaqVGdd66vEbYXy/XKbcL7etreVbfhn1k1En FFnoSRaQmWUHrifFf+cbkBfeYRfR8d4ToiAJpHNxmXnXZoKiCc+kMMCijrbFZcT3Supv 32Dg== 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=NfSZMqFaE6Osc6g3JRNxFgMFJcLCPUPpMrXpO3yglio=; b=cEZ6ER9ujxJtBDEPGeUsiLmHGayE2CvWuOGcLYM6MKK7RzhST8DJ6g0aKmNfIKlQan xpXEn4BUPjExf0RbG/ZVK1uqeQzDhLZw3q2OwxpTC4MPpY/Qad92DfSyqAeL9bZ9lxA8 8TJfP+7H300Kam8XbH73jUGxAj2AWLrbqQYbna1gotsloEjHfMR+2+Nt5Vya221sVc02 TynPc4Ajul20715M10bAXJ8s4Kh2XhjJzOVBeYSbkTv7qSv/KiELluDhouCKzSr6l/iX rHMHwsUpf5x1IHaYRX8RVMEV0beuTDjPPlxn/cTvqNCfe3sELVyM3v47kXuB+kjeVEtm ScEQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d20si6850127edn.317.2020.09.20.11.13.19; Sun, 20 Sep 2020 11:13:42 -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; 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 S1726405AbgITSMS (ORCPT + 99 others); Sun, 20 Sep 2020 14:12:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbgITSMP (ORCPT ); Sun, 20 Sep 2020 14:12:15 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43F1C061755; Sun, 20 Sep 2020 11:12:14 -0700 (PDT) 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: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.