Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
aslr.pdf
Search
Satoru Takeuchi
PRO
January 24, 2022
Technology
0
98
aslr.pdf
Satoru Takeuchi
PRO
January 24, 2022
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
Rook: Intro and Deep Dive With Ceph
sat
PRO
1
98
会社員しながら本を書いてきた知見の共有
sat
PRO
3
770
デバイスにアクセスするデバイスファイル
sat
PRO
1
33
ファイルシステムのデータを ブロックデバイスへの操作で変更
sat
PRO
1
29
デバイスドライバ
sat
PRO
0
45
マルチスレッドの実現方法 ~カーネルスレッドとユーザスレッド~
sat
PRO
2
120
共有メモリ
sat
PRO
3
67
マルチスレッドプログラム
sat
PRO
3
56
Linuxのブートプロセス initramfs編
sat
PRO
2
80
Other Decks in Technology
See All in Technology
5min GuardDuty Extended Threat Detection EKS
takakuni
0
160
Amazon S3標準/ S3 Tables/S3 Express One Zoneを使ったログ分析
shigeruoda
4
570
生まれ変わった AWS Security Hub (Preview) を紹介 #reInforce_osaka / reInforce New Security Hub
masahirokawahara
0
260
2025-06-26_Lightning_Talk_for_Lightning_Talks
_hashimo2
2
100
rubygem開発で鍛える設計力
joker1007
2
220
CursorによるPMO業務の代替 / Automating PMO Tasks with Cursor
motoyoshi_kakaku
1
420
Prox Industries株式会社 会社紹介資料
proxindustries
0
330
TechLION vol.41~MySQLユーザ会のほうから来ました / techlion41_mysql
sakaik
0
190
Github Copilot エージェントモードで試してみた
ochtum
0
110
AWS テクニカルサポートとエンドカスタマーの中間地点から見えるより良いサポートの活用方法
kazzpapa3
2
570
“社内”だけで完結していた私が、AWS Community Builder になるまで
nagisa53
1
410
Should Our Project Join the CNCF? (Japanese Recap)
whywaita
PRO
0
130
Featured
See All Featured
For a Future-Friendly Web
brad_frost
179
9.8k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Scaling GitHub
holman
459
140k
A Tale of Four Properties
chriscoyier
160
23k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
24k
The Cult of Friendly URLs
andyhume
79
6.5k
Raft: Consensus for Rubyists
vanstee
140
7k
Speed Design
sergeychernyshev
32
1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Transcript
Address Space Location Randomization (ASLR) Jan. 8th, 2022 Satoru Takeuchi
twitter: satoru_takeuchi, EnSatoru 1
前回までのあらすじ • Executable and Linking Format(ELF)というフォーマット • 実行ファイルのコードやデータはメモリ上にマップされる • どこのオフセットのデータをどこにマップするるか実行ファイルに書いてる
2 test(実行ファイル) メモリ コード データ コード データ マップ
そうでないこともある • 例: Ubuntu20.04の/bin/sleepコマンド • 演習 ◦ sleepコマンドのreadelf -Sを見てみる ◦
“sleep infinity”実行中のメモリマップを /proc/<pid>/mapsで見てみる 3
そうでないこともある • 例: Ubuntu20.04の/bin/sleepコマンド • 演習 ◦ sleepコマンドのreadelf -Sを見てみる ◦
“sleep infinity”実行中のメモリマップを /proc/<pid>/mapsで見てみる • 違い ◦ 実行ファイルのセクションに書いてあるマップ先アドレスと実際の値が違う 4
演習 • “sleep infinity”をもう一度実行した後にメモリマップを確認 5
演習 • “sleep infinity”をもう一度実行した後にメモリマップを確認 • 結果 ◦ さっきとアドレスが違う! 6
理由 • sleepコマンドは実行するたびにセクションのマップ先アドレスがランダムに変わる ◦ これがAddress Space Location Randomization(ASLR) ◦ ASLRが機能するように実行ファイルが
Position Independent Executable(PIE)になっている • 目的 ◦ 特定アドレスのコードを実行するようなセキュリティ攻撃を避ける • どんなプログラムがPIE? ◦ Ubuntuだと昔はsshなどの一部重要プログラムだけだった ◦ 17.04以降はすべて(例外があるかも?よく知らない) 7