Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
210
Are puppies a ranking factor?
jonoalderson
0
2.4k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
The untapped power of vector embeddings
frankvandijk
1
1.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
400
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Cult of Friendly URLs
andyhume
79
6.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
130
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