public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: David Howells <dhowells@redhat.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: [PATCH] fsinfo: Fix off-by-one bug
Date: Mon, 16 Jul 2018 17:03:06 -0500	[thread overview]
Message-ID: <20180716220306.GA10773@embeddedor.com> (raw)

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 <gustavo@embeddedor.com>
---
 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


             reply	other threads:[~2018-07-16 22:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 22:03 Gustavo A. R. Silva [this message]
2018-07-16 22:09 ` [PATCH] fsinfo: Fix off-by-one bug Gustavo A. R. Silva

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=20180716220306.GA10773@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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