System Management Mode
|This article needs additional citations for verification. (November 2010)|
|Microprocessor modes for the x86 architecture|
|First supported platform shown in parentheses|
System Management Mode (SMM) is an operating mode in which all normal execution (including the operating system) is suspended, and special separate software (usually firmware or a hardware-assisted debugger) is executed in high-privilege mode.
It was first released with the Intel 386SL. While initially special SL versions were required for SMM, Intel incorporated SMM in its mainline 486 and Pentium processors in 1993. AMD copied Intel's SMM with the Enhanced Am486 processors in 1994. It is available in all later microprocessors in the x86 architecture.
SMM is a special-purpose operating mode provided for handling system-wide functions like power management, system hardware control, or proprietary OEM designed code. It is intended for use only by system firmware, not by applications software or general-purpose systems software. The main benefit of SMM is that it offers a distinct and easily isolated processor environment that operates transparently to the operating system or executive and software applications.
In order to achieve transparency, SMM imposes certain rules. The SMM can only be entered through SMI (System Management Interrupt). The processor executes the SMM code in a separate address space that is inaccessible to other operating modes of the CPU.
Some uses of the System Management Mode are:
- Handle system events like memory or chipset errors.
- Manage system safety functions, such as shutdown on high CPU temperature and turning the fans on and off.
- Security functions, such as flash device lock down require SMM support on some chipsets.
- Deeper sleep power management support on Intel systems.
- Control power management operations, such as managing the voltage regulator modules.
- Emulate motherboard hardware that is unimplemented or buggy.
- Emulate a PS/2 mouse and/or keyboard by converting the messages from USB versions of those peripherals to the messages that would have been generated had PS/2 versions of such hardware been connected (often referred to as USB legacy support).
- Centralize system configuration, such as on Toshiba and IBM notebook computers.
- Breaking into SMM to run high-privileged rootkits as shown at Black Hat 2008.
- Emulate or forward calls to a Trusted Platform Module (TPM).
SMM is entered via the SMI (system management interrupt), which is caused by:
- Motherboard hardware or chipset signaling via a designated pin SMI# of the processor chip. This signal can be an independent event.
- Software SMI triggered by the system software via an I/O access to a location considered special by the motherboard logic (port 0B2h is common).
- An IO write to a location which the firmware has requested that the processor chip act on.
- By design, the operating system cannot override or disable the SMI. Due to this fact, it is a target for malicious rootkits to reside in.
- Since the SMM code (SMI handler) is installed by the system firmware (BIOS), the OS and the SMM code may have expectations about hardware settings that are incompatible, such as different ideas of how the Advanced Programmable Interrupt Controller (APIC) should be set up.
- Operations in SMM take CPU time away from the OS, since the CPU state must be stored to memory (SMRAM) and any write-back caches must be flushed. This can destroy real-time behavior and cause clock ticks to get lost. The Windows and Linux kernels define an ‘SMI Timeout’ setting a period within which SMM handlers must return control to the operating system or it will ‘hang’ or ‘crash’.
- The SMM may disrupt the behavior of real-time applications with constrained timing requirements.
- A digital logic analyzer may be required to determine if the CPU has entered SMM (checking state of SMIACT# pin of CPU).
- Recovering the SMI handler code to analyze it for bugs, vulnerabilities and secrets requires a logic analyzer or disassembly of the system firmware.
- MediaGX processor which implements nonexistent hardware via SMM
- Intel 80486SL
- Extensible Firmware Interface (EFI)
- Coreboot implements an open source SMM/SMI handler for some chipsets
- Intel 32/64 Architectures Software Developer’s Manual Volume 3B: System Programming Guide, Part 2
- Vojtech Pavlik (January 2004). "Linux kernel documentation". USB Legacy support. kernel.org. Retrieved 2013-10-06.
- Hackers find a new place to hide rootkits
- http://www.youtube.com/watch?v=X72LgcMpM9k&feature=player_detailpage#t=2070s Google Tech Talks - Coreboot - 00:34:30
- Intel's System Management Mode by Robert R. Collins
- Loïc Duflot. "Security Issues Related to Pentium System Management Mode" (PDF). Retrieved 2013-10-06.
- Shawn Embleton; Sherri Sparks; Cliff Zou (September 2008). "SMM Rootkits: A New Breed of OS Independent Malware" (PDF). ACM. Retrieved 2013-10-06.
- "Hackers Find a New Place to Hide Rootkits". PC World. 2008-05-09. Retrieved 2013-10-06.
- Matthieu Suiche (2008). "SMM Rootkit limitations, and how to defeat it". Retrieved 2013-10-06.