]> asedeno.scripts.mit.edu Git - linux.git/commit
pstore/ram: Add kmsg hlen zero check to ramoops_pstore_write()
authorYue Hu <huyue2@yulong.com>
Fri, 1 Feb 2019 03:27:32 +0000 (11:27 +0800)
committerKees Cook <keescook@chromium.org>
Tue, 12 Feb 2019 20:38:54 +0000 (12:38 -0800)
commit47afd7ae65c737bfef67e9eb1424723d13b06787
tree11a20edce466b8bbe77ecfc9fedd7bb19110dc85
parent1e0f67a96aedd0b5fbd3ae743e68a26606ea98e8
pstore/ram: Add kmsg hlen zero check to ramoops_pstore_write()

If zero-length header happened in ramoops_write_kmsg_hdr(), that means
we will not be able to read back dmesg record later, since it will be
treated as invalid header in ramoops_pstore_read(). So we should not
execute the following code but return the error.

Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/ram.c