From: Ian Kent <raven@themaw.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Tomohiro Kusumi <kusumi.tomohiro@gmail.com>,
autofs mailing list <autofs@vger.kernel.org>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 14/18] autofs - fix dev ioctl number range check
Date: Fri, 12 Aug 2016 10:48:41 +0800 [thread overview]
Message-ID: <20160812024841.12352.11975.stgit@pluto.themaw.net> (raw)
In-Reply-To: <20160812024734.12352.17122.stgit@pluto.themaw.net>
The count of miscellaneous device ioctls in fs/autofs4/autofs_i.h is wrong.
The number of ioctls is the difference between AUTOFS_DEV_IOCTL_VERSION_CMD
and AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD (14) not the difference between
AUTOFS_IOC_COUNT and 11 (21).
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
---
fs/autofs4/autofs_i.h | 3 ++-
fs/autofs4/dev-ioctl.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 73e3d38..dd71bd4 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -20,7 +20,8 @@
#define AUTOFS_IOC_COUNT 32
#define AUTOFS_DEV_IOCTL_IOC_FIRST (AUTOFS_DEV_IOCTL_VERSION)
-#define AUTOFS_DEV_IOCTL_IOC_COUNT (AUTOFS_IOC_COUNT - 11)
+#define AUTOFS_DEV_IOCTL_IOC_COUNT \
+ (AUTOFS_DEV_IOCTL_VERSION_CMD - AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD)
#include <linux/kernel.h>
#include <linux/slab.h>
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
index d47b35a..13e7517 100644
--- a/fs/autofs4/dev-ioctl.c
+++ b/fs/autofs4/dev-ioctl.c
@@ -642,7 +642,7 @@ static int _autofs_dev_ioctl(unsigned int command,
cmd = _IOC_NR(command);
if (_IOC_TYPE(command) != _IOC_TYPE(AUTOFS_DEV_IOCTL_IOC_FIRST) ||
- cmd - cmd_first >= AUTOFS_DEV_IOCTL_IOC_COUNT) {
+ cmd - cmd_first > AUTOFS_DEV_IOCTL_IOC_COUNT) {
return -ENOTTY;
}
next prev parent reply other threads:[~2016-08-12 2:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 2:47 [PATCH 01/18] autofs: Fix typos in Documentation/filesystems/autofs4.txt Ian Kent
2016-08-12 2:47 ` [PATCH 02/18] autofs: Drop unnecessary extern in autofs_i.h Ian Kent
2016-08-12 2:47 ` [PATCH 03/18] autofs: Test autofs versions first on sb initialization Ian Kent
2016-08-12 2:47 ` [PATCH 04/18] autofs - fix autofs4_fill_super() error exit handling Ian Kent
2016-08-12 2:47 ` [PATCH 05/18] autofs: Add WARN_ON(1) for non dir/link inode case Ian Kent
2016-08-12 2:48 ` [PATCH 06/18] autofs - remove ino free in autofs4_dir_symlink() Ian Kent
2016-08-12 2:48 ` [PATCH 07/18] autofs: Use autofs4_free_ino() to kfree dentry data Ian Kent
2016-08-12 2:48 ` [PATCH 08/18] autofs: Remove obsolete sb fields Ian Kent
2016-08-12 2:48 ` [PATCH 09/18] autofs: Don't fail to free_dev_ioctl(param) Ian Kent
2016-08-12 2:48 ` [PATCH 10/18] autofs: Remove AUTOFS_DEVID_LEN Ian Kent
2016-08-12 2:48 ` [PATCH 11/18] autofs: Fix Documentation regarding devid on ioctl Ian Kent
2016-08-12 2:48 ` [PATCH 12/18] autofs: Update struct autofs_dev_ioctl in Documentation Ian Kent
2016-08-12 2:48 ` [PATCH 13/18] autofs: Fix pr_debug() message Ian Kent
2016-08-12 2:48 ` Ian Kent [this message]
2016-08-12 2:48 ` [PATCH 15/18] autofs: Add autofs_dev_ioctl_version() for AUTOFS_DEV_IOCTL_VERSION_CMD Ian Kent
2016-08-12 2:48 ` [PATCH 16/18] autofs: Fix print format for ioctl warning message Ian Kent
2016-08-12 2:48 ` [PATCH 17/18] autofs: Move inclusion of linux/limits.h to uapi Ian Kent
2016-08-12 2:49 ` [PATCH 18/18] autofs4 - move linux/auto_dev-ioctl.h to uapi/linux Ian Kent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160812024841.12352.11975.stgit@pluto.themaw.net \
--to=raven@themaw.net \
--cc=akpm@linux-foundation.org \
--cc=autofs@vger.kernel.org \
--cc=kusumi.tomohiro@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).