<s>
System	B-Architecture
Management	I-Architecture
Mode	I-Architecture
(	O
SMM	O
,	O
sometimes	O
called	O
ring	O
−2	O
in	O
reference	O
to	O
protection	B-Operating_System
rings	I-Operating_System
)	O
is	O
an	O
operating	O
mode	O
of	O
x86	B-Operating_System
central	O
processor	O
units	O
(	O
CPUs	O
)	O
in	O
which	O
all	O
normal	O
execution	O
,	O
including	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
is	O
suspended	O
.	O
</s>
<s>
An	O
alternate	O
software	O
system	O
which	O
usually	O
resides	O
in	O
the	O
computer	O
's	O
firmware	B-Application
,	O
or	O
a	O
hardware-assisted	O
debugger	B-Application
,	O
is	O
then	O
executed	O
with	O
high	O
privileges	O
.	O
</s>
<s>
AMD	O
implemented	O
Intel	O
's	O
SMM	O
with	O
the	O
Am386	B-Device
processors	O
in	O
1991	O
.	O
</s>
<s>
It	O
is	O
available	O
in	O
all	O
later	O
microprocessors	B-Architecture
in	O
the	O
x86	B-Operating_System
architecture	I-Operating_System
.	O
</s>
<s>
Some	O
ARM	B-Architecture
processors	I-Architecture
also	O
include	O
the	O
Management	O
Mode	O
,	O
for	O
the	O
system	O
firmware	B-Application
(	O
such	O
as	O
UEFI	B-Architecture
)	O
.	O
</s>
<s>
It	O
is	O
intended	O
for	O
use	O
only	O
by	O
system	O
firmware	B-Application
(	O
BIOS	B-Operating_System
or	O
UEFI	B-Architecture
)	O
,	O
not	O
by	O
applications	O
software	O
or	O
general-purpose	O
systems	O
software	O
.	O
</s>
<s>
The	O
main	O
benefit	O
of	O
SMM	O
is	O
that	O
it	O
offers	O
a	O
distinct	O
and	O
easily	O
isolated	O
processor	O
environment	O
that	O
operates	O
transparently	O
to	O
the	O
operating	B-General_Concept
system	I-General_Concept
or	O
executive	O
and	O
software	O
applications	O
.	O
</s>
<s>
The	O
SMM	O
can	O
only	O
be	O
entered	O
through	O
SMI	O
(	O
System	B-Architecture
Management	I-Architecture
Interrupt	I-Architecture
)	O
.	O
</s>
<s>
The	O
processor	O
executes	O
the	O
SMM	O
code	O
in	O
a	O
separate	O
address	O
space	O
(	O
SMRAM	B-Architecture
)	O
that	O
has	O
to	O
be	O
made	O
inaccessible	O
to	O
other	O
operating	O
modes	O
of	O
the	O
CPU	O
by	O
the	O
firmware	B-Application
.	O
</s>
<s>
System	B-Architecture
Management	I-Architecture
Mode	I-Architecture
can	O
address	O
up	O
to	O
4GB	O
memory	O
as	O
huge	B-Device
real	I-Device
mode	I-Device
.	O
</s>
<s>
In	O
x86-64	B-Device
processors	O
,	O
SMM	O
can	O
address	O
>4GB	O
memory	O
as	O
real	O
address	O
mode	O
.	O
</s>
<s>
Initially	O
,	O
System	B-Architecture
Management	I-Architecture
Mode	I-Architecture
was	O
used	O
for	O
implementing	O
power	O
management	O
and	O
hardware	O
control	O
features	O
like	O
Advanced	B-Device
Power	I-Device
Management	I-Device
(	O
APM	O
)	O
.	O
</s>
<s>
However	O
,	O
BIOS	B-Operating_System
manufacturers	O
and	O
OEMs	O
have	O
relied	O
on	O
SMM	O
for	O
newer	O
functionality	O
like	O
Advanced	B-Device
Configuration	I-Device
and	I-Device
Power	I-Device
Interface	I-Device
(	O
ACPI	B-Device
)	O
.	O
</s>
<s>
Some	O
uses	O
of	O
the	O
System	B-Architecture
Management	I-Architecture
Mode	I-Architecture
are	O
:	O
</s>
<s>
System	B-Architecture
Management	I-Architecture
Mode	I-Architecture
can	O
also	O
be	O
abused	O
to	O
run	O
high-privileged	O
rootkits	O
,	O
as	O
demonstrated	O
at	O
Black	O
Hat	O
2008	O
and	O
2015	O
.	O
</s>
<s>
SMM	O
is	O
entered	O
via	O
the	O
SMI	O
(	O
system	B-Architecture
management	I-Architecture
interrupt	I-Architecture
)	O
,	O
which	O
is	O
invoked	O
by	O
:	O
</s>
<s>
Software	O
SMI	O
triggered	O
by	O
the	O
system	B-Application
software	I-Application
via	O
an	O
I/O	O
access	O
to	O
a	O
location	O
considered	O
special	O
by	O
the	O
motherboard	O
logic	O
(	O
port	O
is	O
common	O
)	O
.	O
</s>
<s>
An	O
I/O	O
write	O
to	O
a	O
location	O
which	O
the	O
firmware	B-Application
has	O
requested	O
that	O
the	O
processor	O
chip	O
act	O
on	O
.	O
</s>
<s>
By	O
design	O
,	O
the	O
operating	B-General_Concept
system	I-General_Concept
cannot	O
override	O
or	O
disable	O
the	O
SMI	O
.	O
</s>
<s>
Due	O
to	O
this	O
fact	O
,	O
it	O
is	O
a	O
target	O
for	O
malicious	O
rootkits	O
to	O
reside	O
in	O
,	O
including	O
NSA	O
's	O
"	O
implants	O
"	O
,	O
which	O
have	O
individual	O
code	O
names	O
for	O
specific	O
hardware	O
,	O
like	O
SOUFFLETROUGH	O
for	O
Juniper	O
Networks	O
firewalls	O
,	O
SCHOOLMONTANA	O
for	O
J-series	B-Protocol
routers	I-Protocol
of	O
the	O
same	O
company	O
,	O
DEITYBOUNCE	O
for	O
DELL	O
,	O
or	O
IRONCHEF	O
for	O
HP	B-Device
Proliant	I-Device
servers	O
.	O
</s>
<s>
Improperly	O
designed	O
and	O
insufficiently	O
tested	O
SMM	O
BIOS	B-Operating_System
code	O
can	O
make	O
the	O
wrong	O
assumptions	O
and	O
not	O
work	O
properly	O
when	O
interrupting	O
some	O
other	O
x86	B-Operating_System
operating	O
modes	O
like	O
PAE	B-General_Concept
or	O
64-bit	O
long	B-Application
mode	I-Application
.	O
</s>
<s>
According	O
to	O
the	O
documentation	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
,	O
around	O
2004	O
,	O
such	O
buggy	O
implementations	O
of	O
the	O
USB	B-Protocol
legacy	O
support	O
feature	O
were	O
a	O
common	O
cause	O
of	O
crashes	B-General_Concept
,	O
for	O
example	O
,	O
on	O
motherboards	O
based	O
on	O
the	O
Intel	O
E7505	O
chipset	O
.	O
</s>
<s>
Since	O
the	O
SMM	O
code	O
(	O
SMI	O
handler	O
)	O
is	O
installed	O
by	O
the	O
system	O
firmware	B-Application
(	O
BIOS	B-Operating_System
)	O
,	O
the	O
OS	O
and	O
the	O
SMM	O
code	O
may	O
have	O
expectations	O
about	O
hardware	O
settings	O
that	O
are	O
incompatible	O
,	O
such	O
as	O
different	O
ideas	O
of	O
how	O
the	O
Advanced	B-Device
Programmable	I-Device
Interrupt	I-Device
Controller	I-Device
(	O
APIC	O
)	O
should	O
be	O
set	O
up	O
.	O
</s>
<s>
Operations	O
in	O
SMM	O
take	O
CPU	O
time	O
away	O
from	O
the	O
applications	O
,	O
operating-system	O
kernel	B-Operating_System
and	O
hypervisor	B-Operating_System
,	O
with	O
the	O
effects	O
magnified	O
for	O
multicore	O
processors	O
,	O
since	O
each	O
SMI	O
causes	O
all	O
cores	O
to	O
switch	O
modes	O
.	O
</s>
<s>
There	O
is	O
also	O
some	O
overhead	O
involved	O
with	O
switching	O
in	O
and	O
out	O
of	O
SMM	O
,	O
since	O
the	O
CPU	O
state	O
must	O
be	O
stored	O
to	O
memory	O
(	O
SMRAM	B-Architecture
)	O
and	O
any	O
write-back	O
caches	O
must	O
be	O
flushed	O
.	O
</s>
<s>
This	O
can	O
destroy	O
real-time	B-General_Concept
behavior	O
and	O
cause	O
clock	B-Operating_System
ticks	I-Operating_System
to	O
get	O
lost	O
.	O
</s>
<s>
The	O
Windows	O
and	O
Linux	B-Operating_System
kernels	I-Operating_System
define	O
an	O
"	O
SMI	O
Timeout	O
"	O
setting	O
a	O
period	O
within	O
which	O
SMM	O
handlers	O
must	O
return	O
control	O
to	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
or	O
it	O
will	O
"	O
hang	B-General_Concept
"	O
or	O
"	O
crash	B-General_Concept
"	O
.	O
</s>
<s>
The	O
SMM	O
may	O
disrupt	O
the	O
behavior	O
of	O
real-time	B-General_Concept
applications	I-General_Concept
with	O
constrained	O
timing	O
requirements	O
.	O
</s>
<s>
Recovering	O
the	O
SMI	O
handler	O
code	O
to	O
analyze	O
it	O
for	O
bugs	O
,	O
vulnerabilities	O
and	O
secrets	O
requires	O
a	O
logic	O
analyzer	O
or	O
disassembly	O
of	O
the	O
system	O
firmware	B-Application
.	O
</s>
