From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway21.websitewelcome.com ([192.185.45.155]:21630 "EHLO gateway21.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728758AbeGPWcc (ORCPT ); Mon, 16 Jul 2018 18:32:32 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 76C70400D3D72 for ; Mon, 16 Jul 2018 17:03:07 -0500 (CDT) Date: Mon, 16 Jul 2018 17:03:06 -0500 From: "Gustavo A. R. Silva" To: David Howells , Alexander Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] fsinfo: Fix off-by-one bug Message-ID: <20180716220306.GA10773@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The current code reads one element beyond the end of the fsinfo_buffer_sizes array. Fixes: 4e635f61dd55 ("fsinfo: Add a system call to allow querying of filesystem information") Signed-off-by: Gustavo A. R. Silva --- fs/statfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/statfs.c b/fs/statfs.c index 3b8e2700..2a28581 100644 --- a/fs/statfs.c +++ b/fs/statfs.c @@ -791,7 +791,7 @@ SYSCALL_DEFINE5(fsinfo, params.Mth = user_params.Mth; } else { params.at_flags = 0; - params.request = fsinfo_attr_statfs; + params.request = fsinfo_attr_statfs - 1; params.Nth = 0; params.Mth = 0; } -- 2.7.4