From patchwork Fri Aug 12 02:48:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 9276243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3610D6022E for ; Fri, 12 Aug 2016 02:50:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 267DC205AD for ; Fri, 12 Aug 2016 02:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 196022880A; Fri, 12 Aug 2016 02:50:11 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 B4FB6205AD for ; Fri, 12 Aug 2016 02:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752818AbcHLCsr (ORCPT ); Thu, 11 Aug 2016 22:48:47 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:34016 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809AbcHLCso (ORCPT ); Thu, 11 Aug 2016 22:48:44 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 193EC20366; Thu, 11 Aug 2016 22:48:44 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Thu, 11 Aug 2016 22:48:44 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=themaw.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=8mA4rtaIsYakCUjnJfZMsFxQqgE=; b=gNC1w6 Z8ymvbf+WcRO5i+Qw4AvvCYlzFDDBouHi/Mv3TOsZRxhPIyY353R75l77Jd5DZ15 o92UOKqwQXN4y+pk3Eikky3FauO5GXXIcaGNgkxTJ5aCNkMy4zl34vG/RjziuCcR JuQOY6pX+G5hqQ8BS552IAEnRB6RrnqEJiczs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=8mA4rtaIsYakCUj nJfZMsFxQqgE=; b=juO9mi2PhRWXdwOlWN2OcrUvxh46jjXwWG5y77W42VvX2pe T38mRX/vFIaPTkNGrMH0dlEEb+T0rKflwDR+HjZVe72brNjwTAFNOmn1z5mbcFBE rSwdfge8kBynfieKOLxBZ9bmB42uVLU/RJTo3lzgPel3WzUX9aB12rrsrjvA= X-Sasl-enc: yGzUGChs+1szhLGrzszq1sklTfjzC+yxKkokiGftvbZ7 1470970123 Received: from pluto.themaw.net (58-7-183-14.dyn.iinet.net.au [58.7.183.14]) by mail.messagingengine.com (Postfix) with ESMTPA id 7FAD7CCE71; Thu, 11 Aug 2016 22:48:43 -0400 (EDT) Received: from pluto.themaw.net (localhost [127.0.0.1]) by pluto.themaw.net (Postfix) with ESMTP id 78023A0078; Fri, 12 Aug 2016 10:48:41 +0800 (AWST) Subject: [PATCH 14/18] autofs - fix dev ioctl number range check From: Ian Kent To: Andrew Morton Cc: linux-fsdevel , Tomohiro Kusumi , autofs mailing list , Kernel Mailing List Date: Fri, 12 Aug 2016 10:48:41 +0800 Message-ID: <20160812024841.12352.11975.stgit@pluto.themaw.net> In-Reply-To: <20160812024734.12352.17122.stgit@pluto.themaw.net> References: <20160812024734.12352.17122.stgit@pluto.themaw.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Tomohiro Kusumi --- fs/autofs4/autofs_i.h | 3 ++- fs/autofs4/dev-ioctl.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 #include 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; }