bios-linker-loader: document+validate input

While guest/host ABI is documented in hw/acpi/bios-linker-loader.c,
the API was left undocumented.

This adds documentation for all API functions.

Additionally, input is validated to make sure all
pointers fall within range of provided files.

To allow this validation for checksum commands,
bios_linker_loader_add_checksum is changed to accept GArray * in place
of void *.

Reported-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2016-02-21 12:41:55 +02:00
parent 8eb779e422
commit b54ca0c3df
5 changed files with 92 additions and 9 deletions

View file

@ -13,7 +13,7 @@ void bios_linker_loader_alloc(GArray *linker,
bool alloc_fseg);
void bios_linker_loader_add_checksum(GArray *linker, const char *file,
void *table,
GArray *table,
void *start, unsigned size,
uint8_t *checksum);