Developer knowledge network · moderated exchange

UnreliableCode 커뮤니티

개발자 연구, 리버스 엔지니어링 및 코딩 커뮤니티

Knowledge index살다
4Categories
919Threads
2.8K게시물
Analysis

Page Table Entry (PTE) manipulation: clearing User/Supervisor bit safely [v2.4 Technical Discussion]

stack_smasher
Kernel Explorer
MEMBER
대표: 111
가입 날짜: Feb 2019
게시물: 30
감사해요: 18
1개월 전 · Jul 16, 2026 10:06 PM
#1

How Page Table Entries (PTEs) govern CPU access permissions:

  • Bit 0 (Present): Page is in physical RAM.
  • Bit 1 (Read/Write): 0 = Read-Only, 1 = Read/Write.
  • Bit 2 (User/Supervisor): 0 = Ring 0 only, 1 = Accessible from Ring 3 (Userland).
  • Bit 63 (NX / XD): No-Execute bit.

Modifying the User/Supervisor bit in a kernel page PTE allows userland code to access kernel buffers directly without syscall overhead. Always invalidate the TLB entry with __invlpg() after modifying PTE bits!

kernel_komrade
Driver Dev
MEMBER
대표: 145
가입 날짜: Feb 2019
게시물: 26
감사해요: 45
1개월 전 · Jul 17, 2026 12:49 AM
#2

Forgetting __invlpg() causes the CPU to use stale cached TLB translation entries and crash. Essential rule.

hypervisor_hank
Kernel Wizard
MEMBER
대표: 108
가입 날짜: Feb 2020
게시물: 17
감사해요: 44
1개월 전 · Jul 17, 2026 9:13 AM
#3

Clean low-level paging architecture breakdown.