Skip to content

Commit 114ca32

Browse files
author
Thadeu Lima de Souza Cascardo
committed
UBUNTU: SAUCE: vfs: test that one given mount param is not larger than PAGE_SIZE
In order to avoid potential overflows, test that one given mount parameter is not larger than PAGE_SIZE when parsing it through legacy_parse_param. Suggested-by: Stefan Bader <stefan.bader@canonical.com> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> CVE-2022-0185 Acked-by: Andy Whitcroft <andy.whitcroft@canonical.com> Acked-by: Ben Romer <ben.romer@canonical.com>
1 parent 1a45191 commit 114ca32

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/fs_context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)
585585
param->key);
586586
}
587587

588-
if (size + len + 2 > PAGE_SIZE)
588+
if (len > PAGE_SIZE || size + len + 2 > PAGE_SIZE)
589589
return invalf(fc, "VFS: Legacy: Cumulative options too large");
590590
if (strchr(param->key, ',') ||
591591
(param->type == fs_value_is_string &&

0 commit comments

Comments
 (0)