CWE-1222: Insufficient Granularity of Address Regions Protected by Register Locks

Description

The product defines a large address region protected from modification by the same register lock control bit. This results in a conflict between the functional requirement that some addresses need to be writable by software during operation and the security requirement that the system configuration lock bit must be set during the boot process.

Submission Date :

Dec. 12, 2019, midnight

Modification Date :

2023-06-29 00:00:00+00:00

Organization :

Intel Corporation
Extended Description

Integrated circuits and hardware IPs can expose the device configuration controls that need to be programmed after device power reset by a trusted firmware or software module (commonly set by BIOS/bootloader) and then locked from any further modification. In hardware design, this is commonly implemented using a programmable lock bit which enables/disables writing to a protected set of registers or address regions. When the programmable lock bit is set, the relevant address region can be implemented as a hardcoded value in hardware logic that cannot be changed later.

A problem can arise wherein the protected region definition is not granular enough. After the programmable lock bit has been set, then this new functionality cannot be implemented without change to the hardware design.

Example Vulnerable Codes

Example - 1

For example, consider a hardware unit with a 32 kilobyte configuration address space where the first 8 kilobyte address contains security sensitive controls that must only be writable by device bootloader. One way to protect the security configuration could be to define a 32 bit system configuration locking register (SYS_LOCK) where each bit lock locks the corresponding 1 kilobyte region.

<xhtml_table><xhtml_tbody><xhtml_tr><xhtml_th>Address</xhtml_th><xhtml_th>Register</xhtml_th></xhtml_tr><xhtml_tr><xhtml_td>0x0000</xhtml_td><xhtml_td>SYS_LOCK: 32 bit system configuration lock register, each bit is write-1-once</xhtml_td></xhtml_tr><xhtml_tr><xhtml_td>0x0004</xhtml_td><xhtml_td>SECURITY_FEATURE_ENABLE: 32 bit register controlling enabling of security features</xhtml_td></xhtml_tr><xhtml_tr><xhtml_td>...</xhtml_td><xhtml_td></xhtml_td></xhtml_tr><xhtml_tr><xhtml_td>0x0310</xhtml_td><xhtml_td>SW_MODE: 32 bit Software Mode indication register </xhtml_td></xhtml_tr></xhtml_tbody></xhtml_table><xhtml_table><xhtml_tbody><xhtml_tr><xhtml_th>Address region</xhtml_th><xhtml_th>Lock bit</xhtml_th></xhtml_tr><xhtml_tr><xhtml_td>0x0000 - 0x03FF</xhtml_td><xhtml_td>SYS_LOCK[0]</xhtml_td></xhtml_tr><xhtml_tr><xhtml_td>0x0400 - 0x07FF</xhtml_td><xhtml_td>SYS_LOCK[1]</xhtml_td></xhtml_tr><xhtml_tr><xhtml_td>...</xhtml_td><xhtml_td></xhtml_td></xhtml_tr><xhtml_tr><xhtml_td>0x7C00 - 0x7FFF</xhtml_td><xhtml_td>SYS_LOCK[31]</xhtml_td></xhtml_tr></xhtml_tbody></xhtml_table>

If a register exists within the first kilobyte address range (e.g. SW_MODE, address 0x310) and needs to be software writable at runtime, then this register cannot be written in a securely configured system since SYS_LOCK register lock bit 0 must be set to protect other security settings (e.g. SECURITY_FEATURE_ENABLE, address 0x0004). The only fix would be to change the hardware logic or not set the security lock bit.

Related Weaknesses

This table shows the weaknesses and high level categories that are related to this weakness. These relationships are defined to give an overview of the different insight to similar items that may exist at higher and lower levels of abstraction.

Visit http://cwe.mitre.org/ for more details.

© cvefeed.io
Latest DB Update: Nov. 24, 2024 2:17