From patchwork Wed Aug 14 20:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11094525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61F4813AC for ; Wed, 14 Aug 2019 20:44:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 499C22883C for ; Wed, 14 Aug 2019 20:44:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38B4628842; Wed, 14 Aug 2019 20:44:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 245CB2883C for ; Wed, 14 Aug 2019 20:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbfHNUn7 (ORCPT ); Wed, 14 Aug 2019 16:43:59 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:50389 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727414AbfHNUn7 (ORCPT ); Wed, 14 Aug 2019 16:43:59 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MiaLn-1iSeBA1QPf-00fn6k; Wed, 14 Aug 2019 22:43:47 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, "Darrick J. Wong" , linux-xfs@vger.kernel.org Cc: Arnd Bergmann , Brian Foster , Allison Collins , Nick Bowler , Eric Sandeen , Dave Chinner Subject: [PATCH v5 01/18] xfs: compat_ioctl: use compat_ptr() Date: Wed, 14 Aug 2019 22:42:28 +0200 Message-Id: <20190814204259.120942-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190814204259.120942-1-arnd@arndb.de> References: <20190814204259.120942-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:sNo6mKYpnmSZN5AlXqVADdaOJq7MPq3SaOmLM1H/CuxqgrcCVf8 2YSUJHmWE9awUdZ1xWV2chJQhpNMTxERfy48/uOA4nMXImoW5puUJJdd47twsIaPl4BFmD1 wKmpCznhwYW60h8bbwBNrmaQxSUyotCMx6YiJNzqmhdaFwuJp9p4OMt5lO4jkNNkjEhlwNm PbA/cpynZI66g/mEvvdRQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:q3aew6AlwJ4=:ixRs8Mf5aY/UJ9Vn/Hkcj/ +4ya2F/k0c5RLxn7JzJ+q/nFSoIdHix7z0JIdEDTZY2fL1TDA5xGRCEyR9q3VuIGN6S5hHYv8 7B+L6v3E+3dlde75Ftb4UcDd1rz1NS0AZ/F3RwleJHV8GkrSykJW5MbEEujWbRrOVWte7gkZ/ gt3qjaH7dF3L95ZIfHfD8IbOjwGDV7EazbEEOAIBgdXQSPLkrMiGkhboWt2mJbuLf+Vu3vaxN l0zyau97oPkkCh4ifXlArBOu5qXiZAXpj8q2wify14jO2rQb5m5CYM4W1Myb9I8FoOEtdJ/91 Pgq/O2pMaA0Wks+a5PYV7NJLeq+N/FiqwT5kXYinZ+K0X1iTmMs4gtcTKDALUy1cE4GzQYNbP 85xHtVqKP80iGykVntL/Q7oTAXNCbrmtQUQoRyuiU+j9hQ2j3nnVtzoXhyhska2S0GW2cNHlV PoSYBoV3mMn3bxomoc2SxDl2qWcWtwlR6rhUJNZBCiFXd7U8vLeiGxC0hBZsEQPpTTDmNSWBS l0MDM4Ng0Ywvapx2OZBgWjoW6NC4KAzDZKypalCHYvIeWqh96BAPqQtxqQCM3u2S7SbGjmosl OhzEk+FCpJD5yW9p70jZi17kA7tOnaPGqZMbIyfWCVg4T/Yhu9yhfs2xXTXk3bB5MhVOSkmgT p9sZgPKd6Lu5qfhhxprD/d85Q007A8rmJbJOo85jFix5C2VMbImBoYghcHa5rmaiJCytIN5eS sUsQiYYI3whKvtZQTO+lFbiMu3fN3QKH+pElHg== Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For 31-bit s390 user space, we have to pass pointer arguments through compat_ptr() in the compat_ioctl handler. Signed-off-by: Arnd Bergmann --- fs/xfs/xfs_ioctl32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index 7fcf7569743f..ad91e81a2fcf 100644 --- a/fs/xfs/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c @@ -547,7 +547,7 @@ xfs_file_compat_ioctl( struct inode *inode = file_inode(filp); struct xfs_inode *ip = XFS_I(inode); struct xfs_mount *mp = ip->i_mount; - void __user *arg = (void __user *)p; + void __user *arg = compat_ptr(p); int error; trace_xfs_file_compat_ioctl(ip); @@ -576,7 +576,7 @@ xfs_file_compat_ioctl( case XFS_IOC_SCRUB_METADATA: case XFS_IOC_BULKSTAT: case XFS_IOC_INUMBERS: - return xfs_file_ioctl(filp, cmd, p); + return xfs_file_ioctl(filp, cmd, (unsigned long)arg); #if !defined(BROKEN_X86_ALIGNMENT) || defined(CONFIG_X86_X32) /* * These are handled fine if no alignment issues. To support x32 @@ -602,7 +602,7 @@ xfs_file_compat_ioctl( */ case XFS_IOC_SWAPEXT: #endif - return xfs_file_ioctl(filp, cmd, p); + return xfs_file_ioctl(filp, cmd, (unsigned long)arg); #endif #if defined(BROKEN_X86_ALIGNMENT) case XFS_IOC_ALLOCSP_32: @@ -653,7 +653,7 @@ xfs_file_compat_ioctl( case XFS_IOC_SETXFLAGS_32: case XFS_IOC_GETVERSION_32: cmd = _NATIVE_IOC(cmd, long); - return xfs_file_ioctl(filp, cmd, p); + return xfs_file_ioctl(filp, cmd, (unsigned long)arg); case XFS_IOC_SWAPEXT_32: { struct xfs_swapext sxp; struct compat_xfs_swapext __user *sxu = arg; From patchwork Wed Aug 14 20:42:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11094529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5912C6C5 for ; Wed, 14 Aug 2019 20:44:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 462102883C for ; Wed, 14 Aug 2019 20:44:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39DD128842; Wed, 14 Aug 2019 20:44:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D480A2883C for ; Wed, 14 Aug 2019 20:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728685AbfHNUoL (ORCPT ); Wed, 14 Aug 2019 16:44:11 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:48999 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727414AbfHNUoL (ORCPT ); Wed, 14 Aug 2019 16:44:11 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1M7sUE-1hu8FB2YJ0-0055JL; Wed, 14 Aug 2019 22:43:59 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, "Darrick J. Wong" , linux-xfs@vger.kernel.org Cc: Arnd Bergmann , stable@vger.kernel.org, Eric Sandeen , Brian Foster , Nick Bowler , Allison Collins , Eric Sandeen , Dave Chinner Subject: [PATCH v5 02/18] xfs: compat_ioctl: add missing conversions Date: Wed, 14 Aug 2019 22:42:29 +0200 Message-Id: <20190814204259.120942-3-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190814204259.120942-1-arnd@arndb.de> References: <20190814204259.120942-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:BLux4Grpb9eaMSbIUHaQDxbpUbrvASwJg7DjSBmbDM1mEh+OQSl G5n/FRAlhpcI0Sn7b9m1K0M1bvF39TcpRlT3CSGFl7+bY+KEO6/rjDcP9KSqU+5SOAFZN1u Ui5FCJaccug7SCmAt9JgOshsonVvlK697uQkOLkrX2ItPyAMgMpdRzWF2sTnSwRy6q9IT+B vD7ThUPi2YJlmDVS6BIww== X-UI-Out-Filterresults: notjunk:1;V03:K0:j12Xhrp5sIs=:AcxvEsaYOH6PkuvTGntmR9 rBstK/TIT+tpcug7Gtvy3sx8T18TYIS1QNsHzsO7opM4MdvAyRQ1V4skOOIgSlrGs3uBeEATu /N+yQKqh2Gu+2GbVYX0nff3AQUL86sCBbN7G4JifKUsgEMPHFydi+Hmcyny7tZZbhP7++ncih fpsI2yzVH6Lnpy3A9z3mck/PxWig+lwGeUZt5MDJsX9HlxJ/kFTcpwVKN4BPCc/3IZ27XgOXQ HH5TaXVkv8VI8YHQCYI6SBQAmRV9RoXRoSIqyFyegh330OEmMuAnP9EReovhA05uOQ8OW0XP5 xh2ytmeOS2tRrdJARoUnKb5xbD+nYMaYPi7+b4kMJl196CCptyCefwvUbziLAPr4ts9iiCiqs O1e6cJUptwG/2NA7z6akcuZ06wk3DmFQaav41eBF9gIkMlcNgNvpLh/jlKKfd0xEz5gB3N5S6 DXhbGKUWiNf+855BcAuf0kc0w0GgIvx7lj8hhbJdxUN6aWHfOq7JPnHAt8QBl8R7fPGIqS0BS ECc0EtMgsqvGz3C0pg/V7dudPnK1nNFUp+aU+i402P3pu5XPsUwRCz8rY/ibQjm2Lio2Mxmax sq4jjrMpF9qbB9Sh3zPov66UEVbUIkfFNJkaJAFGjq6aOu43e1l6X7mDcZwhfjihaRCGfmVCo mtEJYVporJWn+f9fQkLw37RF4eVZR37mnkEcQ77mc0dJa597PDGmwzgVloGPpFGa20ap9mu1I L90m3jpTIa7fD6mAaFYIMPPayNuFFuuNZRWOmA== Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP FS_IOC_GETFSLABEL/FS_IOC_SETFSLABEL were added in linux-4.18 in xfs, but not in the compat_ioctl case, so add them here. FITRIM was added earlier and also lacks a line the same function, but this is ok because there is an entry in fs/compat_ioctl.c for it. Adding all three here to keep the native and compat ioctl handlers in sync. Cc: stable@vger.kernel.org Fixes: f7664b31975b ("xfs: implement online get/set fs label") Signed-off-by: Arnd Bergmann --- fs/xfs/xfs_ioctl32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index ad91e81a2fcf..63bdc4c1535b 100644 --- a/fs/xfs/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c @@ -576,6 +576,9 @@ xfs_file_compat_ioctl( case XFS_IOC_SCRUB_METADATA: case XFS_IOC_BULKSTAT: case XFS_IOC_INUMBERS: + case FITRIM: + case FS_IOC_GETFSLABEL: + case FS_IOC_SETFSLABEL: return xfs_file_ioctl(filp, cmd, (unsigned long)arg); #if !defined(BROKEN_X86_ALIGNMENT) || defined(CONFIG_X86_X32) /*