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
2
カーネルハック実験の振り返り
Arata
September 05, 2025
Tweet
Share
More Decks by Arata
See All by Arata
Improving LLVM Backend Development with a New TableGen Language Server
arata_nvm
0
4
コードエディターのシンタックスハイライトの話
arata_nvm
0
150
LLVMのコード自動生成機構におけるコード記述を支援するツールの作成
arata_nvm
0
58
TableGenの言語サーバーをつくる
arata_nvm
0
560
pwn入門 / introduction to pwn
arata_nvm
1
2.4k
TableGenと和解せよ / make peace with TableGen
arata_nvm
0
140
Nixで最強の開発環境を作る
arata_nvm
0
1
sudo-rsのテストの話 / story of sudo-rs testing
arata_nvm
1
230
ソースコードリーディングはいいぞ / source code reading is good
arata_nvm
0
66
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Code Review Best Practice
trishagee
70
19k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Bash Introduction
62gerente
615
210k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
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