Jump to content

Host protected area

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Dimmer (talk | contribs) at 00:07, 3 June 2009 (→‎Manipulation tools: Removing seagate utility - I just downloaded this and it does not have the functionality to modify HPA!). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The host protected area, sometimes referred to as hidden protected area[1], is an area of a hard drive that is not normally visible to an operating system(OS).

History

HPA was first introduced in the ATA-4 standard (T13, 2001).[2]

How it works

Creation of an HPA. The diagram shows how a host protected area (HPA) is created.
# IDENTIFY DEVICE returns the true size of the hard drive. READ NATIVE MAX ADDRESS returns the true size of the hard drive. # SET MAX ADDRESS reduces the reported size of the hard drive. READ NATIVE MAX ADDRESS returns the true size of the hard drive. An HPA has been created. # IDENTIFY DEVICE returns the now fake size of the hard drive. READ NATIVE MAX ADDRESS returns the true size of the hard drive, the HPA is in existence.

The IDE controller has registers that contain data that can be queried using ATA commands. The data returned gives information about the drive attached to the controller. There are three ATA commands involved in creating and utilizing a hidden protected area. The commands are:

  • IDENTIFY DEVICE
  • SET MAX ADDRESS
  • READ NATIVE MAX ADDRESS

Operating systems use the IDENTIFY DEVICE command to find out the addressable space of a hard drive. The IDENTIFY DEVICE command queries a particular register on the IDE controller to establish the size of a drive.

This register however can be changed using the SET MAX ADDRESS ATA command. If the value in the register is set to less than the actual hard drive size then effectively a host protected area is created. It is protected because the OS will work with only the value in the register that is returned by the IDENTIFY DEVICE command and thus will never be able to address the parts of the drive that lie within the HPA.

The HPA is useful only if other software or firmware (e.g. BIOS) is able to utilize it. Software and firmware that are able to utilize the HPA are referred to as 'HPA aware'. The ATA command that these entities use is called READ NATIVE MAX ADDRESS. This command accesses a register that contains the true size of the hard drive. To use the area the controlling HPA-aware program changes the value of the register read by IDENTIFY DEVICE with that found in the register read by READ NATIVE MAX ADDRESS. When its operations are complete the register read by IDENTIFY DEVICE is returned to its original fake value.

Use

  • HPA can be used by various booting and diagnostic utilities, normally in conjunction with the BIOS. An example of this implementation is the Phoenix FirstBIOS, which utilizes BEER (boot engineering extension record) and PARTIES (protected area run-time interface extension services).
  • Computer manufacturers may use the area to contain a preloaded OS for install and recovery purposes (instead of providing DVD or CD media).
  • Dell notebooks hide Dell Media Direct utility in HPA. IBM and LG notebooks hide system restore software in HPA.
  • HPA is also used by various theft recovery and monitoring service vendors. For example the laptop security firm Computrace use the HPA to load software that reports to their servers whenever the machine is booted on a network. HPA is useful to them because even when a stolen laptop has its hard drive formatted the HPA remains untouched.
  • HPA can also be used to store data that is deemed illegal and is thus of interest to government and police computer forensics teams.
  • Some vendor-specific external drive enclosures (Maxtor) are known to use HPA to limit the capacity of unknown replacement hard drives installed into the enclosure. When this occurs, the drive may appear to be limited in size (e.g. 128 GB), which can look like a BIOS or dynamic drive overlay (DDO) problem. In this case, one must use software utilities (see below) that use READ NATIVE MAX ADDRESS and SET MAX ADDRESS to change the drive's reported size back to its native size, and avoid using the external enclosure again with the affected drive.
  • Some rootkits hide in the HPA to avoid being detected by anti-rootkit and antivirus software.[citation needed]

Identification and manipulation

Identification of HPA on a hard drive can be achieved by a number of tools and methods.

Identification tools

Identification methods

Using Linux, there are a couple of ways to detect the existence of an HPA. The latest Linux versions will print a message when the system is booting. For example:

dmesg | less
[...]
hdb: Host Protected Area detected.
    current capacity is 12000 sectors (6 MB)
    native  capacity is 120103200 sectors (61492 MB)

With program hdparm, version >= 8.0, where X is your drive letter:

 hdparm -N /dev/sdX


For versions of hdparm < 8, one can compare the number of sectors output from 'hdparm -I' with the number of sectors reported for the hard drive model's published statistics.

Manipulation tools

Creating and manipulating HPA on a hard drive can be achieved by a number of tools.

Manipulation Methods

Using the linux program hdparm with version >=8.0 you can permanently modify the HPA directly. Where ABC is the number of visible sectors and X is the drive letter:

sudo hdparm -NpABC /dev/sdX

See also

References