Exploring Qualcomm Baseband via ModKit
Tencent Blade Team Tencent Security Platform Department
Exploring Qualcomm Baseband via ModKit Tencent Blade Team Tencent - - PowerPoint PPT Presentation
Exploring Qualcomm Baseband via ModKit Tencent Blade Team Tencent Security Platform Department About Us - Tencent Blade Team A security research team from Tencent Security Platform Department Focus security research on AI, IoT and
Tencent Blade Team Tencent Security Platform Department
Department
Fabric & Memory Controller Multicore Kryo CPU Hexagon aDSP System Fabric Modem Adreno GPU Multimedia Fabric Hexagon mDSP LPDDR4 Camera Display Other Audio Sensors Cache Application DSP: Real Time media & sensor processing Modem DSP: Dedicated modem processing Application Processor
memory
TrustZone will verify mba.mbn according mba.mdt Linux Kernel load mba.mdt to memory by DMA Load mba.mbn to memory by DMA Reset Modem Subsystem to run mba image Load modem.mdt to memory by DMA Trigger mba to verify modem.mdt by writing registers Load modem.bxx to memory by DMA Modem image running Trigger mba to verify them by writing registers
MBA Modem
Application Processor via SMEM (Shared Memory)
Modem and Linux
is 0x200000
HLOS Memory Shared Memory DSP Memory Memory Protection Units Application Processor Hexagon Processor
DDR
Linux Modem
Channel SMD APIs SMEM APIs Physical Shared Memory Channel SMD APIs SMEM APIs
Application Processor Hexagon Processor
We can learn:
hash after located pattern
identify state and how to transfer from states
byte) + Type(1 byte) + ID(1 byte)
UMID
8 states and 30 messages to drive lte_rrc_controller run
Initialize Code Demon Thread qurt_mapping_create Patch memload_fault_handler Patch Dynamic Condition Code Code base C0000420 Breakpoint Command Result Run Status Demon Command Type & Parameters Demon Command Result Breakpoint Command Type & Parameters C2AA7000 Shared Memory base C2AA7000 C2AA7008 C2AA7040 C2AA7108 C2AA7140 Condition Command Type & Parameters C2AA7200 Breakpoint Original Code
Debug Server Code Base Shared Memory Base
Shared Memory Linux Modem Command Queue Initialize Code Demon Thread Handle Commands
Read Memory Write Memory Setup Breakpoint Setup Condition
Result Buffer BreakPoint Handler BreakPointA
C0C9AF6C JUMP 41784B7C C0C9AF6C JUMP Handler C1000004 MOV Condition Handler Handle Debug Commands Restore Running Status Execute original instructions NOP
Inject debug server
Store Running Status Jump back 41784B7C
Demon Thread Handle Commands
Setup Breakpoint
BreakPoint Handler
Condition Handler Handle Debug Commands Restore Running Status Execute original instructions NOP Store Running Status Jump back 41784B7C
API Name Usage Address[1]
qurt_tlb_entry_read Read original TLB info [2] trap0(#0x45) [3] qurt_tlb_entry_set Modify TLB flags to RWX trap0(#0x44) [3] pthread_create Create Demon Thread C1758A60 pthread_attr_init Init Demon Thread Attribute C1758C20 qurt_mapping_create Hook to modify mapping attribute to RWX C173F3D4 memload_fault_handler Hook to modify code of D0000000 C0CAF0E8 [1] Address of Android factory image sailfish-nde63h [2] TLB - Translation Lookaside Buffer [3] The number may be different from versions. But the code sequence are similar. You can search the code sequence to find the function.
RF link manager
(src\rflm\)
RF transceiver
(src\rfdevice_wtr*\)
RF front end
(src\rfdevice_qfe*\)
Antenna control
Physical layer
(src\lte\ML1\)
MAC layer
(src\lte\L2\mac\)
RLC layer
(src\lte\L2\rlc\)
PDCP layer
(src\lte\L2\pdcp\)
RRC layer IP protocol TCP, UDP, etc NAS layer
IP based network stack, general purpose data channel LTE physical and link layer Upper control layers (attach, authentication, query info, etc…) Other RF technology such as WCDMA, TDSCDMA
EMM layer
RF driver and hardware
LTE TDSCDMA EVDO (HDR) GSM CDMA 1X WCDMA
needed
OTA packet can be modified using srslte and contain lots of buffer processing OTA packet has encrypted or protected, but modem still accept some of the message even it has not encrypted
MIB (synchronization and get physical layer information)
R
SIB1 (cell information and the scheduling of the other SIBs)
R
SIB2 (downlink and uplink channel configuration)
R
PRACH (synchronization uplink)
S
R
RACH (synchronization uplink)
R
RRCConnectionRequest
S
RRCConnectionSetup
R
RRCConnectionSetupComplete (and attach request for NAS)
S
RRCDownlinkInformationTransfer (and auth request for NAS)
R
RRCUplinkInformationTransfer (and auth response for NAS)
S
RRCDownlinkInformationTransfer (and other request for NAS)
R
…
SIBs is easy to send and it will be received and processed by modem at any time
and virtual address 0xC0000000 (Google Pixel)