Artificial truth

The more you see, the less you believe.

[archives] [latest] | [homepage] | [atom/rss]

1802: Unauthorized network card is plugged in - Power off and remove the miniPCI network card on X31
Wed 24 July 2013 — download

Today, a friend of mine complained about a weird error when she booted her Thinkpad X31:

  1802: Unauthorized network card is plugged in - Power off and remove the miniPCI network card.

This was likely triggered by the fact that the BIOS battery is almost dead. I searched on Thinkwiki, and stumbled upon this page.

It seems that IBM does not want you to put whatever hardware you want in your own computer: on boot, the BIOS checks your pci cards against a whitelist :( Fortunately, Paul Sladen and Matthew Garrett have documented how to bypass this, an even spoke about this on the LKML.

If you are too lazy to read this material, here is the source code (also available on thinkwiki) to patch your BIOS, to bypass the whitelist:

Here it is:

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(void) {
  int fd;
  unsigned char data;

  fd = open ("/dev/nvram", O_RDWR);
  if (fd==-1) {
    printf("Opening /dev/nvram failed\n");
    return 1;
  }
  printf("Disabling WiFi whitelist check.\n");

  /* BIG INFORMATIONAL WARNING */
  /* The linux nvram driver doesn't give access to the first 14 bytes of
     the CMOS. As a result, we seek to 0x5c rather than 0x6a. If you're
     implementing this under another OS, then you'll have to go to whichever
     address is appropriate for your access method */

  lseek (fd, 0x5c, SEEK_SET);
  read (fd, &data, 1);
  printf ("CMOS address 0x5c: %02x->", data);
  data |= 0x80;
  printf ("%02x\n", data);
  lseek (fd, 0x5c, SEEK_SET);
  if (write (fd, &data, 1) < 0) {
    printf("Unable to write to /dev/nvram - hack failed\n");
    close(fd);
    return 2;
  }
  close (fd);
  printf ("Done.\n");
  return 0;
}

Compile it, run it as root, reboot, et voila !