efi_loader: validate load option
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 31 May 2020 20:46:09 +0000 (22:46 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 3 Jun 2020 15:19:17 +0000 (17:19 +0200)
commit0e69bcfb27644f9e7c575aa3565bcff922c7dec2
tree1560106fb519adf2d1ac3f6214cc4383df2b0b49
parentecd4d99f654f3f7bfb96001891d69c3125e70b69
efi_loader: validate load option

For passing the optional data of the load option to the loaded imaged
protocol we need its size.

efi_deserialize_load_option() is changed to return the size of the optional
data.

As a by-product we get a partial validation of the load option.
Checking the length of the device path remains to be implemented.

Some Coverity defects identified the load options as user input because
get_unaligned_le32() and get_unaligned_le16() is called. But non of these
Coverity defects can be resolved without marking functions with Coverity
specific tags.

Reported-by: Coverity (CID 303760)
Reported-by: Coverity (CID 303768)
Reported-by: Coverity (CID 303776)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
cmd/efidebug.c
include/efi_loader.h
lib/efi_loader/efi_bootmgr.c