summaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/param.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2008-10-01 17:18:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-01 17:31:25 -0700
commit4a7703582836f55a1cbad0e2c1c6ebbee3f9b3a7 (patch)
tree8ebe25b1ef16c8fd4ced6d356232ddca94ef97a2 /drivers/net/e1000e/param.c
parent20b918dc77b383e9779dafceee3f2198a6f7b0e5 (diff)
downloadblackbird-op-linux-4a7703582836f55a1cbad0e2c1c6ebbee3f9b3a7.tar.gz
blackbird-op-linux-4a7703582836f55a1cbad0e2c1c6ebbee3f9b3a7.zip
e1000e: write protect ICHx NVM to prevent malicious write/erase
Set the hardware to ignore all write/erase cycles to the GbE region in the ICHx NVM. This feature can be disabled by the WriteProtectNVM module parameter (enabled by default) only after a hardware reset, but the machine must be power cycled before trying to enable writes. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> CC: arjan@linux.intel.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/e1000e/param.c')
-rw-r--r--drivers/net/e1000e/param.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
index ed912e023a72..d91dbf7ba434 100644
--- a/drivers/net/e1000e/param.c
+++ b/drivers/net/e1000e/param.c
@@ -133,6 +133,15 @@ E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
*/
E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
+/*
+ * Write Protect NVM
+ *
+ * Valid Range: 0, 1
+ *
+ * Default Value: 1 (enabled)
+ */
+E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]");
+
struct e1000_option {
enum { enable_option, range_option, list_option } type;
const char *name;
@@ -388,4 +397,25 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
opt.def);
}
}
+ { /* Write-protect NVM */
+ const struct e1000_option opt = {
+ .type = enable_option,
+ .name = "Write-protect NVM",
+ .err = "defaulting to Enabled",
+ .def = OPTION_ENABLED
+ };
+
+ if (adapter->flags & FLAG_IS_ICH) {
+ if (num_WriteProtectNVM > bd) {
+ unsigned int write_protect_nvm = WriteProtectNVM[bd];
+ e1000_validate_option(&write_protect_nvm, &opt,
+ adapter);
+ if (write_protect_nvm)
+ adapter->flags |= FLAG_READ_ONLY_NVM;
+ } else {
+ if (opt.def)
+ adapter->flags |= FLAG_READ_ONLY_NVM;
+ }
+ }
+ }
}
OpenPOWER on IntegriCloud