Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e059df
)
mke2fs: add range checks for -E desc_size
author
Theodore Ts'o
<tytso@mit.edu>
Mon, 26 May 2025 16:51:49 +0000
(12:51 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Mon, 26 May 2025 16:51:49 +0000
(12:51 -0400)
Prevent the user from specifying group descriptor that result in
invalid/corrupted file systems.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/mke2fs.c
patch
|
blob
|
history
diff --git
a/misc/mke2fs.c
b/misc/mke2fs.c
index
456cf6f
..
c84ace7
100644
(file)
--- a/
misc/mke2fs.c
+++ b/
misc/mke2fs.c
@@
-865,7
+865,10
@@
static void parse_extended_opts(struct ext2_super_block *param,
continue;
}
ulong = strtoul(arg, &p, 0);
- if (*p || (ulong & (ulong - 1))) {
+ if (*p ||
+ (ulong < EXT2_MIN_DESC_SIZE_64BIT) ||
+ (ulong > EXT2_MAX_DESC_SIZE) ||
+ (ulong & (ulong - 1))) {
fprintf(stderr,
_("Invalid desc_size: '%s'\n"), arg);
r_usage++;