]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tg3: fix length overflow in VPD firmware parsing
authorKees Cook <keescook@chromium.org>
Wed, 27 Mar 2013 06:40:50 +0000 (06:40 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Apr 2013 02:20:04 +0000 (03:20 +0100)
commit2b79fa8fddde2d070ca28a2d94394c39bfd8d741
tree8767393c98db01b42179284a26cd999751e573af
parent18698bd2d0debaea5558da85c95e4e4ca34f2bc3
tg3: fix length overflow in VPD firmware parsing

commit 715230a44310a8cf66fbfb5a46f9a62a9b2de424 upstream.

Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.

Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string length (32 bytes). On overflow,
truncate the formatted firmware string instead of potentially overwriting
portions of the tg3 struct.

http://cansecwest.com/slides/2013/PrivateCore%20CSW%202013.pdf

Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Oded Horovitz <oded@privatecore.com>
Reported-by: Brad Spengler <spender@grsecurity.net>
Cc: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/broadcom/tg3.c