]> git.ipfire.org Git - thirdparty/grub.git/commit
kern/parser: Fix a stack buffer overflow
authorChris Coulson <chris.coulson@canonical.com>
Thu, 7 Jan 2021 19:21:03 +0000 (19:21 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:19 +0000 (15:54 +0100)
commit4ea7bae51f97e49c84dc67ea30b466ca8633b9f6
tree7d15dc984b5f2d434058f5fd5c4024df6f3ef6fd
parent030fb6c4fa354cdbd6a8d6903dfed5d36eaf3cb2
kern/parser: Fix a stack buffer overflow

grub_parser_split_cmdline() expands variable names present in the supplied
command line in to their corresponding variable contents and uses a 1 kiB
stack buffer for temporary storage without sufficient bounds checking. If
the function is called with a command line that references a variable with
a sufficiently large payload, it is possible to overflow the stack
buffer via tab completion, corrupt the stack frame and potentially
control execution.

Fixes: CVE-2020-27749
Reported-by: Chris Coulson <chris.coulson@canonical.com>
Signed-off-by: Chris Coulson <chris.coulson@canonical.com>
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/parser.c