$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
カーネルハック実験の振り返り
Search
Arata
September 05, 2025
0
27
カーネルハック実験の振り返り
Arata
September 05, 2025
Tweet
Share
More Decks by Arata
See All by Arata
Pythonのcopy-and-patch JITの実装を読む
arata_nvm
0
67
eBPFを使った動的解析手法
arata_nvm
0
610
Improving LLVM Backend Development with a New TableGen Language Server
arata_nvm
0
22
コードエディターのシンタックスハイライトの話
arata_nvm
0
170
LLVMのコード自動生成機構におけるコード記述を支援するツールの作成
arata_nvm
0
78
TableGenの言語サーバーをつくる
arata_nvm
0
580
pwn入門 / introduction to pwn
arata_nvm
1
2.5k
TableGenと和解せよ / make peace with TableGen
arata_nvm
0
160
Nixで最強の開発環境を作る
arata_nvm
0
14
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
400
The Limits of Empathy - UXLibs8
cassininazir
1
190
For a Future-Friendly Web
brad_frost
180
10k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
1
210
My Coaching Mixtape
mlcsv
0
13
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
300
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How to Talk to Developers About Accessibility
jct
1
84
Producing Creativity
orderedlist
PRO
348
40k
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