Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-21
STALE3737d

[patch] ext4: underflow in alignment check

From: Dan Carpenter <hidden>
Date: 2016-06-16 07:07:27
Also in: kernel-janitors, lkml
Subsystem: ext4 file system, filesystems (vfs and infrastructure), the rest · Maintainers: "Theodore Ts'o", Alexander Viro, Christian Brauner, Linus Torvalds

My static checker complains that this can underflow if arg is negative
which is true.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b1a3471..a2a17e9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1576,7 +1576,7 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
 	} else if (token == Opt_min_batch_time) {
 		sbi->s_min_batch_time = arg;
 	} else if (token == Opt_inode_readahead_blks) {
-		if (arg && (arg > (1 << 30) || !is_power_of_2(arg))) {
+		if (arg && (arg > (1U << 30) || !is_power_of_2(arg))) {
 			ext4_msg(sb, KERN_ERR,
 				 "EXT4-fs: inode_readahead_blks must be "
 				 "0 or a power of 2 smaller than 2^31");
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help