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:53:36 +0000 (08:53 -0700)
commita300c6a9c5f865eb559ed8e1096e24daa891cb72
tree529c20b6b2e3b2259f98d56179fcd28f2c68c6f2
parent6a10afa7444b9fafa9b13bd4d82c9eb093f09bc9
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