efivars: Improve variable validation
authorMatthew Garrett <mjg@redhat.com>
Thu, 3 May 2012 20:50:46 +0000 (16:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 May 2012 15:56:38 +0000 (08:56 -0700)
commitecc53109a021559a49beb81c9c4c859012ee975e
treeaf0bceb7778e6a23bfff8075e6f8408bb06d7b06
parent173c412ef8f37d781eb90f5cc8eeab118b987e68
efivars: Improve variable validation

commit 54b3a4d311c98ad94b737802a8b5f2c8c6bfd627 upstream.

Ben Hutchings pointed out that the validation in efivars was inadequate -
most obviously, an entry with size 0 would server as a DoS against the
kernel. Improve this based on his suggestions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efivars.c