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,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 307A4C433DB for ; Sat, 19 Sep 2020 22:53:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B7E0222BB for ; Sat, 19 Sep 2020 22:53:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=amacapital-net.20150623.gappssmtp.com header.i=@amacapital-net.20150623.gappssmtp.com header.b="JqRJRr8p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B7E0222BB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D20056B0037; Sat, 19 Sep 2020 18:53:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA9BA6B0055; Sat, 19 Sep 2020 18:53:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B47FC8E0001; Sat, 19 Sep 2020 18:53:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 8DA216B0055 for ; Sat, 19 Sep 2020 18:53:45 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 48CAD8249980 for ; Sat, 19 Sep 2020 22:53:45 +0000 (UTC) X-FDA: 77281314810.08.light95_5514cfa27137 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 210661819E798 for ; Sat, 19 Sep 2020 22:53:45 +0000 (UTC) X-HE-Tag: light95_5514cfa27137 X-Filterd-Recvd-Size: 5470 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Sat, 19 Sep 2020 22:53:44 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id gf14so4934025pjb.5 for ; Sat, 19 Sep 2020 15:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:subject:mime-version:from:in-reply-to:cc :date:message-id:references:to; bh=OiG9AhNV/aYytBLvfrNKs+OEikcE/xFc3qwTD8LXQak=; b=JqRJRr8pAqbUpB6Z8cyMrJ9xHdq76J9quA0nLvKh3ZCmreRApMtVEKJrUh1+iYF6JM j7I4CbitDi/hbJxI3A0yUx65zzxj+9OuhhpvKck/wUnRBF7EuGclsOL0nDYDl8Jf5W94 LKjbYdiN8NQkyPDzWNzRWKhhUpI5BiYKfIYVYjgQr06v6tspjh4Kfljk2gKaOIdeu1AS kmjSb7FfVExI6FATCE4tuWlmlbDYHr+Rf4lm9eioaoVVJRTCo1VHPqqwu78Yo7heUEN2 jwKtRhH+4KJ2y45vqwGsl3R+5jHCVoZnWHE5+MXw1OCY8mxZ6/yyA8kWQtdSX7UdFXP9 eHrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:subject:mime-version :from:in-reply-to:cc:date:message-id:references:to; bh=OiG9AhNV/aYytBLvfrNKs+OEikcE/xFc3qwTD8LXQak=; b=GzXm8CZ5t2+e9v8OTvaWUW/37Dc+YRDmkYlub7XBkjgo/U7ZaRNcuCvpmGzKH0ccLB Xg94E3cBU4ftFiCryyY4jZqy+Jc2SzSR7HJUZyenCANMb5zSInTS0b/4jYig1o4KOZGl p8W6OfCcGn66T8KSsY5YyJmFrGhBtLU/QeW5VTOGTSCLeZtmeZQ92904KoFlodK/OYfp jzBSiULEhgj835Eb390IDlJyBF/3+QrdocIjUegtV6yJB5BP3o5dNtdmJSRJE33gHOrP AVTQmlA/mdjO0Bu/oY6nU1ItzKjrszz7Rstc1W0Gt6lGlj16oZ0hrcd6c3N0F2IlmBT9 N09g== X-Gm-Message-State: AOAM5325E16eYkD+B+9Y+pePE+JuWDiN3W4xpR838YOVJLK06syIFpmW dDLSfD9lTWEI9JE1LVlxgNR5kw== X-Google-Smtp-Source: ABdhPJz6oUPJzoZ809X6It3WeC+2ZvOV1G+Wm8aqeVVuTi4tgGB6DMhswwyVupUYmjfKPmBsWvoOLQ== X-Received: by 2002:a17:90b:4ac2:: with SMTP id mh2mr17372330pjb.210.1600556023735; Sat, 19 Sep 2020 15:53:43 -0700 (PDT) Received: from localhost.localdomain ([2600:1010:b017:20a:100a:bebe:fad7:f7f9]) by smtp.gmail.com with ESMTPSA id n9sm7688488pfu.163.2020.09.19.15.53.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Sep 2020 15:53:43 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag Mime-Version: 1.0 (1.0) X-Apple-Notify-Thread: NO X-Universally-Unique-Identifier: E3EC9A91-0DBF-46AE-A57B-AC669BA7C6D0 From: Andy Lutomirski In-Reply-To: <20200919224122.GJ3421308@ZenIV.linux.org.uk> Cc: Christoph Hellwig , Andrew Morton , Jens Axboe , Arnd Bergmann , David Howells , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Date: Sat, 19 Sep 2020 15:53:40 -0700 X-Apple-Message-Smime-Encrypt: NO Message-Id: <36CF3DE7-7B4B-41FD-9818-FDF8A5B440FB@amacapital.net> References: <20200919224122.GJ3421308@ZenIV.linux.org.uk> To: Al Viro X-Mailer: iPhone Mail (18A373) 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 Sep 19, 2020, at 3:41 PM, Al Viro wrote: >=20 > =EF=BB=BFOn Sat, Sep 19, 2020 at 03:23:54PM -0700, Andy Lutomirski wrote: >>=20 >>>> On Sep 19, 2020, at 3:09 PM, Al Viro wrote: >>>=20 >>> =EF=BB=BFOn Fri, Sep 18, 2020 at 05:16:15PM +0200, Christoph Hellwig wro= te: >>>>> On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: >>>>> Said that, why not provide a variant that would take an explicit >>>>> "is it compat" argument and use it there? And have the normal >>>>> one pass in_compat_syscall() to that... >>>>=20 >>>> That would help to not introduce a regression with this series yes. >>>> But it wouldn't fix existing bugs when io_uring is used to access >>>> read or write methods that use in_compat_syscall(). One example that >>>> I recently ran into is drivers/scsi/sg.c. >>>=20 >>> So screw such read/write methods - don't use them with io_uring. >>> That, BTW, is one of the reasons I'm sceptical about burying the >>> decisions deep into the callchain - we don't _want_ different >>> data layouts on read/write depending upon the 32bit vs. 64bit >>> caller, let alone the pointer-chasing garbage that is /dev/sg. >>=20 >> Well, we could remove in_compat_syscall(), etc and instead have an implic= it parameter in DEFINE_SYSCALL. Then everything would have to be explicit. = This would probably be a win, although it could be quite a bit of work. >=20 > It would not be a win - most of the syscalls don't give a damn > about 32bit vs. 64bit... Any reasonable implementation would optimize it out for syscalls that don=E2= =80=99t care. Or it could be explicit: DEFINE_MULTIARCH_SYSCALL(...)=