Message ID | 20221214-nsfs-ioctl-compat-v1-1-3180bf297a02@weissschuh.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3424406wrt; Wed, 11 Jan 2023 08:46:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXv7YkoSEjZBNEzRXSOwlGEuisG4Iu2eHAHwAgqgRiKwshUgJIbsf/1Tn+WqXdRCngnJvDCQ X-Received: by 2002:a05:6402:449a:b0:47d:88f3:1165 with SMTP id er26-20020a056402449a00b0047d88f31165mr70126810edb.12.1673455588595; Wed, 11 Jan 2023 08:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673455588; cv=none; d=google.com; s=arc-20160816; b=TImnc6w8gjsZsrsigmJpJiU6qrkFzfXQ46FdmQNLqA9UVd4hb8RuiS45GjKfCJU2mM gbJWkcgDvSIkvrWswoE3BSA08WO7DdA8GIHDiGGjmtOcXTdLpcvNV8fiHKuZ7m6UGok9 tYQnc+lfG0h9wZ1IneLRl5prPS41YX9lw2EtjI0IgbNtRe0Aaor6jBzWEwSSvXLJygJN tKfp2/ojALUHzcDoZ9NZ7+kyzOaVL7+DwByfyI0oRKtKlse2o9XhGjJXlMzwtab9yZf8 bNIVEI86Flng1q7+Mbusgkv6JfWnmHDQmSHQ0yaHA6twu2++XelImDILXvZcqyWYopoD PuLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from; bh=fCBEtYuqDeCSQ8JCZHSutg1FRpD4EjPHrFV/rwVBwwc=; b=eScumKuxUFsetkvXje0pI1FVfkNXe+3+T+8fOInzu1kgNMfiefyrcKWybns4BjYOhG iouoWtE8aNekiIJgln+qgqQ/SGJo6WxoIeqMjDsohsCTqPYx1L2OD+T1Z+D7Vi9nAPMq 8svPcmAsgdop4W5Q1N0UAcclhGlMLJGB8BvmWSFmjeVH+Y4u9V1tPpE4NzA+lIqrCz4T HhnfXI+RYUe9FChDAWxnHtIs74nvZpLeqbRInVu87D+93TeOIvNswYLb0QZT2oVgjPzq 3Oq1jcxn4bv4eWgHVHvYy/H06KuySM4TbIomR5WN64AvT1Le6JrjIpEFlfY0e15SzXcv VOJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=uC9H5QXx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a508e04000000b004860662d184si14944551edw.150.2023.01.11.08.46.04; Wed, 11 Jan 2023 08:46:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=uC9H5QXx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229833AbjAKQnX (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Wed, 11 Jan 2023 11:43:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234628AbjAKQmm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Jan 2023 11:42:42 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ECC6164B4; Wed, 11 Jan 2023 08:42:13 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= <linux@weissschuh.net> DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1673455331; bh=oPHeqffJWnugBEy5BfA0S5pz/LFEC+mvhbSZ1LgHT58=; h=From:Date:Subject:To:Cc:From; b=uC9H5QXx7fmv+zhsei6EGCF/6P/ONA27ENwGoqmlOvXE491AVx4VG+fYsmyTxdToD smpW96FSWIu3Ql0VweMOclcGL4zNUzBfeQ2rqr1rtqPm+hlwsNk1PIvX15W0QT3a7W rwA3pQ0yLvFXXhGlvdBvGtCP5Ixol6EzzqdQC1mo= Date: Wed, 11 Jan 2023 16:42:07 +0000 Subject: [PATCH RESEND] nsfs: add compat ioctl handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: <20221214-nsfs-ioctl-compat-v1-1-3180bf297a02@weissschuh.net> To: Alexander Viro <viro@zeniv.linux.org.uk>, Andrey Vagin <avagin@openvz.org>, "Eric W. Biederman" <ebiederm@xmission.com>, Serge Hallyn <serge@hallyn.com> Cc: Karel Zak <kzak@redhat.com>, Thomas =?utf-8?q?Wei=C3=9Fschuh?= <linux@weissschuh.net>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673455329; l=1998; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=oPHeqffJWnugBEy5BfA0S5pz/LFEC+mvhbSZ1LgHT58=; b=tzvA9e99k86pJFluK36zg2SRWMLBn1EeQhsLRb6yMGnq59eSxNS8B/XA0kkQdc3HO7R7O5l+XtQA b3I2140ODuPWNtO7N2RYz5akkOlebbCFDv3vLRnsBcIZVTaCd2Wu X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754745367029864759?= X-GMAIL-MSGID: =?utf-8?q?1754745367029864759?= |
Series |
[RESEND] nsfs: add compat ioctl handler
|
|
Commit Message
Thomas Weißschuh
Jan. 11, 2023, 4:42 p.m. UTC
As all parameters and return values of the ioctls have the same
representation on both 32bit and 64bit we can reuse the normal ioctl
handler for the compat handler.
All nsfs ioctls return a plain "int" filedescriptor which is a signed
4-byte integer type on both 32bit and 64bit.
The only parameter taken is by NS_GET_OWNER_UID and is a pointer to a
"uid_t" which is a 4-byte unsigned integer type on both 32bit and 64bit.
Fixes: 6786741dbf99 ("nsfs: add ioctl to get an owning user namespace for ns file descriptor")
Reported-By: Karel Zak <kzak@redhat.com>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
As all parameters and return values of the ioctls have the same
representation on both 32bit and 64bit we can reuse the normal ioctl
handler for the compat handler.
All nsfs ioctls return a plain "int" filedescriptor which is a signed
4-byte integer type on both 32bit and 64bit.
The only parameter taken is by NS_GET_OWNER_UID and is a pointer to a
"uid_t" which is a 4-byte unsigned integer type on both 32bit and 64bit.
---
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Andrey Vagin <avagin@openvz.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
To: Serge Hallyn <serge@hallyn.com>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Karel Zak <kzak@redhat.com>
---
fs/nsfs.c | 1 +
1 file changed, 1 insertion(+)
---
base-commit: f9ff5644bcc04221bae56f922122f2b7f5d24d62
change-id: 20221214-nsfs-ioctl-compat-1548bf6581a7
Best regards,
Comments
On Wed, Jan 11, 2023 at 04:42:07PM +0000, Thomas Weißschuh wrote: > diff --git a/fs/nsfs.c b/fs/nsfs.c > index 3506f6074288..4d2644507364 100644 > --- a/fs/nsfs.c > +++ b/fs/nsfs.c > @@ -21,6 +21,7 @@ static long ns_ioctl(struct file *filp, unsigned int ioctl, > static const struct file_operations ns_file_operations = { > .llseek = no_llseek, > .unlocked_ioctl = ns_ioctl, > + .compat_ioctl = ns_ioctl, > }; Please disregard this patch. It was a resend of a wrong revision. The correct revision was v3 which I also resent. Sorry for the noise.
diff --git a/fs/nsfs.c b/fs/nsfs.c index 3506f6074288..4d2644507364 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -21,6 +21,7 @@ static long ns_ioctl(struct file *filp, unsigned int ioctl, static const struct file_operations ns_file_operations = { .llseek = no_llseek, .unlocked_ioctl = ns_ioctl, + .compat_ioctl = ns_ioctl, }; static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)