Skip to content

Commit 1a45191

Browse files
clubby789Thadeu Lima de Souza Cascardo
authored andcommitted
UBUNTU: SAUCE: vfs: Out-of-bounds write of heap buffer in fs_context.c
The "PAGE_SIZE - 2 - size" calculation is is an unsigned type so a large value of "size" results in a high positive value. This results in heap overflow which can be exploited by a standard user for privilege escalation. Signed-off-by: Jamie Hill-Daniel <jamie@hill-daniel.co.uk> Signed-off-by: William Liu <willsroot@protonmail.com> CVE-2022-0185 Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> Acked-by: Andy Whitcroft <andy.whitcroft@canonical.com> Acked-by: Ben Romer <ben.romer@canonical.com>
1 parent 1f3f89f commit 1a45191

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 (len > PAGE_SIZE - 2 - size)
588+
if (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)