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
Address Space Layout Randomization(ASLR)
Search
Satoru Takeuchi
PRO
January 08, 2022
Technology
1
280
Address Space Layout Randomization(ASLR)
以下動画のテキストです
https://youtu.be/iCCNEoCKdHE
Satoru Takeuchi
PRO
January 08, 2022
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
会社員しながら本を書いてきた知見の共有
sat
PRO
3
680
デバイスにアクセスするデバイスファイル
sat
PRO
1
30
ファイルシステムのデータを ブロックデバイスへの操作で変更
sat
PRO
1
23
デバイスドライバ
sat
PRO
0
36
マルチスレッドの実現方法 ~カーネルスレッドとユーザスレッド~
sat
PRO
2
78
共有メモリ
sat
PRO
3
60
マルチスレッドプログラム
sat
PRO
3
49
Linuxのブートプロセス initramfs編
sat
PRO
2
65
Linuxのブートプロセス
sat
PRO
6
170
Other Decks in Technology
See All in Technology
Contract One Dev Group 紹介資料
sansan33
PRO
0
5.9k
CSS polyfill とその未来
ken7253
0
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
8
65k
金融システムをモダナイズするためのAmazon Elastic Kubernetes Service(EKS)ノウハウ大全
daitak
0
120
新卒から4年間、20年もののWebサービスと向き合って学んだソフトウェア考古学 - PHPカンファレンス新潟2025 / new graduate 4year software archeology
oguri
2
340
アプリケーションの中身が見える!Mackerel APMの全貌と展望 / Mackerel APMリリースパーティ
mackerelio
0
400
JNation 2025 - Quarkus for Spring Developers
edeandrea
PRO
0
100
ソフトウェアテストのAI活用_ver1.10
fumisuke
0
210
Microsoft Season of Agent AI エージェントの使用開始
takas0522
0
120
declaration mergingの威力:ライブラリアップデート時の書き換え作業を90%短縮するテクニック
yutake27
2
270
令和最新版TypeScriptでのnpmパッケージ開発
lycorptech_jp
PRO
0
100
Streamline Cloud-Native App Development Using CDEs
saeedzf
0
670
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Music & Morning Musume
bryan
47
6.5k
Typedesign – Prime Four
hannesfritz
41
2.6k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
Unsuck your backbone
ammeep
671
58k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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