Day1_02_Advanced x86 - BIOS and SMM Internals - Chipset Architecture
Day1_02_Advanced x86 - BIOS and SMM Internals - Chipset Architecture
x86:
BIOS
and
System
Management
Mode
Internals
Chipset
Architecture
Xeno
Kovah
&&
Corey
Kallenberg
LegbaCore,
LLC
All materials are licensed under a Creative
Commons “Share Alike” license.
http://creativecommons.org/licenses/by-sa/3.0/
10
Trusted Platform Module (TPM)
• Extends the security functions within the TPM chip to the CPU/
system
• Memory-Mapped (fixed address)
• Software operation is still the same when the ICH is
consolidated into a PCH
Intel
I/O
Controller
Hub
9
Datasheet,
because
it
includes
a
more
complete
block
diagram
11
Evolution to Platform Controller Hub (PCH)
• Bottleneck reduction
• Memory Controller
moved into the CPU
– AMD did this in ~2003
with Athlon64
– Intel ~2008 (Core i-
series CPU)
• Graphics processing
unit too
• The Northbridge was
essentially eliminated
to form a single
component (PCH)
• Overall trend is to
move high-bottleneck
areas closer to the
CPU which has the
fastest clock on the
system
Intel
4-‐Series
Chipset
Datasheet
12
Now everything’s just PCHy
• Shown here is the Intel 5-
series chipset
• First iteration of the
consolidation into a
single Platform Controller
Hub (PCH)
• AMD did similar in 2003,
but I don’t want to throw
too many hardware
diagrams at you (despite
being different at the
hardware level, logically
they are similar if not the
(PCH)
same)
• Better to show you just a
few, explain why they are
the way they are so then
you can interpret new/
different ones yourself
• Processor is starting to
resemble a System On a
Chip (SoC)
Intel
Core
i5-‐600,
i3-‐500
Desktop
Processor
Series,
Intel
PenEum
Desktop
Processor
6000
Series
datasheet
13
Platform Controller Hub (PCH)
(PCH)
• All the ICH components that we cared about for this course are still
present
– From a software standpoint, even their mode of access is the same
• Functionally speaking, most of what we’ll be looking at is agnostic as
to whether its MCH/ICH or PCH
– There are a few exceptions and those will be addressed as they crop up as
well as how you account for them
Intel
Core
i5-‐600,
i3-‐500
Desktop
Processor
Series,
Intel
PenEum
Desktop
Processor
6000
Series
datasheet
14
Aside:
Yeah
it’s
really
gedng
SoCish:
Haswell/Broadwell
mobile
15
Aside:
Intel
does
make
some
SoCs,
their
“Atom”
series.
Out
of
scope
for
today
18
Device 31: LPC Interface Bridge
• Device 31 – Low Pin
Count Interface (LPC)
Bridge
• Located on ICH (or PCH
if it’s a PCH system)
• Implements various
system management
functions
• We reference this
device a lot
• Spec:
http://www.intel.com/
design/chipsets/
industry/25128901.pdf
(Low Pin Count Interface
Specification, Revision
1.1)
19
Datasheet will list all PCI Devices
• So as I said, there are devices which were not included in the chipset diagram
provided by Intel in the Mobile 4-Series datasheet.
• They’re not all important from a security perspective, but provided here for
reference
*Intel I/O Controller Hub 9 datasheet20
Chipset Identification
• Goal: Identify the Chipset and/or Controller Hub
• Reasons: (1) To find the datasheet, and (2) know the locations
of those registers which we will be probing to determine
whether a system is vulnerable
– Some have stayed the same (same name, same offset) over the years (LPC,
BIOS_CNTL) while others have “bounced around a little”
– Our demonstrations/slides are all on the Mobile 4-Series Chipset and IO
Controller Hub Family 9
– However, the functionality provided by these registers still exist in the latest
architecture (assuming they aren’t just still the “same old registers”)
– We want you to be able to locate/analyze these (ie: teaching you to fish)
21
Strategy:
• Many of the registers we care about
are located in two separate devices:
(1) LPC Device, and (2) DRAM-
Controller
• In legacy Chipsets the LPC device is
located in the IO Controller Hub and
DRAM
Controller
the DRAM-Controller is located in the
Memory Controller Hub
Chipset
• The datasheet containing the
Datasheet
information related to the DRAM
controller will be found in the Chipset
datasheet
LPC
Device
• The datasheet containing the LPC-
related information will be found in the
“I/O Controller Hub” datasheet
ICH
Datasheet
22
Strategy:
• Many of the registers we care about
are located in two separate devices:
(1) LPC Device, and (2) DRAM-
Controller
DRAM
Controller
• In Modern "Chipsets" (PCH) the LPC
CPU
device is located in the Platform
Datasheet
Controller Hub and the DRAM-
Controller is located in the Processor
• The datasheet containing the
LPC
Device
information related to the DRAM
controller will be found in the
processor datasheet
"Chipset"
Datasheet
• The datasheet containing the LPC-
related information will be found in the
Chipset datasheet
23
Strategy:
• If your PCI LCP device ID lookup says
something like “Wildcat Point-LP”, that
means you’re using a Broadwell/5th
generation chip
• The DRAM controller / Host Device ID
will still be in the CPU specification
update
• The LCP device ID can be found in
the CPU’s associated “IO datasheet”
24
Strategy: Additional Notes
1. You do not have to know in advance whether the architecture is
a modern chipset or otherwise, the process of identifying the
device ID’s will tell you that
25
Get the LPC Device ID
• Will tell us the Controller Hub family (therefore either ICH datasheet
if legacy or chipset datasheet otherwise)
• Bus 0, Device 31 (1Fh), Function 0, Offset 2 (2-bytes)
• Not sure where RW Everything gets the names of its PCI devices
from
• In this example, the LPC Device ID is 0x2917
26
Device ID Lookup
• http://pciids.sourceforge.net
• http://pci-ids.ucw.cz/ (same site, alternate location)
32
Specification Updates
• For an Intel system, a given device family (Processor, IO
Controller Hub, Chipset) will have a separate datasheet
entitled “Specification Update”
• The spec update provides typo-fixes and such but also
provides the device ID’s for each revision within that particular
device family
33
In
Summary
• DRAM
Controller
/
Host
Bridge
PCI
“Device
IDs”
can
be
found
in
MCH
or
CPU
datasheets
– This
device
will
be
used
to
find
SPI
flash
programming
registers
• LPC
Controller
PCI
“Device
IDs”
can
be
found
in
the
ICH,
PCH,
or
CPU’s
“IO”
“specificaEon
update”
datasheets
– This
device
will
be
used
to
find
SPI
flash
access
control
registers
• These
two
device
IDs
together
provide
all
the
informaEon
we
need
for
idenEficaEon
of
hardware
for
BIOS
security
checks
34
Device
IDs
• I’m
starEng
to
get
Ered
of
spending
the
Eme
it
takes
to
have
everyone
look
this
up,
so
I’ve
started
to
make
a
cheat
sheet
;)
DRAM
Controller/Host
Bridge
• Cheat
sheet
36
MCH/3-‐series-‐chipset-‐family-‐datasheet.pdf
37
MCH/3-‐series-‐express-‐chipset-‐family-‐datasheet.pdf
38
MCH/4-‐series-‐chipset-‐family-‐datasheet.pdf
39
MCH/4-‐series-‐express-‐chipset-‐family-‐datasheet.pdf
40
CPU/1stGen(Nehalem)/Mobile/core-‐mobile-‐datasheet-‐vol-‐2.pdf
CPU/1stGen(Nehalem)/Mobile/core-‐mobile-‐spec-‐update.pdf
41
CPU/2ndGen(SandyBridge)/Mobile/2nd-‐gen-‐core-‐family-‐mobile-‐vol-‐2-‐datasheet.pdf
CPU/2ndGen(SandyBridge)/Mobile/core-‐i7-‐900-‐mobile-‐ee-‐and-‐mobile-‐processor-‐series-‐spec-‐update.pdf
42
CPU/2ndGen(SandyBridge)/Mobile/2nd-‐gen-‐core-‐family-‐mobile-‐vol-‐2-‐datasheet.pdf
CPU/2ndGen(SandyBridge)/Mobile/2nd-‐gen-‐core-‐family-‐mobile-‐specificaEon-‐update.pdf
43
CPU/3rdGen(IvyBridge)/Mobile/3rd-‐gen-‐core-‐family-‐mobile-‐vol-‐2-‐datasheet.pdf
CPU/3rdGen(IvyBridge)/Mobile/3rd-‐gen-‐core-‐family-‐mobile-‐specificaEon-‐update.pdf
44
4th-‐gen-‐core-‐family-‐mobile-‐m-‐h-‐processor-‐lines-‐vol-‐2-‐datasheet.pdf
45
CPU/4thGen(Haswell)/Mobile/4th-‐gen-‐core-‐family-‐mobile-‐u-‐y-‐processor-‐lines-‐vol-‐2-‐datasheet.pdf
46
CPU/4thGen(Haswell)/Mobile/4th-‐gen-‐core-‐family-‐mobile-‐specificaEon-‐update.pdf
47
CPU/5thGen(Broadwell)/5th-‐gen-‐core-‐family-‐datasheet-‐vol-‐2.pdf
CPU/5thGen(Broadwell)/5th-‐gen-‐core-‐family-‐spec-‐update.pdf
48
LPC
Device
datasheets
49
ICH/io-‐controller-‐hub-‐7-‐datasheet.pdf
ICH/io-‐controller-‐hub-‐8-‐datasheet.pdf
ICH/io-‐controller-‐hub-‐9-‐datasheet.pdf
ICH/io-‐controller-‐hub-‐10-‐datasheet.pdf
PCH/5-‐series-‐chipset-‐3400-‐chipset-‐datasheet.pdf
PCH/6-‐series-‐chipset-‐c200-‐chipset-‐datasheet.pdf
PCH/7-‐series-‐chipset-‐pch-‐datasheet.pdf
PCH/8-‐series-‐chipset-‐pch-‐datasheet.pdf
PCH/9-‐series-‐chipset-‐pch-‐datasheet.pdf
CPU/5thGen(Broadwell)/5th-‐gen-‐core-‐family-‐plakorm-‐i-‐o-‐datasheet.pdf
59
Backup
60
Solving Ambiguity: Get LPC Device