Skip to content

Commit

Permalink
UBUNTU: SAUCE: vfs: test that one given mount param is not larger tha…
Browse files Browse the repository at this point in the history
…n 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>
  • Loading branch information
Thadeu Lima de Souza Cascardo committed Jan 13, 2022
1 parent bcad6a0 commit e6b6d59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fs_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)
param->key);
}

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

0 comments on commit e6b6d59

Please sign in to comment.