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
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
BBQ
matthewcrist
89
9.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Side Projects
sachag
455
43k
It's Worth the Effort
3n
187
28k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
Visualization
eitanlees
148
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
Become a Pro
speakerdeck
PRO
29
5.5k
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