仮想計算機モニタによるシステムコール検知箇所の推定可能なOS種別の拡張

書誌事項

タイトル別名
  • Extension of OS Types That Can Estimate System Call Hook Point by Virtual Machine Monitor

抄録

仮想計算機上のプログラムが発行したシステムコールを仮想計算機モニタにより検知する手法がある.検知箇所のアドレスは,OS バージョンの更新によるシステムコール処理の変更やアドレス空間のランダム化により,カーネル起動処理前に計算することができない.そこで,x86-64 のCPU で動作するLinux を対象に,カーネル起動処理前の計算によらず,ゲストOS のメモリ解析によりシステムコール検知箇所を推定する手法を提案した.本稿では,検知箇所推定手法について,対象のOS 種別を拡張する.具体的には,FreeBSD,NetBSD,およびOpenBSD における検知箇所推定のための解析結果と手法について述べる.提案手法は,プロセス構造体の取得にGS base レジスタを用いる.これにより,カーネルスタックのスタックポインタからプロセス構造体を取得できないOS にも対処する.また,検知箇所のアドレスの推定には,スタック切り替え命令,SWAPGS 命令,および,ページテーブルベースレジスタの更新を組み合わせて用いる.これにより,Meltdown 対策によるページテーブルの切り替えに対処する.さらに,mov命令だけではなく,スタックポインタやCR3 をオペランドに持つか否かも探索する.これにより,スタック切り替え命令のみを用いた際に生じる誤推定を抑制する.また,評価により,提案手法の有効性を示す.

There is a method to hook system calls issued by programs on a virtual machine by a virtual machine monitor. Due to changes in system call processing in OS updates and address space randomization, the addresses of these hook points cannot be calculated before the kernel startup process. To address this challenge, we proposed a method for estimating the system call hook point in Linux by analyzing the guest OS memory on x86-64 CPUs rather than pre-calculation. In this paper, we extend our previous method to accommodate additional OSes. Specifically, we present analysis results and a novel method for estimating hook points on FreeBSD, NetBSD, and OpenBSD. The proposed method uses GS base register to obtain process structure. This is applicable to operating systems that cannot obtain process structures from kernel stack pointer. To estimate the address of the hook point, we use a combination of stack switching instruction, SWAPGS instruction, and page table base register update. This addresses page table switching due to Meltdown countermeasure. In addition to mov instruction, it also searches whether or not stack pointerand CR3 are operands. This suppresses false estimation that occurs when only stack switching instruction is used. The effectiveness of our proposed method is also demonstrated through evaluation.

収録刊行物

詳細情報 詳細情報について

問題の指摘

ページトップへ