lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <fabce1a485dd985c0e4c16f61f4ddb5e27e49cbf.1257370736.git.inaky@linux.intel.com>
Date:	Wed,  4 Nov 2009 13:39:54 -0800
From:	Inaky Perez-Gonzalez <inaky@...ux.intel.com>
To:	netdev@...r.kernel.org, wimax@...uxwimax.org
Subject: [PATCH 2.6.33/2 13/15] wimax/i2400m: verify firmware format version is known

Make sure the bootloading code checks that the format of the file is
understood (major version match). This also fixes a dumb typo in
extracting the major version field.

Signed-off-by: Inaky Perez-Gonzalez <inaky@...ux.intel.com>
---
 drivers/net/wimax/i2400m/fw.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index eef236d..1fd2fee 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -1179,7 +1179,7 @@ int i2400m_fw_check(struct i2400m *i2400m,
 
 	module_type = bcf->module_type;
 	header_len = sizeof(u32) * le32_to_cpu(bcf->header_len);
-	major_version = le32_to_cpu(bcf->header_version) & 0xffff0000 >> 16;
+	major_version = (le32_to_cpu(bcf->header_version) & 0xffff0000) >> 16;
 	minor_version = le32_to_cpu(bcf->header_version) & 0x0000ffff;
 	module_id = le32_to_cpu(bcf->module_id);
 	module_vendor = le32_to_cpu(bcf->module_vendor);
@@ -1205,6 +1205,12 @@ int i2400m_fw_check(struct i2400m *i2400m,
 		goto error;
 	}
 
+	if (major_version != 1) {
+		dev_err(dev, "%s: major header version v%u.%u not supported\n",
+			i2400m->fw_name, major_version, minor_version);
+		goto error;
+	}
+
 	/* Check soft-er errors */
 	result = 0;
 	if (module_vendor != 0x8086)
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ