<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shuji Ohira on Medium]]></title>
        <description><![CDATA[Stories by Shuji Ohira on Medium]]></description>
        <link>https://medium.com/@shujiohira?source=rss-6b43787889fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gYKpUHhVrpmZNxWNTGWtzg.jpeg</url>
            <title>Stories by Shuji Ohira on Medium</title>
            <link>https://medium.com/@shujiohira?source=rss-6b43787889fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 01:13:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shujiohira/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[GitHub Security Advisory経由でCVE-2026–113729を報告した話]]></title>
            <link>https://medium.com/@shujiohira/github-security-advisory%E7%B5%8C%E7%94%B1%E3%81%A7cve-2026-113729%E3%82%92%E5%A0%B1%E5%91%8A%E3%81%97%E3%81%9F%E8%A9%B1-53d426a61660?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/53d426a61660</guid>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 04:27:56 GMT</pubDate>
            <atom:updated>2026-10-24T04:27:56.586Z</atom:updated>
            <content:encoded><![CDATA[<p><em>English version below.</em></p><p>Go製の署名付きXML処理ライブラリ<a href="https://github.com/moov-io/signedxml">moov-io/signedxml</a>で、未認証のサービス拒否（DoS）脆弱性を見つけ、GitHub Security Advisory（GHSA）経由で報告しました。v1.4.1で修正され、2026年10月20日にCVE-2026–113729として公開されています。本記事では、報告からCVE採番までの流れをまとめます。再現手順や見つけ方の詳細は省いています。</p><p>GHSAは、脆弱性を非公開のまま報告し、メンテナーと修正してから公開できるGitHubの仕組みです。GitHub自身がCVEの採番機関（CNA）でもあるため、CVEのリクエストまでGitHub上で行えます。</p><h4>きっかけ</h4><p>以前、Keycloakにテストコードを追加するだけの小さな<a href="https://github.com/keycloak/keycloak/pull/40558">プルリクエスト</a>を送ったところマージされ、小さな貢献でしたがとても嬉しく、他のOSSにもなんらかの形で貢献したいと思うようになりました。</p><p>併せて、一般の開発者が使えるAIツールで実在するライブラリの脆弱性が見つかるのかにも興味があり、今回はCodex（Daybreak Blue）を使ってOSSの解析／調査しておりました。結果として、今回のような脆弱性を発見するに至りました。ただし、ツールが示したのは方向性までで、本当に再現するのかを確かめるのは当然自身の閉じた環境で自分でコマンド等を実行しながら行いました。</p><h4>脆弱性の概要</h4><p>排他的XML正規化（Exclusive Canonicalization）の処理に、細工したXMLでメモリを大量に消費させられる問題があり、署名や認証がなくても引き起こせる可用性侵害（DoS）でした。詳細は<a href="https://github.com/moov-io/signedxml/security/advisories/GHSA-5588-rp99-5fjh">GHSA-5588-rp99–5fjh</a>を参照してください。</p><h4>報告から修正まで</h4><p>報告は公開のIssueではなく、プライベートなセキュリティアドバイザリとして行いました（最初はメールベースでやり取りし、その後は GitHub 上のアドバイザリでやり取りしました）。その後、メンテナーが一時的なプライベートフォークに私をコラボレーターとして追加してくれ、そこで修正をやりとりしました。修正はv1.4.1としてリリースされています。</p><h4>CVE採番まで</h4><p>GHSAの画面には「CVEのレビュー／アサインは最大3営業日」と表示されていましたが、実際には数週間(2ヶ月弱)かかりました。調べてみると、GitHubのスタッフが<a href="https://github.com/orgs/community/discussions/207039">GitHub Communityのディスカッション</a>で、CVEリクエストが急増しているため受信順に処理しており、現在はおよそ5週間かかると説明していました。</p><p>5週間経過後も動きがなかったので、10月20日にGitHubのSecurity Advisory窓口（security-advisories@github.com）へメールで問い合わせたところ、同じ日にCVEが公開されました。問い合わせが効いたのか、単に順番が回ってきたのかは分かりません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5EkGoY7-4GExx5fbXthC0w.png" /><figcaption>メールした同日に、上記メール（一部のみを抜粋）が届き CVE アサインを確認しました</figcaption></figure><h4>おわりに</h4><p>OSSにテストを1本足しただけのプルリクエストをきっかけにOSSに貢献したい熱が起こり、脆弱性発見に至りましたが、今回はメンテナーと一緒に修正を進めるところまで経験できました。AIツールで見つけた脆弱性でも、報告するときは自分の目で確かめてから出す、というのは今後も続けたいと思います。</p><p>最後に、素早く対応してくださったmoov-ioのメンテナーの皆さんに感謝します。</p><p><strong>参考リンク</strong></p><ul><li><a href="https://github.com/moov-io/signedxml/security/advisories/GHSA-5588-rp99-5fjh">GHSA-5588-rp99–5fjh</a></li><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-113729">CVE-2026–113729（cve.org）</a></li><li><a href="https://nvd.nist.gov/vuln/detail/cve-2026-113729">CVE-2026–113729（NVD）</a></li></ul><h3>How I reported CVE-2026–113729 through a GitHub Security Advisory</h3><p>I found an unauthenticated denial-of-service (DoS) vulnerability in <a href="https://github.com/moov-io/signedxml">moov-io/signedxml</a>, a Go library for processing signed XML, and reported it through a GitHub Security Advisory (GHSA). It was fixed in v1.4.1 and published as CVE-2026–113729 on October 20, 2026. In this post, I go over the process from the report to the CVE assignment. I have left out the reproduction steps and the details of how I found it.</p><p>GHSA is GitHub’s mechanism for reporting a vulnerability privately, fixing it with the maintainer, and then publishing it. Since GitHub is also a CVE Numbering Authority (CNA), the CVE can be requested on GitHub as well.</p><h3>Why I started</h3><p>Some time ago, I sent a small <a href="https://github.com/keycloak/keycloak/pull/40558">pull request</a> to Keycloak that only added a test, and it was merged. It was a tiny contribution, but I was really happy about it, and it made me want to contribute to other open source projects too.</p><p>I was also curious whether AI tools available to ordinary developers could find vulnerabilities in real-world libraries, so this time I tried Codex (Daybreak Blue). It turned out that it could, at least for this kind of issue. However, the tool only pointed me in a direction, and of course I verified for myself that the issue actually reproduced.</p><h3>The vulnerability</h3><p>The issue was in the exclusive XML canonicalization step: a crafted XML document could consume a large amount of memory, resulting in a denial of service that can be triggered without a valid signature or authentication. See <a href="https://github.com/moov-io/signedxml/security/advisories/GHSA-5588-rp99-5fjh">GHSA-5588-rp99–5fjh</a> for details.</p><h3>From report to fix</h3><p>Rather than opening a public issue, I reported it as a private security advisory. The maintainer then added me as a collaborator on a temporary private fork, where we worked on the fix together. The fix was released as v1.4.1.</p><h3>Getting the CVE ID</h3><p>The GHSA page said that CVE review and assignment would take up to three working days, but in reality it took several weeks. When I looked into it, a GitHub staff member had explained in a <a href="https://github.com/orgs/community/discussions/207039">GitHub Community discussion</a> that CVE requests had surged, that they were being processed in the order received, and that it currently took about five weeks.</p><p>Since there was still no movement after that, I emailed GitHub’s Security Advisory team (security-advisories@github.com) on October 20, and the CVE was published the same day. I’m not sure whether my email helped or my turn simply came up.</p><h3>Closing thoughts</h3><p>It all started with a pull request that added a single test, but this time I got to work through a fix together with a maintainer. Even when something is found with an AI tool, I want to keep verifying it with my own eyes before reporting it.</p><p>Finally, I would like to thank the moov-io maintainers for their quick response.</p><p><strong>References</strong></p><ul><li><a href="https://github.com/moov-io/signedxml/security/advisories/GHSA-5588-rp99-5fjh">GHSA-5588-rp99–5fjh</a></li><li><a href="https://www.cve.org/CVERecord?id=CVE-2026-113729">CVE-2026–113729 (cve.org)</a></li><li><a href="https://nvd.nist.gov/vuln/detail/cve-2026-113729">CVE-2026–113729 (NVD)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53d426a61660" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ICISSP’23参加報告]]></title>
            <link>https://medium.com/inet-lab/icissp23%E5%8F%82%E5%8A%A0%E5%A0%B1%E5%91%8A-7e206619a0fc?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e206619a0fc</guid>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Sun, 26 Feb 2023 05:23:52 GMT</pubDate>
            <atom:updated>2023-02-26T05:23:52.047Z</atom:updated>
            <content:encoded><![CDATA[<p>2023/02/22–24にポルトガル・リスボンにて開催されたICISSP (International Conference on Information Systems Security and Privacy) 2023 に参加してきました。ICISSPは今年で9回目となる情報セキュリティに関する国際会議であり、Full PaperのAcceptance Rateが20~30%程度の中堅の国際会議とされています。今年は、138本の論文提出があり、その中から26本の論文がFull Paperとして選ばれました。(Acceptance Rate: 18.8%)</p><p><strong>発表内容<br></strong>私の発表は、車内の小さなコンピュータであるECUに搭載されているOSカーネルにDoS攻撃用の保護機構を実装・提案する研究であるため、Security in IoT and Edge Computingというセッションで発表を行いました。</p><p>発表終了後は、リスボンにある世界遺産（ジェロニモス修道院、ベレンの塔）等を観光して来ました。リスボンは坂が多い街で、ちょっと観光がてら散歩するだけでかなり体力を使うのでそこだけ注意です。。</p><p><strong>おわりに</strong><br>初めて現地での国際会議に参加し、貴重な経験ができました。博士課程最後の良い思い出になったかなと思います。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*REMO7VIlY3wm3g3rpQXK_w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekQOTziP79I7WDYOAZgQ9w.jpeg" /><figcaption>発表の様子とリスボンの風景</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHNvsZ_Bj5KACie64hgGIQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2sd0vLAj-asDxEzJJ_kZyQ.jpeg" /><figcaption>リスボンにある世界遺産（ジェロニモス修道院；左、ベレンの塔：右）</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e206619a0fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/icissp23%E5%8F%82%E5%8A%A0%E5%A0%B1%E5%91%8A-7e206619a0fc">ICISSP’23参加報告</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ph.D Graduation 2022 (Autumn)]]></title>
            <link>https://medium.com/inet-lab/ph-d-graduation-2022-autumn-6a58de8d4046?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a58de8d4046</guid>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Mon, 26 Sep 2022 10:59:09 GMT</pubDate>
            <atom:updated>2022-09-26T11:01:03.191Z</atom:updated>
            <content:encoded><![CDATA[<p>今日は，Kibromさんの博士後期課程の学位授与式でした。改めて，“Dr. Kibrom”さんおめでとう！<br>5年間本当にお疲れ様でした！！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7440FC9WaC5EYVcLV8sLQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILqC8qIDZy3sIvC15vZEoA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*JK85YvE_r51ePkJZ8WzOew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YoTB9b5HHHgiPbY0VUMOQA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a58de8d4046" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/ph-d-graduation-2022-autumn-6a58de8d4046">Ph.D Graduation 2022 (Autumn)</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[藤川教授就任10周年記念パーティが行われました]]></title>
            <link>https://medium.com/inet-lab/%E8%97%A4%E5%B7%9D%E6%95%99%E6%8E%88%E5%B0%B1%E4%BB%BB10%E5%91%A8%E5%B9%B4%E8%A8%98%E5%BF%B5%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%81%8C%E5%9F%B7%E3%82%8A%E8%A1%8C%E3%82%8F%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F-75db1e28f3c1?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/75db1e28f3c1</guid>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Sun, 05 Dec 2021 06:35:39 GMT</pubDate>
            <atom:updated>2021-12-05T10:55:37.695Z</atom:updated>
            <content:encoded><![CDATA[<p>今年2021年は藤川先生が教授に就任されて10周年ということで，先日記念パーティが開催されました．また，コロナ禍ということもあり，現役の学生と関西在住者のOBを数名を含めた20人程度の規模での開催になりました．</p><p>藤川教授が無類のスイーツ好きということで，スイーツのビュッフェにてパーティを執り行いました．また，記念品としてゴルフ用レーザ距離計や記念のお花等をプレゼントし，パーティを終了しました．</p><p>改めて，藤川教授10周年おめでとうございます！！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s66yZn1llUmaIKy8kgjpxQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sabm2tx9tIhNBkOc2WgJQ.jpeg" /><figcaption>個人的にシュトーレンが特に美味しかったです</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75db1e28f3c1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/%E8%97%A4%E5%B7%9D%E6%95%99%E6%8E%88%E5%B0%B1%E4%BB%BB10%E5%91%A8%E5%B9%B4%E8%A8%98%E5%BF%B5%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%81%8C%E5%9F%B7%E3%82%8A%E8%A1%8C%E3%82%8F%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F-75db1e28f3c1">藤川教授就任10周年記念パーティが行われました</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interactive Messageを使ったSlackBotをAWSに移行してみた]]></title>
            <link>https://medium.com/inet-lab/interactive-message%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%9Fslackbot%E3%82%92aws%E3%81%AB%E7%A7%BB%E8%A1%8C%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F-fd40a7fde2d9?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd40a7fde2d9</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[slackbot]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws-eventbridge]]></category>
            <category><![CDATA[aws-api-gateway]]></category>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Thu, 14 Oct 2021 07:05:28 GMT</pubDate>
            <atom:updated>2023-03-15T22:43:26.907Z</atom:updated>
            <content:encoded><![CDATA[<p>研究室用Slackで用いている研究室の掃除当番を決定/通知するボットを学内サーバ(オンプレ)で運用していました．しかし，毎年学内で停電作業があるためその度にボット用サーバを停止する作業を人手で行ったり，セキュリティアップデートを逐一適用したりと運用面で課題がありました．そこで，今回はこのボットをAWSを用いて完全にサーバーレスアーキテクチャで構築したので，その手順をまとめています．</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wo_EfTB47oi7mpTcrToTOA.png" /><figcaption>実装したSlackBot用アーキテクチャ</figcaption></figure><p><strong>ボットの作成<br></strong>本記事では，Slack側のボットの作成方法については述べませんが，ボットの作成方法は <a href="https://qiita.com/ref3000/items/83b36541f61e334b542e">https://qiita.com/ref3000/items/83b36541f61e334b542e</a> が参考になると思います．この記事内のpost_sample.jsが上記アーキテクチャでいうpost.js（毎週月曜12:00に掃除当番を通知するjs）に対応しており，receive_sample.jsがbutton.jsに対応しています．</p><p><strong>AWS EventBridge \Lambda \S3 の設定<br></strong>以下に示す画像のように，研究室内で運用しているボットは毎週月曜12:00に掃除当番をSlackに通知します．また，掃除当番は掃除を終えた後SlackBotによって通知されたメッセージにあるボタンを押し掃除したことを研究室メンバーに周知します．</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4TqyQmtu9ms-WRR8YdJjg.png" /><figcaption>おそうじうながしロボのアイコンは各年の象徴的な人物等を用いています．（今年はCOVID-19，去年は菅総理）</figcaption></figure><p>ここでは，まず毎週月曜12:00に掃除当番通知機能を実装していきます．用いるサービスは，AWS EventBridge, Lambda, S3です．</p><p>まずはLambdaを設定していきます．AWSマネジメントコンソールにログインした後，サービス一覧からLambdaのページに飛びます．Lambdaのページの<strong>`関数の作成`</strong>を押し，<strong>`一から作成`</strong>→<strong>`関数名(例：cleaningbot-post)`</strong>→<strong>`Node.js 14.x`</strong>を選択し<strong>`関数の作成`</strong>を押します．これで，1つ目のLambdaは作成完了です．</p><p>次に，<strong>`+ トリガーを追加`</strong>を押し，Lambdaのトリガーを設定します．Lambdaには毎週月曜12:00にSlackに通知して欲しいので，定期実行可能なEventBridgeを設定します．ルールは<strong>`新規ルールの作成`</strong>を選択しルール名を入力します．ルールタイプには`スケジュール式`を選択し，スケジュール式として<strong>`cron(0 3 ? * MON *)`</strong>という文字列を入力します．これで毎週月曜日にLambdaが起動されるようになります．</p><p>今回デプロイしたいボットは，前の週の掃除係に基づいて次の週の掃除係を決定するようなコードになっています．言い換えると，Lambdaが状態（ステート）に依存して通知するコンテンツを変更すると言えます．したがって，「前の週の掃除係」をどうやって保存し，Lambdaで引っ張ってくるかが問題となります．今回は「前の週の掃除係」をS3に保存する方法で解決しました（他の方法としてLambdaの一時的な512MBのデータ領域を使うことも考えられますが今回はS3とLambda連携を勉強したかったのでやめました）．</p><p>ですので，次にLambdaとS3を連携する上で必要となるIAMロールの設定とバケットポリシーについて述べます．まずは，LambdaのIAMロールに新たにS3に対するポリシーを追加していきます．IAMを変更するため，AWSマネジメントコンソールのIAMページに行きます．IAMのページにある<strong>`アクセス管理`</strong>→<strong>`ロール`</strong>→<strong>`cleaningbot-post-role-XXXXXXX`</strong>（Lambdaのロール）を選択します．次に，遷移したページで<strong>`ポリシーをアタッチ`</strong>→<strong>`ポリシーを作成`</strong>→<strong>`JSONタブ`</strong>を選択します．ここで，JSON形式でポリシーを記述できるため，以下のポリシーを記述してください．</p><pre>//LambdaのS3に対するReadWriteを許可するポリシー<br>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;s3:GetObject&quot;,<br>                &quot;s3:PutObject&quot;<br>            ],<br>            &quot;Resource&quot;: [<br>                &quot;arn:aws:s3:::cleaningbot-backet/*&quot;<br>            ]<br>        }<br>    ]<br>}</pre><p>この後，ポリシーの名前を入力し，<strong>`ポリシーの作成`</strong>を押せば終了です．</p><p><strong>AWS API Gateway\Lambda の設定<br></strong>次に，掃除終了周知ボタン機能をAPI GatewayとLambdaを使って実装していきます．先ほどLambdaを作成した同様の手順でLambdaを新たに作成します．同様にトリガを設定しますが，ここではAPI Gatewayをトリガにします．トリガの設定で，新しいAPIを作成するため<strong>`APIを作成する`</strong>を選択し，APIタイプは<strong>`REST API`</strong>，セキュリティは<strong>`オープン`</strong>を設定します（Slack側からアクセスするためオープンにしてます）．これらを設定したら<strong>`追加`</strong>を選択します．これで，API Gatewayが作成でき，APIにアクセスするためのエンドポイント(例:<a href="https://xxxxxxxxx.execute-api.[region].amazonaws.com/default/cleaningbot-button">https://xxxxxxxxx.execute-api.[region].amazonaws.com/default/cleaningbot-button</a>)が生成されたので，<a href="https://api.slack.com/apps">SlackBotのInteractive Message設定ページ</a>でこのエンドポイントを設定します．これで，全体のアーキテクチャの実装は完了です．</p><p><strong>終わりに<br></strong>今回はInteractive Messageを使ったSlackBotをAWSに移行する記事を書きました．また，AWSの使用料金をSlack Channelに通知するAmazon SNSも合わせて用いれば料金面も考慮しつつ運用していけると思います（今回のアーキテクチャだと月100円もかからない気がしますが）．</p><p><strong>参考文献</strong><br>1. “Node.jsを使ってLambdaでS3のファイルのRead/Write,” <a href="https://nkgr.hatenablog.com/entry/2018/06/26/220000">https://nkgr.hatenablog.com/entry/2018/06/26/220000</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd40a7fde2d9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/interactive-message%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%9Fslackbot%E3%82%92aws%E3%81%AB%E7%A7%BB%E8%A1%8C%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F-fd40a7fde2d9">Interactive Messageを使ったSlackBotをAWSに移行してみた</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ASIACCS’21に参加しました]]></title>
            <link>https://medium.com/inet-lab/asiaccs21%E3%81%AB%E5%8F%82%E5%8A%A0%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F-73e9057c7eb7?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/73e9057c7eb7</guid>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Fri, 25 Jun 2021 05:48:07 GMT</pubDate>
            <atom:updated>2021-06-25T05:59:30.712Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UOaIwOmFlSMmGhV9hZV1XA.png" /><figcaption>発表の様子</figcaption></figure><p>ACM ASIACCS (<em>ACM ASIA conference on Computer and Communications Security</em>)は，今年で16回目の開催となる情報セキュリティに関する国際会議であり，情報セキュリティ分野ではAcceptance Rateが20%以下の難関国際会議の1つとされています．2021年度のASIACCSは，COVID-19の影響もあり2020年度と同様にオンラインでの開催となりました．また，オンラインでの開催にもかかわらず，合計370本の論文提出があり，その中から70本の論文が選ばれました(Acceptance Rate: 18.9%)．</p><h4>発表内容</h4><p>私の発表は，FPGAの特殊な回路を使った車載ネットワークの侵入検知に関する研究ということもあり，Hardware Security 1というセッションに組み込まれました．（その他の発表はRISC-VやSide-Channelの研究でした）</p><p>発表当日は，事前に録画しておいたビデオを流して，その後のQ&amp;Aはリアルタイムに行うといった流れでした．</p><h4>終わりに</h4><p>難関とされる国際会議に参加し，様々な分野のトップの研究者と議論等ができ，貴重な体験ができたかなと思います．今後とも難関の国際会議を目指して頑張っていきたいと思います．</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73e9057c7eb7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/asiaccs21%E3%81%AB%E5%8F%82%E5%8A%A0%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F-73e9057c7eb7">ASIACCS’21に参加しました</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kubernetes(kind)上でdjango/mysqlを実行する方法]]></title>
            <link>https://medium.com/inet-lab/kubernetes-kind-%E4%B8%8A%E3%81%A7django-mysql%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95-439a4758bd0d?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/439a4758bd0d</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kind]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Mon, 29 Mar 2021 15:47:14 GMT</pubDate>
            <atom:updated>2021-03-30T05:18:11.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*X0707CRCckQYM82vyt1o4g.png" /></figure><p>こちらの記事は，研究室で開発/運用しているdjangoベースのWebアプリをkubernetes in docker (kind) に移行する際の備忘録となっています．また，本記事ではmysqlとdjangoベースのWeb Serverの両方をkubernetes上のpodとしてデプロイする方法が説明されています．</p><p>以下のような環境で実行することを前提としています．(また，Dockerはインストール及び起動されているものとします)<strong><br>実験環境<br></strong>OS : Ubuntu 18.04<br>Docker : v20.10.5</p><h4>0. 準備</h4><p>まず，kindとkubectlをインストールします．kindはその名の通りdocker内でkubernetesを実行するためのテスト環境で，ローカル環境でkubernetesを実行することが可能になります．似たような種類のものでMinikubeというツールもありますが，こちらは複数のノードのデプロイに対応していないため，この点においてはkindに優位性があるようです．</p><p>kubectlはkubernetes用のコマンドラインツールで，このコマンドを使うことでkubernetes cluster/pod等の作成・削除が可能になります．また，contextと呼ばれるパラメータを切り替えることで，操作対象をkindからGoole Kubernetes Engine (GKE)等のpublic cloudに変更することも可能です．<br>以下がkindとkubectlをインストールする手順です．（※最新のビルド方法は公式サイトを参照してください）</p><pre>//kindのinstall<br>$ curl -Lo ./kind <a href="https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-amd64">https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-amd64</a><br>$ chmod +x ./kind<br># mv ./kind /usr/local/bin/kind<br>$ kind --version</pre><pre>//kubectlのinstall<br>$ curl -LO &quot;https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl&quot;</pre><pre>$ chmod +x ./kubectl<br># mv ./kubectl /usr/local/bin/kubectl<br>$ kubectl version --client</pre><p>次に，pollsと呼ばれるテスト用のdjango projectが含まれたpython-docs-samplesリポジトリとkubernetes用のyamlファイルが保存されたリポジトリをcloneします．また，django v2.2 LTSで動作させるために，予め準備されているpatchファイルをpython-docs-samplesリポジトリに適用します．</p><pre>//python-docs-samplesとdjango_on_kubernetesをまとめてclone<br>$ git clone --recursive <a href="https://github.com/shuji-oh/django_on_kubernetes">https://github.com/shuji-oh/django_on_kubernetes</a></pre><pre>//django v2.2 LTSで動かすために，patchを適用<br>$ cd django_on_kubernetes/python-docs-samples<br>$ git apply ../diff_python-docs-samples.patch</pre><pre>// 1.以降のコマンドはdjango_on_kubernetes/の上で行うので一つ戻る<br>$ cd ..</pre><p>これで，下準備は完了です．</p><h4>1. kubernetes cluster/podの作成</h4><p>ここからはkubernetes clusterやpodの作成を行っていきます．kubernetes clusterはmasterとworkerから構成されており，ざっくり説明するとworker側でcontainerが動作していて，master側でそのworkerの管理をします．今回は，master1台・worker3台のclusterを作成してみます．また，kubernetesにおけるpodは1つ以上のcontainerが起動している最小単位のオブジェクトのことです．今回はpodとしてmysqlやdjangoベースのWebアプリを起動していきます．<br> 以下でclusterの作成を行います．</p><pre>//clusterを作成<br>$ kind create cluster --config kind.yaml --name django<br>Creating cluster &quot;kind-django&quot; ...</pre><pre>//kind-djangoが選択されているか確認 (*がついとけばok)<br>$ kubectl config get-contexts<br>CURRENT    NAME           CLUSTER          AUTHINFO   <br>*          kind-django    kind-django      kind-django</pre><pre>//clusterの確認<br>$ kubectl get nodes</pre><p><strong>DBの作成</strong></p><p>先ほど作成したクラスタにmysqlのpodを作成していきます．DBを作成する前に，パスワード等の公開できない情報をyamlファイルに埋め込むためのtoolであるsecretを作成しておきます．</p><pre>//mysql_deployment.yaml用のsecretの設定<br>$ cat env-secret.txt  ※ env-secret.txtはvim等のエディタで作成してください<br>username=root<br>password=password</pre><pre>//env-secret.txtを元に， secretの作成<br>$ kubectl create secret generic --save-config mysql-secret --from-env-file ./env-secret.txt</pre><pre>//secretの確認<br>$ kubectl get secret mysql-secret<br>NAME           TYPE     DATA   AGE<br>mysql-secret   Opaque   2      5h53m</pre><p>これでやっと，mysqlのpodが作成できます．</p><pre>//mysqlのpodの作成<br>$ kubectl apply -f mysql_pv.yaml<br>$ kubectl apply -f mysql_deployment.yaml</pre><pre>//podの確認<br>$ kubectl get pods<br>NAME                     READY   STATUS    RESTARTS   AGE<br>mysql-6f95b985b5-655dv   1/1     Running   0          5h56m</pre><p><strong>Web Serverの作成</strong></p><p>次にWeb Serverのpodを作成していきます．まず，Web ServerがDBに接続するためのパスワード等の情報を隠蔽するために，pipenv用の環境変数を定義します．</p><pre>//django用の環境変数の設定 (先ほどのenv-secret.txtと内容は同じにすること!)<br>$ cat .env                      ※ .envはvim等のエディタで作成してください<br>DATABASE_USER=root<br>DATABASE_PASSWORD=password</pre><p>次に，kubernetesから参照するdocker imageを作成します．作成したimageをkindに取り込み，その後Web Serverのpodを作成します．</p><pre>//先ほど作成した.envファイルを指定しつつ， docker imageを作成<br>$ docker build -t mysite/django:v1 --build-arg ENV=&#39;.env&#39; .</pre><pre>//docker imageをkindでロード<br>$ kind load docker-image mysite/django:v1 --name django</pre><pre>//Web Serverのpodを作成, podの確認<br>$ kubectl apply -f python_server_deployment.yaml<br>$ kubectl get pods<br>NAME                     READY   STATUS    RESTARTS   AGE<br>django-f4c97786d-2w5m4   1/1     Running   0          4h51m<br>django-f4c97786d-nvbt5   1/1     Running   0          4h51m<br>django-f4c97786d-zp64k   1/1     Running   0          4h51m<br>mysql-6f95b985b5-655dv   1/1     Running   0          5h56m</pre><h4>2. djangoのmanage.pyによるDB migration</h4><p>現状DB内はデフォルトの状態でdjangoに関するtable等が存在しない状態です．なので，DBやdjangoが動いているpodに直接アクセスしてそれらを作成します．</p><pre>//DBの作成<br>$ kubectl run -it --rm --image=mysql:5.7 --restart=Never mysql-client -- mysql -u root -h mysql-clusterip -ppassword -P 13306</pre><pre>mysql&gt; create database polls;<br>mysql&gt; exit;</pre><pre>//djangoのmanage.pyを使ってtableの作成<br>$ kubectl exec -it django-f4c97786d-2w5m4 -- /bin/bash<br># pipenv run python manage.py makemigrations<br># pipenv run python manage.py migrate</pre><h4>3. podへのポートフォワーディング, ブラウザで接続</h4><p>ここまでの手順でほとんど終わりですが，最後にブラウザからアクセスするためにpodへポートフォワーディングします．</p><pre>$ kubectl port-forward django-f4c97786d-2w5m4 8888:8000</pre><p>上記のポートフォワーディングを行うコマンドを行いつつ，ブラウザでhttp://127.0.0.1:8888にアクセスすると，`Hello, world. You’re at the polls`が出てきます．http://127.0.0.1:8888/adminにもアクセスできれば，ビルド成功です．</p><h4>4. 終わりに</h4><p>余談ですが，`kubectl`は毎回打つのめんどくさいので`k`などのエイリアスを作成しておくと良いと随所で書かれています．</p><pre>$ k get pods<br>NAME                     READY   STATUS    RESTARTS   AGE<br>django-f4c97786d-2w5m4   1/1     Running   0          4h51m<br>django-f4c97786d-nvbt5   1/1     Running   0          4h51m<br>django-f4c97786d-zp64k   1/1     Running   0          4h51m<br>mysql-6f95b985b5-655dv   1/1     Running   0          5h56m</pre><h4><strong>参考文献</strong></h4><ol><li>“DjangoをlocalのKubernetesで動かす,” <a href="https://solist.work/blog/posts/django-local-kubernetes/">https://solist.work/blog/posts/django-local-kubernetes/</a></li><li>“kubernetesでMysqlを動かしてみる,” <a href="https://qiita.com/witchy/items/3a39b674097b86a44546">https://qiita.com/witchy/items/3a39b674097b86a44546</a></li><li>青山真也, “Kubernetes完全ガイド 第二版”</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=439a4758bd0d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/kubernetes-kind-%E4%B8%8A%E3%81%A7django-mysql%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95-439a4758bd0d">kubernetes(kind)上でdjango/mysqlを実行する方法</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[オンラインサマーセミナー2020を行いました]]></title>
            <link>https://medium.com/inet-lab/%E3%82%AA%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%82%B5%E3%83%9E%E3%83%BC%E3%82%BB%E3%83%9F%E3%83%8A%E3%83%BC2020%E3%82%92%E8%A1%8C%E3%81%84%E3%81%BE%E3%81%97%E3%81%9F-2a4e01136193?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a4e01136193</guid>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Fri, 21 Aug 2020 09:43:52 GMT</pubDate>
            <atom:updated>2020-08-21T09:43:52.755Z</atom:updated>
            <content:encoded><![CDATA[<p>2020年8月20-21日に，オンラインサマーセミナー2020を行いました．私達情報基盤システム学研究室では，「車をハックしよう！」というタイトルで2日間とことん車をハッキングする講義を行いました．本記事では，その概要をまとめています．</p><p>まず，1日目は車載ネットワークのCANについて学んだ後，CANに関する簡単なCTFを行い攻撃ツールの使用方法等を学習しました．</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_fj7VVcseBmh6ICEe-MkRQ.jpeg" /></figure><p>CAN bus CTFでは左の画像にあるメータを偽装するような問題や，車載コンピュータの認証システムをバイパスする問題等が出題されました．</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oteyCnC61gzpnWpRA_xkJQ.png" /><figcaption>CAN bus CTFの結果</figcaption></figure><p>続いて，2日目では実車両への攻撃を行いました．今回はオンライン開催ということで，車両へEthernetケーブルを配線する等して参加者が遠隔からCANへ攻撃を行う環境を構築しました．</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CA2Qd2n1xAIwTXh-GKvhrA.jpeg" /><figcaption>車両の準備の様子</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2R4IAazYAQwFQo26_YbMPg.jpeg" /><figcaption>車両にCANパケットを送信している様子</figcaption></figure><h4>終わりに</h4><p>もし，本セミナーが面白そうだなと感じて貰えましたら来年度以降も同じテーマで開催する予定ですので，是非応募して頂ければ嬉しいです！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a4e01136193" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/%E3%82%AA%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%82%B5%E3%83%9E%E3%83%BC%E3%82%BB%E3%83%9F%E3%83%8A%E3%83%BC2020%E3%82%92%E8%A1%8C%E3%81%84%E3%81%BE%E3%81%97%E3%81%9F-2a4e01136193">オンラインサマーセミナー2020を行いました</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[gdbで，Virtualbox上のLinux kernelをデバッグできるようにする]]></title>
            <link>https://medium.com/inet-lab/gdb%E3%81%A7-virtualbox%E4%B8%8A%E3%81%AElinux-kernel%E3%82%92%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B-b318070ae060?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b318070ae060</guid>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Fri, 17 Jul 2020 12:06:58 GMT</pubDate>
            <atom:updated>2020-07-25T10:04:38.663Z</atom:updated>
            <content:encoded><![CDATA[<h3>gdbで，VirtualBox上のLinux kernelをデバッグできるようにする</h3><p>Githubに公開されているLinux Kernel exploitation Tutorialの2章において，Kernelのデバッグ環境を整えるのですが，VMwareが前提となっています．同様の環境をVirtualBoxで構築したので，その全容をこの記事ではまとめています．</p><p>Linux Kernel exploitation Tutorialへのリンクは以下です．<br><a href="https://github.com/Lazenca/Kernel-exploit-tech">https://github.com/Lazenca/Kernel-exploit-tech</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*vL_ZMQLjGmXl16aGENFBRw.png" /><figcaption>こんな感じでカーネル内の関数にbreakpointがセットできるようになります</figcaption></figure><p>環境<br>HOST : macOS Catalina 1.15.16 (VirtualBox 6.0.22)<br>VM(debuggee, debugger) : Ubuntu 20.04 Linux 5.4.0–40-generic</p><p>まずは，debuggee側から設定します．</p><pre>### パッケージのインストールなど<br>$ sudo apt install linux-source libncurses5-dev libssl-dev flex bison<br>$ mkdir mykernel<br>$ cd mykernel<br>$ tar xjf /usr/src/linux-source-&lt;version&gt;/linux-source-&lt;version&gt;.tar.bz2<br>$ cd linux-source-&lt;version&gt;</pre><pre>### 初期化されたコンフィグの生成<br>$ make oldconfig</pre><pre>$ vim .config<br>&quot;KGDB&quot;で検索し，それぞれのオプションがyになっていることを確認する．</pre><pre>$ make menuconfig<br>&quot;Kernel Hacking-&gt;Compile kernel with debug info&quot;を有効化[*]する．</pre><pre>### カーネルのビルド<br>$ make -j 4<br>$ make modules<br>$ make modules_install<br>$ make install</pre><pre>### ビルドによって生成されたvmlinuxのコピーを共有フォルダに入れる．<br>$ sudo cp vmlinux /[共有フォルダのパス]</pre><pre>### grub.cfgの変更<br>$ vim /boot/grub/grub.cfg<br>&quot;Ubuntu&quot;で検索し，一番初めに見つかった箇所周辺を以下のように編集する．</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHsPKj59GSn6pp06wTy0Pw.png" /><figcaption>linux /boot/vmlinuz-5.40.0 … の末尾に kgdbwait kgdboc=ttyS0,115200 を追加</figcaption></figure><p>grub.cfgの編集が終わったら，debuggeeはシャットダウンしておいてください．</p><p>次に，debuggeeとdebuggerのシリアルポートの設定をVirtualBoxのアプリケーションから行います．<br>以下のように，シリアルポートを設定します．（違いは”存在するpipe/socketに接続”にcheckを入れるかどうかだけです．）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qgbOmMBv9vYrqicH5PcGw.png" /><figcaption>“debuggee”のシリアルポートの設定</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXX0PombPebAuP4iVRGoOA.png" /><figcaption>“debugger”のシリアルポートの設定</figcaption></figure><p>VirtualBoxから行う設定が終わったので，2つのVMを起動します．<br>ここで注意なのですが，debuggerはdebuggeeによって作られる/tmp/serialがブート時に必要なため，debuggee-&gt;debuggerの順で起動してください．</p><p>最後に，debugger側を設定し，gdbでdebuggeeに接続します．</p><pre>### gdbで使うvmlinuxを持ってくる<br>$ mkdir /boot/debuggee-image<br>$ cp /[共有ファイル]/vmlinux /boot/debuggee-image</pre><pre>### ブレイクポイントを打つときに参考にするkernelのコードを持ってくる<br>$ sudo apt install linux-source<br>$ mkdir debuggee-kernel<br>$ cd debuggee-kernel<br>$ tar xjf /usr/src/linux-source-&lt;version&gt;/linux-source-&lt;version&gt;.tar.bz2<br>$ sudo su<br># cd /boot/debuggee-image<br># gdb ./vmlinux<br>...<br>...<br>(gdb) target remote /dev/ttyS0    ### debuggeeにアタッチ<br>(gdb) b icmp_reply                ### icmp_reply関数にbreakpointを設置<br>(gdb) c</pre><p>debuggerからdebuggeeにpingを打ったり，debuggeeから直接debuggee自身にpingを打つと，icmp_reply関数でブレイクポイントにヒットすると思います．</p><h4>終わりに</h4><p>本記事は以下のYouTubeの動画を大いに参考にしてるので，こちらを見て頂いた方がわかりやすいこともあると思います．</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F67cxIXLCfUk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D67cxIXLCfUk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F67cxIXLCfUk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f84a822313bba9dde07fa68f4444d8a/href">https://medium.com/media/4f84a822313bba9dde07fa68f4444d8a/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b318070ae060" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/gdb%E3%81%A7-virtualbox%E4%B8%8A%E3%81%AElinux-kernel%E3%82%92%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B-b318070ae060">gdbで，Virtualbox上のLinux kernelをデバッグできるようにする</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ホスト(macOS Catalina)からgdbで，QEMU上のOS kernelをデバッグできるようにする]]></title>
            <link>https://medium.com/inet-lab/%E3%83%9B%E3%82%B9%E3%83%88-macos-catalina-%E3%81%8B%E3%82%89gdb%E3%81%A7-qemu%E4%B8%8A%E3%81%AEos-kernel%E3%82%92%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B-37a3701ef481?source=rss-6b43787889fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/37a3701ef481</guid>
            <dc:creator><![CDATA[Shuji Ohira]]></dc:creator>
            <pubDate>Mon, 11 Nov 2019 12:20:29 GMT</pubDate>
            <atom:updated>2019-11-11T12:23:57.079Z</atom:updated>
            <content:encoded><![CDATA[<p>xv6を勉強したいと思って幾星霜…，ようやくデバッグ環境が整ったのでその手順をまとめようと思います．Linuxカーネルとかも同じ要領でデバッグできるはずです．</p><p>xv6については，以下を参照してください．</p><p><a href="https://ja.wikipedia.org/wiki/Xv6">xv6</a></p><p>また，2019年にRISC-Vに移植された<a href="https://pdos.csail.mit.edu/6.828/2019/xv6.html">xv6</a>が最新らしいが，今回はx86版xv6です．</p><p>ホスト(macOS Catalina)からgdbで，QEMU上のxv6 kernelをデバッグできるようにするのがゴールです．早速xv6をビルドしていきます．</p><h4>QEMUとxv6のインストール</h4><pre>$ brew qemu <br>$ brew i386-elf-gcc i386-elf-binutils</pre><pre>また，binutilsがインストールされている場合，brew linkが必要かも．<br>$ brew link --overwrite i386-elf-binutils</pre><pre>$ git clone <a href="https://github.com/mit-pdos/xv6-public">https://github.com/mit-pdos/xv6-public</a><br>$ cd xv6-public<br>$ vim Makefile<br>以下のように変更</pre><pre>- # TOOLPREFIX = i386-jos-elf<br>+ TOOLPREFIX = i386-elf-</pre><pre>- # QEMU = qemu-system-i386<br>+ QEMU = qemu-system-i386</pre><pre>$ make<br>$ make qemu-nox<br>xv6が起動し，シェルが実行されたら成功．</pre><h4>クロス・デバッグ可能なgdbのインストール</h4><p><a href="https://ftp.gnu.org/gnu/gdb/">Index of /gnu/gdb</a></p><p>上記のサイトからgdbの最新バージョンをダウンロード．(2019/11/11時点では，8.3が最新)</p><pre>$ cd gdb-8.3<br>$ ./configure — enable-targets=all # — target=(任意のアーキテクチャ)でも良い<br>$ make<br>$ make install<br>$ gdb<br>GNU gdb (GDB) 8.3<br>…<br>…<br>gdbが起動し，バージョンがダウンロードしたものと合ってたなら成功．</pre><p>早速，xv6とgdbを起動する．<br>xv6の起動は以下．</p><pre>$ make qemu-nox-gdb<br>*** Now run ‘gdb’.<br>qemu-system-i386 -nographic -drive file=fs.img,index=1,media=disk,format=raw -drivefile=xv6.img,index=0,media=disk,format=raw -smp 2 -m 512 -S -gdb tcp::25501</pre><p>xv6側では，ポート番号25501でgdbの接続を待っている状況です．．</p><p>別のterminalで，gdbを起動する．</p><pre>$ cd xv6-public<br>$ gdb<br>GNU gdb (GDB) 8.3<br>…<br>…<br>(gdb) target remote localhost:25501<br>(gdb) symbol-file kernel<br>(gdb) b main<br>(gdb) c</pre><p>画像（下）みたいに，main.cの19行目くらいで止まってると思います．</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3x4NnKBIh4I4N6n23LVMDw.png" /><figcaption>最終的にこんな感じになります．</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37a3701ef481" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inet-lab/%E3%83%9B%E3%82%B9%E3%83%88-macos-catalina-%E3%81%8B%E3%82%89gdb%E3%81%A7-qemu%E4%B8%8A%E3%81%AEos-kernel%E3%82%92%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B-37a3701ef481">ホスト(macOS Catalina)からgdbで，QEMU上のOS kernelをデバッグできるようにする</a> was originally published in <a href="https://medium.com/inet-lab">inet-lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>