diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2009-01-23 11:03:24 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:26 -0500 |
commit | 9752a7bd7f36557f34283f5d75dfa32578437f08 (patch) | |
tree | e936bbb3fb126c85d2ed3afd1e473c657776c647 /drivers/net/wireless/rt2x00/rt73usb.c | |
parent | 6ba265e9cc764bc401cda284954cf2bdd4408c38 (diff) |
rt2x00: Restrict firmware file lengths
Add extra security to the drivers for firmware loading,
check the firmware file length before uploading it to
the hardware. Incorrect lengths might indicate a firmware
upgrade (which is not yet supported by the driver) or
otherwise incorrect firmware.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 60c43c11bc17..f854551be75d 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1085,6 +1085,11 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data, | |||
1085 | int status; | 1085 | int status; |
1086 | u32 reg; | 1086 | u32 reg; |
1087 | 1087 | ||
1088 | if (len != 2048) { | ||
1089 | ERROR(rt2x00dev, "Invalid firmware file length (len=%zu)\n", len); | ||
1090 | return -ENOENT; | ||
1091 | } | ||
1092 | |||
1088 | /* | 1093 | /* |
1089 | * Wait for stable hardware. | 1094 | * Wait for stable hardware. |
1090 | */ | 1095 | */ |