Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10562874ybi; Thu, 11 Jul 2019 07:19:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCEjKJwWnQS35ejKGCEdcWTgepH01fKBw2SuNdmTEbQS12+DhQl1bDskHBrvQ9ewYKEmly X-Received: by 2002:a63:eb06:: with SMTP id t6mr205495pgh.107.1562854742732; Thu, 11 Jul 2019 07:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562854742; cv=none; d=google.com; s=arc-20160816; b=jbFHUHUYi6crlgA/Ih7UVVH/ZsEDA4FivYt5erZY7z5VnoTuRxKacQyPmo54GK25Ly pYZVd+kKwApiRnynEX2IJaVWh+CvqD0tlg+kzBPM31p+CXby8KxBgRd6C7edwoLCzQ/l wdCeUR/9zfdwIa+PRqMwRiD/rlpsxgV5mzNIlK+eueMfAO16nrxT3pYnuRekJAo43Xkd F9LKkO+xIVA3byzKcbsSEMqjpP2nM5olT8o2QMgV4st9XFUicBdKuO98wWbH3RKXtLTT lHDGf1U+DO/ryTUiM9hmiyK9dbYLwIfMyl/Dj8gR2IwtFGbJl5L/8xKSDDMHWaHe5Xqf Uy4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=v4hnw4J2zDOxhhF352b54+1toOBxd4wplvoUl4/DkIs=; b=l1+D3vbsfX2VotFYnEsDz/rlKnWPrj3bMuASPef2NAe5APmWd7J3zKmiYpZXGalgUf UpEncIp3SdBvze0X6TjUoI7Cv8RmAXoQELOvoP4B5DSWHSl+7K0a+s9iJFuENiOOXM/g tp+7in9FZduiY0VErOMMKXJ2+9j3FHII5N4qCo64/GUWlqtXUqsDEBhRDc28GLh4lMUn FJrL0aSznn6tSjVVwUEkxa1gQ7zJoTqZTg2BBEawiXi9LV3nfwWnZPCnw2aOfxyKNPKw CB8nQfiKrjOD/Yq65Oa2+3fFPtCSayD2SfxL26awvz45KSSAcDKVrbXZZzTqzqn5e0AC B+Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aBUUZFgs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id z7si5677050pga.409.2019.07.11.07.18.46; Thu, 11 Jul 2019 07:19:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aBUUZFgs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728584AbfGKOS0 (ORCPT + 99 others); Thu, 11 Jul 2019 10:18:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:53598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728421AbfGKOS0 (ORCPT ); Thu, 11 Jul 2019 10:18:26 -0400 Received: from localhost (c-67-169-218-210.hsd1.or.comcast.net [67.169.218.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A1F7321537; Thu, 11 Jul 2019 14:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562854705; bh=zxkWNgWAcdgDEs1e0ke3VX57cNWOkZWU0UUe/G7zWoU=; h=Date:From:To:Cc:Subject:From; b=aBUUZFgsgg5wBsaDq5QRISmheVCa1Jl2f77SUULojLCZuYrYYoexyBVnGYtKo0D7O WQwldng+7Ilw7o2enbcVZUz+LvsvppoBCQecvYxWonrb0tVdTRbB9B1PoJtFiMdv1D R2L6mqtUtnEST5hxxcA8UvqM/m0Zpgb2zPRxIBv8= Date: Thu, 11 Jul 2019 07:18:25 -0700 From: "Darrick J. Wong" To: Linus Torvalds Cc: "Darrick J. Wong" , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, david@fromorbit.com, linux-kernel@vger.kernel.org, sandeen@sandeen.net, hch@lst.de, linux-ext4 , Theodore Ts'o Subject: [GIT PULL] vfs: standardize parameter checking for SETFLAGS/FSSETXATTR ioctls Message-ID: <20190711141825.GV1404256@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, Here's a patch series that sets up common parameter checking functions for the FS_IOC_SETFLAGS and FS_IOC_FSSETXATTR ioctl implementations. The goal here is to reduce the amount of behaviorial variance between the filesystems where those ioctls originated (ext2 and XFS, respectively) and everybody else. The branch merges cleanly against this morning's HEAD and survived an overnight run of xfstests. The merge was completely straightforward, so please let me know if you run into anything weird. --D The following changes since commit d1fdb6d8f6a4109a4263176c84b899076a5f8008: Linux 5.2-rc4 (2019-06-08 20:24:46 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/vfs-fix-ioctl-checking-3 for you to fetch changes up to dbc77f31e58b2902a5e7643761c04bf69f57a32a: vfs: only allow FSSETXATTR to set DAX flag on files and dirs (2019-07-01 08:25:36 -0700) ---------------------------------------------------------------- New for 5.3: - Standardize parameter checking for the SETFLAGS and FSSETXATTR ioctls (which were the file attribute setters for ext4 and xfs and have now been hoisted to the vfs) - Only allow the DAX flag to be set on files and directories. ---------------------------------------------------------------- Darrick J. Wong (5): vfs: create a generic checking and prep function for FS_IOC_SETFLAGS vfs: create a generic checking function for FS_IOC_FSSETXATTR vfs: teach vfs_ioc_fssetxattr_check to check project id info vfs: teach vfs_ioc_fssetxattr_check to check extent size hints vfs: only allow FSSETXATTR to set DAX flag on files and dirs fs/btrfs/ioctl.c | 30 ++++------ fs/efivarfs/file.c | 26 ++++++--- fs/ext2/ioctl.c | 16 ++---- fs/ext4/ioctl.c | 51 +++++------------ fs/gfs2/file.c | 42 +++++++++----- fs/hfsplus/ioctl.c | 21 ++++--- fs/inode.c | 86 +++++++++++++++++++++++++++++ fs/jfs/ioctl.c | 22 +++----- fs/nilfs2/ioctl.c | 9 +-- fs/ocfs2/ioctl.c | 13 +---- fs/orangefs/file.c | 37 ++++++++++--- fs/reiserfs/ioctl.c | 10 ++-- fs/ubifs/ioctl.c | 13 +---- fs/xfs/xfs_ioctl.c | 154 +++++++++++++++++++++++----------------------------- include/linux/fs.h | 12 ++++ 15 files changed, 300 insertions(+), 242 deletions(-)