Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2162127pxk; Sat, 19 Sep 2020 15:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQqiUJhfW836RQpmWUgLGIfjhgz8KDKuX4xP9oelh5pOXw+DKq+nl7uECEy+1KqWDF5fVu X-Received: by 2002:a17:906:a00c:: with SMTP id p12mr41584230ejy.10.1600554317078; Sat, 19 Sep 2020 15:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600554317; cv=none; d=google.com; s=arc-20160816; b=Ru0sRlwwWz+VhpemxWPGDg8tF4XOYrkPUf5FavE9gYEdf3vUKHtqZSBGPX3ZhQk8Ji EWorN5EKXEFl+DnmmRTU7LiwUUUO3P5kcLbrBHGswqXFI+yAOFn3Rpojmyp9qaOh2pIi E5aKFce+GyQuucbB1K9wHGQPyuBkgCDzWdQyjzr6A6BedGKbI2rqO2HyNW5KpzKsJ2ne NMK243hIE3f62EEgNtybH3fnBUBz/gYnGZtaN9SpC4KqeB6NmWov11bjYDps8w34inLk b5LpW3MP+Uftkun3hiNGYESNyM1Mon5hyB5OeLbuFS0itl6XhfBgSyu4HUpTwIS7wNSv laEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:cc:references:message-id:date :subject:mime-version:from:content-transfer-encoding:dkim-signature; bh=Zt+NcwFtW78Ml5fABVrawYmyBt1OY97jVqUspSuSzso=; b=jgxhEqrZ5uF8m8Uzof+VOXm6oNAvYK3UPhAhAHCfvqvCTGuqqe/oL2hDOeiDS29qQs 0XBknBxTcEAyIrcECUNrgMbd9UNVA+OaAFp2DUZ/3dCLF8+RwtEOoq9/1tbFFAqKs3Qf aSe37x2w+6CrxL/7NgqM3MXWwinrmENwtjXXVnQgnN6pCX+cKcEQv8FrbH2gwZCeNEEC hUHUwnmz/3s5W3TWYDKS1Mdv4FO3ppPucXO2930Lt95anqIJc3bVr9JbHURG6l0nygOQ QXSFoYarXKPTJgAB6MBS6UWxtt3Pysb2zigT/QPCPZo41Lasr8ibVtU1jRsWqN27yK7m R6yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=JGo5Ok3U; 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 d16si4976097ejc.620.2020.09.19.15.24.53; Sat, 19 Sep 2020 15:25:17 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=JGo5Ok3U; 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 S1726786AbgISWX5 (ORCPT + 99 others); Sat, 19 Sep 2020 18:23:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbgISWX4 (ORCPT ); Sat, 19 Sep 2020 18:23:56 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC841C0613D6 for ; Sat, 19 Sep 2020 15:23:56 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id k8so5849205pfk.2 for ; Sat, 19 Sep 2020 15:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=Zt+NcwFtW78Ml5fABVrawYmyBt1OY97jVqUspSuSzso=; b=JGo5Ok3UQlPkC13DKOsYdJnfzq73atFfYisEM+Hwumxj0suTBGssb+VorpwmGSdeCs bcXUpcZN25SMMCskSZLqiZtD4YDbCCmBpaZRkf/XvoBbu4chMl2XKMFhFG1ni8TPjold u1MXw/S5l0zIP2gSmcy2WrK2PhaeRtThtZVCQ2dBve9yiyZAijqQYE96b0yFOHC1wqdZ 7hEKxxWuktu0haCnifIZQak4CZt8BJYl2PwWFDdP87EmsRRAJSorXT5hINrPIcaUrT6Y ZGcKD1NJTEIknksw7U+45Z60Vnnj162xs4+yz1Qx9fnmzqSyx2F/YY69FVIp1XlYNq6/ 4JRQ== 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:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=Zt+NcwFtW78Ml5fABVrawYmyBt1OY97jVqUspSuSzso=; b=uWtdem5SmOYwWB2m4lwLtiawKOYO91CShLo9IzdhvTCAG7JU7FFqbANVusDv8arbXH Lg7yiSaNu8eu9Ljp0I9OxwqoTFmgGHqX2hpXKsVb6sy0QMmj2ZJTJqE0pn24+03SYTx9 WbgOwUmgyPew8QnkRbu93uW8JE18f24aIQmqhRZ4AztY+t5ayHHUloLJ2ntsLE8OuC86 1DFlULioM7gzOE8NEzG6GN+oQ++cbkrphpOi4TDUH8XvBUkwN0lupDRf4P1VtuCAm8er U45R6WVWyozVZNEHdnuWsM6das7s4jCa0oycBx7Ne48EljJZSup5ERq+J77g+XoNqBu0 y2nw== X-Gm-Message-State: AOAM532Oudx0awYpX9wte9N/2QsJD0zNKya9TPLX0nn9j4OjArLQ1E+Y vq4KSi0EveNeGkP65Wt/f1q0wg== X-Received: by 2002:aa7:9583:0:b029:142:2501:396a with SMTP id z3-20020aa795830000b02901422501396amr21664408pfj.47.1600554235950; Sat, 19 Sep 2020 15:23:55 -0700 (PDT) Received: from localhost.localdomain ([2601:646:c200:1ef2:e9da:b923:b529:3349]) by smtp.gmail.com with ESMTPSA id gb17sm6607151pjb.15.2020.09.19.15.23.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Sep 2020 15:23:55 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag Date: Sat, 19 Sep 2020 15:23:54 -0700 Message-Id: References: <20200919220920.GI3421308@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 In-Reply-To: <20200919220920.GI3421308@ZenIV.linux.org.uk> To: Al Viro X-Mailer: iPhone Mail (18A373) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 wrote= : >>> 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. Well, we could remove in_compat_syscall(), etc and instead have an implicit p= arameter in DEFINE_SYSCALL. Then everything would have to be explicit. Thi= s would probably be a win, although it could be quite a bit of work.=