]> git.baikalelectronics.ru Git - kernel.git/commit
efi/libstub: prevent read overflow in find_file_option()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Apr 2021 11:48:31 +0000 (14:48 +0300)
committerArd Biesheuvel <ardb@kernel.org>
Sat, 22 May 2021 12:05:32 +0000 (14:05 +0200)
commitdcc800515dcc336c00a397ba0bc084f4e9fc4a9f
treeccd6b4efc351e520ec53e7f828ee907dc8de5d0d
parent9a83105f132767dc2032804594ef9a95949c04b7
efi/libstub: prevent read overflow in find_file_option()

If the buffer has slashes up to the end then this will read past the end
of the array.  I don't anticipate that this is an issue for many people
in real life, but it's the right thing to do and it makes static
checkers happy.

Fixes: 7b164c11cdba ("efi/libstub: Fix path separator regression")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/file.c