Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp893893pxf; Thu, 18 Mar 2021 14:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdHL4OCS9xtSTxOk9mMQQqj3JH4fnkYsvm5acMObV4ds11kOgASfmlaZt2b3bWi0wOZHri X-Received: by 2002:a17:906:40c7:: with SMTP id a7mr591859ejk.109.1616102261865; Thu, 18 Mar 2021 14:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616102261; cv=none; d=google.com; s=arc-20160816; b=DDzRUeq1HA85ETcKMaJhRM1MeKvECYs63ohNBHx6P0JJyMPBzEO+qadMq5ItZsMgb3 4byA/+EyX4oAQzBBQoS6AoGCLmBLS/GfNG8MMJOHbU1EcaVu4SaiYuCSzPtwuGf2ie40 Jukh94g3EYwrqQWMa8GTmp9arDj1vdGEMAmN0n4kaxhj7rNdOV+XuvwJoNV1yt8JNRZk X337KBpFSlWRDgaupE0Jw6pffXx5MMfIJJsqnWX3n8Z/Gos41nQKLvzQZeqMoJmx9/+L PVXm6sI0muFYleKhgzWEpZnw7jJed7rd0CqshNLf2RdWzcJkW5y37PHKFEx3z3G1fj87 945g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0m0Cfj2gqCtRHBtTutE57BkUSgTkpwZOMEFQHJXsskE=; b=x9MTTtqPnDbaXL/V0VNxKMU9NlfvKkCUvx2l17er5p34Lla1+zkWXLaYn+KG2qnjF3 qgt+bm4xm4tPmD5mZsk6W2e96RUdXVvQEFostJ9n/IL64iMiDNmL2TAYojB0FJQ8OChW IhCjOYsMKm0+wDixyuaxOiddca+TMjgrf6V1goTHWuZUUMrutgXBBa4sAL3Ec1R0Xgxs gl56SA8SCjUzYFt1YR8DVbONvJbAySShaNkTLid+zrujBkiVPHzoVkJ69tJBIkyDRBNC ObFqvA3qYLbWtE9lgOH8nDs+Jrgz7uKk3HR0V74KKWZrVmZNy4r+t54j6ctKIuXkgTC9 cLkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qdIrjuIt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si2605733ejm.408.2021.03.18.14.17.19; Thu, 18 Mar 2021 14:17:41 -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=@kernel.org header.s=k20201202 header.b=qdIrjuIt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233281AbhCRVQW (ORCPT + 99 others); Thu, 18 Mar 2021 17:16:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:45886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233258AbhCRVQB (ORCPT ); Thu, 18 Mar 2021 17:16:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9090564E02; Thu, 18 Mar 2021 21:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616102160; bh=3xDkvaW8GlfwEpu6Ok3K5BbG+SXWmgmEnOMjmlPKbfw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qdIrjuItgQGC8WeWbSWgP91x7L/bBAFacA/u+c60pVdHrLz7VFrgzsKy9gJQwb5XV 2oty6btRgJpX3jrvQSNBQfjWA49z11R+bpXq+yzbJlDpA8ZXBL5FKqmlnH7LwVyIck fW2kGcVuamALhzFvcdawcKP689Czr93PsT0rK4qe5MsKgn9ChiFh1c61zcCmIE9QPZ l8GjNAis9gWxLCaq65IjfYZksyc/U5SiF1JKtu1FQ+v5mETm71416rfVkqJauvw7bl qL81YFjUjaY0RpPeyYvOa34FDTmTCAktxGX28YNBWstSpYxSjZqTLzs/N54KnTdC4f imAUBu8jfKe6A== Received: by mail-oi1-f172.google.com with SMTP id i3so2481327oik.7; Thu, 18 Mar 2021 14:16:00 -0700 (PDT) X-Gm-Message-State: AOAM530HYiNArJrF6ApCCKFqmC9fVPpEJG9Nt5LQ0Y2T0EUcTfgRodEE MUAIJIQb6CJwl8JY2Nmd+3Bfd4cc31U0d6MbGc0= X-Received: by 2002:a05:6808:3d9:: with SMTP id o25mr4563556oie.4.1616102159988; Thu, 18 Mar 2021 14:15:59 -0700 (PDT) MIME-Version: 1.0 References: <20210125153057.3623715-1-balsini@android.com> <20210125153057.3623715-3-balsini@android.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 18 Mar 2021 22:15:43 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RESEND V12 2/8] fuse: 32-bit user space ioctl compat for fuse device To: Alessio Balsini Cc: Miklos Szeredi , Akilesh Kailash , Amir Goldstein , Antonio SJ Musumeci , David Anderson , Giuseppe Scrivano , Jann Horn , Jens Axboe , Martijn Coenen , Palmer Dabbelt , Paul Lawrence , Peng Tao , Stefano Duo , Zimuzo Ezeozue , wuyan , fuse-devel@lists.sourceforge.net, Android Kernel Team , Linux FS-devel Mailing List , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 18, 2021 at 5:13 PM Alessio Balsini wrote: > On Tue, Mar 16, 2021 at 07:53:06PM +0100, Arnd Bergmann wrote: > > On Mon, Jan 25, 2021 at 4:48 PM Alessio Balsini wrote: > > > > > Thanks for spotting this possible criticality. > > I noticed that 32-bit users pace was unable to use the > FUSE_DEV_IOC_CLONE ioctl on 64-bit kernels, so this change avoid this > issue by forcing the kernel to interpret 32 and 64 bit > FUSE_DEV_IOC_CLONE command as if they were the same. As far as I can tell from the kernel headers, the command code should be the same for both 32-bit and 64-bit tasks: 0x8004e500. Can you find out what exact value you see in the user space that was causing problems, and how it ended up with a different value than the 64-bit version? If there are two possible command codes, I'd suggest you just change the driver to handle both variants explicitly, but not any other one. > This is the simplest solution I could find as the UAPI is not changed > as, as you mentioned, the argument doesn't require any conversion. > > I understand that this might limit possible future extensions of the > FUSE_DEV_IOC_XXX ioctls if their in/out argument changed depending on > the architecture, but only at that point we can switch to using the > compat layer, right? > > What I'm worried about is the direction, do you think this would be an > issue? > > I can start working on a compat layer fix meanwhile. For a proper well-designed ioctl interface, compat support should not need anything beyond the '.compat_ioctl = compat_ptr_ioctl' assignment. Arnd