acrn-hypervisor/hypervisor/boot
Zide Chen a0de49d03e hv: fix potential buffer overflow in sbl_init_vm_boot_info()
To merge the multiboot bootargs within sbl_init_vm_boot_info(), buffer
overflow could happen when it doesn't provide correct 'dmax' argument
to strncpy_s().

Also, currently it doesn't check the availability of the dest buffer before
overwriting '\0' with a whitespace, which theoretically the dest string
could end up with no null terminator within it's array boundary.

This patch also creates a separate function to merge the cmdline strings,
because after the above fixes some lines in sbl_init_vm_boot_info()
function could have up to 7 tabs in front of the first character, which
looks messy and sbl_init_vm_boot_info() is getting too complicated.

Tracked-On: #2806
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-03-20 15:12:21 +08:00
..
include hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
sbl hv: fix potential buffer overflow in sbl_init_vm_boot_info() 2019-03-20 15:12:21 +08:00
uefi HV: Modularize boot folder 2019-03-14 09:05:53 +08:00
acpi.c hv: merge SBL and UEFI related stuff under boot 2019-03-13 10:26:55 +08:00
dmar_parse.c HV: Modularize boot folder 2019-03-14 09:05:53 +08:00
reloc.c hv: cleanup some hva/hpa conversion code 2019-03-15 09:03:14 +08:00