fs: prevent overwriting reserved memory
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Mon, 14 Jan 2019 21:38:19 +0000 (22:38 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 16 Jan 2019 21:37:05 +0000 (16:37 -0500)
commitaa3c609e2be5a837e7b81e308d47f55b67666bd6
tree4e1e3090b5ec43ed88cc2790c080b2a790679d78
parent4cc8af8037ebabd674d0a6bed202b0c711dc7699
fs: prevent overwriting reserved memory

This fixes CVE-2018-18440 ("insufficient boundary checks in filesystem
image load") by using lmb to check the load size of a file against
reserved memory addresses.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
fs/fs.c
include/lmb.h
lib/lmb.c