Skip to contentSkip to conversation

fsinfo: Fix off-by-one bug

PATCH In review Gustavo A. R. Silva 1 participant 2 messages Jul 16, 2018 VFS

lore
Share & tools
lore
#1 lore raw
In reply to Gustavo A. R. Silva

Hi,

Please, drop this patch.

Sorry, I confused fsinfo_attr_statfs with fsinfo_attr__nr.

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

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")
---
 fs/statfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/statfs.c +1 -1
index 3b8e2700..2a28581 100644
@@ -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;
 	}
#0 lore raw

PATCH 1/1 fsinfo: Fix off-by-one bug

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")
---
 fs/statfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/statfs.c +1 -1
index 3b8e2700..2a28581 100644
@@ -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;
 	}
Signature · 1 line
2.7.4