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
カーネルハック実験の振り返り
Search
Arata
September 05, 2025
0
23
カーネルハック実験の振り返り
Arata
September 05, 2025
Tweet
Share
More Decks by Arata
See All by Arata
Pythonのcopy-and-patch JITの実装を読む
arata_nvm
0
20
eBPFを使った動的解析手法
arata_nvm
0
530
Improving LLVM Backend Development with a New TableGen Language Server
arata_nvm
0
8
コードエディターのシンタックスハイライトの話
arata_nvm
0
160
LLVMのコード自動生成機構におけるコード記述を支援するツールの作成
arata_nvm
0
68
TableGenの言語サーバーをつくる
arata_nvm
0
570
pwn入門 / introduction to pwn
arata_nvm
1
2.4k
TableGenと和解せよ / make peace with TableGen
arata_nvm
0
150
Nixで最強の開発環境を作る
arata_nvm
0
8
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.6k
Context Engineering - Making Every Token Count
addyosmani
8
300
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
4 Signs Your Business is Dying
shpigford
185
22k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Unsuck your backbone
ammeep
671
58k
Agile that works and the tools we love
rasmusluckow
331
21k
The Illustrated Children's Guide to Kubernetes
chrisshort
49
51k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
630
Transcript
カーネルハック実験 の振り返り 安藤 慎 / Ando Shin
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 筑波大学情報学群情報科学類 3年次で受講できる実験 • 目的: Linux Kernelをいじって機能追加の課題をこなす
• 期間: 春学期の約4ヶ月 • 担当教員: 新城靖 先生 • 定員: 6名 カーネルハック実験 2
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 課題1 カーネルのコンパイルとパラメタの設定 • 課題2 カーネルのリモート・デバッグ •
課題3 システムコールの追加 • 課題4 デバイス・ドライバの作成 • 課題6 定期的な仕事 • 課題9 トレース機能の利用 • 課題11 別のオペレーティングシステムでの実験 取り組んだ課題 3
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 環境: Linux 6.8.6 • Linux Kernelのビルド設定とビルドをするだけ
• 不要そうなドライバだけ外した ◦ が、実験中盤で起動しなくなったので戻した 課題1 カーネルのコンパイルとパラメタの設定 4
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 環境: Linux 6.8.6 • GDBに慣れましょう、という課題 •
rebootシステムコールを調べた ◦ ほぼコードリーディングになってしまった 課題2 カーネルのリモート・デバッグ 5
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 環境: Linux 6.8.6 • 文字列をROT13するシステムコールを実装 ◦
早速メモリリークするコードを書いて指摘される • システムコールテーブルの途中に欠番がコメントで書か れていて罠 課題3 システムコールの追加 6
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 環境: Linux 6.14.6 • 逆ポーランド記法の電卓として動くデバイスを作成 ◦
writeで入力、readで結果読み出し、ioctlでその他操作 • Rustでカーネルモジュールを開発 ◦ 実験環境にclangが入っていない(clangdは入っている) ◦ cdev周りがまだ整備されていないのでついでにラッパー作成 • メモリリークはなかったが0除算でカーネルパニック 課題4 デバイス・ドライバの作成 7
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 環境: Linux 6.8.6 • 一定時間キー入力がない場合に、応援メッセージを表示 ◦
親切なキーロガー • keyboard notifierがserial経由の入力で反応せず沼った ◦ 物理キーボードなら反応する ◦ 両方対応させるならTTY周りを触る必要がありそう? 課題6 定期的な仕事 8
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 環境: Linux 6.8.6 • eBPFでカーネル空間のメモリリークを検出 •
せっかくなのでeBPF bytecodeでプログラムを作成 • CTFの資料が一番入門に良い ◦ https://pawnyable.cafe/linux-kernel/LK06/ebpf.html 課題9 トレース機能の利用 9
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 • 環境: FreeBSD 14.3 • 指定したIPアドレスにpingできるシステムコールを作成 •
カーネルモジュールでシステムコールを追加できること に驚いた • 知人はPlan 9を選んで茨の道へ...... 課題11 別のオペレーティングシステムでの実験 10
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 A4 78枚 レポート 11
筑波大学カーネルハック実験の振り返り 安藤慎 2025/09/05 皆さんの実験の思い出も教えてください! 12