JP6204555B1 - Method, system firmware, and computer for protecting variables stored in non-volatile memory - Google Patents

Method, system firmware, and computer for protecting variables stored in non-volatile memory Download PDF

Info

Publication number
JP6204555B1
JP6204555B1 JP2016183556A JP2016183556A JP6204555B1 JP 6204555 B1 JP6204555 B1 JP 6204555B1 JP 2016183556 A JP2016183556 A JP 2016183556A JP 2016183556 A JP2016183556 A JP 2016183556A JP 6204555 B1 JP6204555 B1 JP 6204555B1
Authority
JP
Japan
Prior art keywords
variable
request
variables
protected
protection target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2016183556A
Other languages
Japanese (ja)
Other versions
JP2018049402A (en
Inventor
佐々木 健
健 佐々木
勇作 森重
勇作 森重
宏幸 内田
宏幸 内田
直幸 荒木
直幸 荒木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Singapore Pte Ltd
Original Assignee
Lenovo Singapore Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Singapore Pte Ltd filed Critical Lenovo Singapore Pte Ltd
Priority to JP2016183556A priority Critical patent/JP6204555B1/en
Application granted granted Critical
Publication of JP6204555B1 publication Critical patent/JP6204555B1/en
Publication of JP2018049402A publication Critical patent/JP2018049402A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

【課題】UEFIファームウェアが参照するGVを保護しながらOSの動作を確保する。【解決手段】ファームウェアROM100には、UEFIファームウェア150、保護対象GV153および非保護対象GV155が格納されている。保護対象GV153および非保護対象GV155は、UEFIファームウェアがプリブートをするために参照する。OSはプリブートの終了後にみずからの動作環境を構築するために保護対象GVを改変することができる。ファームウェアROMに記録された保護対象GV153は、ブートやシステムの構成に関連するデータを含むためOSにより改変されると次回のプリブートが失敗することがある。UEFIファームウェアは、プリブートが終了する前に保護対象GVをシステム・メモリにコピーする。プリブートの終了後のOSによる保護対象GVに対するアクセスはシステム・メモリ上で処理する。【選択図】図2The operation of an OS is secured while protecting a GV referenced by UEFI firmware. A firmware ROM 100 stores UEFI firmware 150, a protection target GV153, and a non-protection target GV155. The protection target GV153 and the non-protection target GV155 are referred to by the UEFI firmware for pre-booting. The OS can modify the protection target GV in order to construct a natural operating environment after the end of preboot. Since the protection target GV153 recorded in the firmware ROM includes data related to booting and system configuration, the next preboot may fail if it is modified by the OS. The UEFI firmware copies the protection target GV to the system memory before the preboot is completed. Access to the protection target GV by the OS after the end of preboot is processed on the system memory. [Selection] Figure 2

Description

本発明は、コンピュータの動作不良を防止する技術に関し、さらには、UEFI(Unified Extensible Firmware Interface)規格に適合するコンピュータが格納する変数を保護する技術に関する。   The present invention relates to a technique for preventing malfunction of a computer, and further relates to a technique for protecting a variable stored in a computer conforming to UEFI (Unified Extensible Firmware Interface) standard.

コンピュータのファームウェアは、主としてハードウェアとオペレーティング・システム(OS)、デバイス・ドライバまたはアプリケーションなどの上位のプログラムとの間のインターフェースを提供するコードである。ファームウェアは、周辺デバイスを専用に制御するデバイス・ファームウェアとシステム全体の動作にかかわるシステム・ファームウェア(プラットフォーム・ファームウェアともいう。)に分けることができる。   Computer firmware is primarily code that provides an interface between hardware and a higher-level program such as an operating system (OS), device driver or application. Firmware can be divided into device firmware that exclusively controls peripheral devices and system firmware (also referred to as platform firmware) related to the operation of the entire system.

システム・ファームウェアは通常マザーボードに取り付けられた不揮発性メモリ(NVRAM)に格納されている。BIOSはこれまで多くのコンピュータ・システムに実装されてきたシステム・ファームウェアで、コンピュータの電源が起動してからOSがロードを開始するまでの間にPOST(Power On Self-Test)およびパスワード処理をしたり、OSがハードウェアにアクセスする為のサービスを提供したりする。   System firmware is typically stored in non-volatile memory (NVRAM) attached to the motherboard. The BIOS is a system firmware that has been implemented in many computer systems so far, and performs POST (Power On Self-Test) and password processing after the computer power is turned on until the OS starts loading. Or provide a service for the OS to access the hardware.

しかしBIOSは、近年の進化したハードウェアに対する対応が困難になってきたため、UEFIフォーラムが、従来のBIOSであるレガシーBIOSに代わる新しいシステム・ファームウェアとしてUEFI規格を策定した。UEFI規格では、バリアブル・サービス(Variable Services)を規定している。バリアブル・サービスは、不揮発性のメモリにUEFI規格で定義した変数であるグローバル・バリアブルズ(GV:Global Variables)を格納する。   However, since BIOS has become difficult to deal with hardware that has evolved in recent years, the UEFI Forum has formulated the UEFI standard as a new system firmware that replaces legacy BIOS, which is a conventional BIOS. The UEFI standard prescribes variable services. The variable service stores global variables (GV: Global Variables), which are variables defined in the UEFI standard, in a nonvolatile memory.

一般にパーソナル・コンピュータ(PC)は、UEFIファームウェアを格納する不揮発性メモリにGVを登録している。UEFI規格ではGVの公開性を規定し、OSやOSアプリケーションが登録されたGVに対する修正、削除、および追加をすることができる。特許文献1はブート時に所定のGVが改変されたと判断したときにあらかじめ登録しておいたデフォルト値で修正する発明を開示する。   In general, a personal computer (PC) registers GV in a nonvolatile memory that stores UEFI firmware. The UEFI standard defines the openness of GV, and can modify, delete, and add to the GV in which the OS and OS application are registered. Patent Document 1 discloses an invention in which a default value registered in advance is corrected when it is determined that a predetermined GV has been altered at the time of booting.

特開2015−153198号公報JP2015-153198A

GVは、UEFIファームウェアがブートルーチンで使用するブート・デバイスまでのパス、ブート・デバイスの選択順位、およびハードウェアの構成に関するデータを含む。このようなGVがOSによって改変されるとUEFIファームウェアは予定するPCの起動処理ができなくなって、システムの起動失敗やハードウェアの動作不良に至ることがある。したがって、UEFIファームウェアがブートルーチンを正しく実行するためには、主要なGVの一貫性を維持する必要がある。   The GV includes data regarding the path to the boot device used by the UEFI firmware in the boot routine, the boot device selection order, and the hardware configuration. When such GV is modified by the OS, the UEFI firmware cannot perform scheduled PC startup processing, which may result in system startup failure or hardware malfunction. Therefore, in order for the UEFI firmware to correctly execute the boot routine, it is necessary to maintain the consistency of the main GV.

しかし、UEFI規格によるGVの公開性により、誤ったパラメータの設定による書き込みやマルウェアによる書き込みによって、GVが改変されることがある。レガシーBIOSでは、GVに相当する変数を書き込んだ不揮発性メモリをOSの実行環境に対してライト・プロテクトすることができたが、公開性が要求される保護対象GVに対してはそのような手法を採用することができない。   However, due to the publicity of GV according to the UEFI standard, GV may be altered by writing due to incorrect parameter settings or writing by malware. In the legacy BIOS, the nonvolatile memory in which a variable corresponding to GV is written can be write-protected with respect to the OS execution environment. Can not be adopted.

さらにOSは、所定のGVを改変しないとインストールできないことがある。したがって、UEFI規格で規定する認証サービス(Variable Authentication)を利用して保護対象GVに対して個別にライト・プロテクトすることも、不揮発性メモリをライト・ロックすることもできない。特許文献1の発明では、前回のブートにおいてOSがGVを改変したり消去したりすると今回のブート時にUEFIファームウェアがデフォルト値でGVを書き換えるため、OSに対してGVの書き換えを許容しながらUEFIファームウェアのブートルーチンに支障がでないようにすることができる。   Further, the OS may not be installed unless a predetermined GV is modified. Therefore, it is impossible to individually write protect the protection target GV using the authentication service (Variable Authentication) defined by the UEFI standard, and to write lock the nonvolatile memory. In the invention of Patent Document 1, if the OS modifies or deletes the GV in the previous boot, the UEFI firmware rewrites the GV with a default value at the time of this boot, so the UEFI firmware allows the OS to rewrite the GV. The boot routine can be made unimpeded.

しかし、不揮発性メモリの書き換えはブート時間の遅延をもたらす。また、OSは頻繁にGVを改変するためブートごとに書き換えが発生する。不揮発性メモリは消去および書き込み回数が増加すると酸化膜が劣化して記憶保持の信頼性が低下する。本発明はこのような背景のもとに、UEFIファームウェアのようなシステム・ファームウェアが起動時に参照する変数を保護するための諸問題を解決することを目的にする。   However, rewriting the non-volatile memory causes a delay in boot time. In addition, since the OS frequently changes the GV, rewriting occurs at every boot. In the nonvolatile memory, when the number of times of erasing and writing increases, the oxide film deteriorates and the reliability of memory retention decreases. The present invention is based on such a background, and an object thereof is to solve various problems for protecting a variable referred to by a system firmware such as UEFI firmware at startup.

本発明の一の態様では、不揮発性メモリはオペレーティング・システムが改変することが可能な変数を格納する。システム・ファームウェアはコンピュータに、変数を参照してプリブートを実行する機能と、変数を保護対象変数と非保護対象変数のいずれかとして認識する機能と、保護対象変数を代替メモリにコピーする機能と、変数にアクセスするためのリクエストに応じてアクセス先を判断する機能とを実現させる。変数はUEFI規格で定義するグローバル・バリアブルであってもよい。   In one aspect of the invention, the non-volatile memory stores variables that can be modified by the operating system. The system firmware allows the computer to perform a pre-boot by referring to the variable, to recognize the variable as either a protected variable or an unprotected variable, and to copy the protected variable to alternative memory, A function for determining an access destination according to a request for accessing a variable is realized. The variable may be a global variable defined in the UEFI standard.

本発明の他の態様では、コンピュータが不揮発性メモリに格納した変数を保護する。変数を保護対象変数と非保護対象変数に区分するステップと、変数を参照してブートを実行するステップと、保護対象変数を代替メモリにコピーするステップと、オペレーティング・システムから変数を改変するリクエストを受け取るステップと、リクエストの対象が保護対象変数のときに代替メモリにコピーした保護対象変数を改変するステップとを有する。リクエストの対象が非保護対象変数のときは、不揮発性メモリに格納した非保護対象変数を改変することができる   In another aspect of the invention, the computer protects variables stored in non-volatile memory. Dividing the variable into protected and unprotected variables, performing a boot with reference to the variable, copying the protected variable to alternate memory, and requesting the variable to be modified from the operating system. And receiving and modifying the protection target variable copied to the alternative memory when the target of the request is the protection target variable. When the target of the request is an unprotected variable, the unprotected variable stored in the non-volatile memory can be modified

本発明により、以下のいずれかまたはすべての効果を奏することができた。第1に、システム・ファームウェアがアクセスする変数を保護することができた。第2にOSが正常に動作できるようにしながらそのような変数を保護することができた。さらに、ブートの遅延をもたらさないようにしながらそのような変数を保護することができた。さらに、不揮発性メモリに対する書込回数が増大しないようにしながらそのような変数を保護することができた。   According to the present invention, any or all of the following effects could be achieved. First, the variables accessed by the system firmware could be protected. Secondly, such variables could be protected while allowing the OS to operate normally. Furthermore, such variables could be protected while not causing boot delays. Furthermore, such a variable could be protected while preventing the number of writes to the nonvolatile memory from increasing.

PC10の主要なハードウェアの構成を示す概略の機能ブロック図である。2 is a schematic functional block diagram showing a configuration of main hardware of a PC 10. FIG. ファームウェアROM100のデータ構造の一例を示す図である。3 is a diagram illustrating an example of a data structure of a firmware ROM 100. FIG. PC10が実装するソフトウェアの実行状態における階層構造を示す図である。It is a figure which shows the hierarchical structure in the execution state of the software which PC10 mounts. UEFIファームウェア150が変数領域に対するアクセスを制御する手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure in which UEFI firmware 150 controls access with respect to a variable area. 保護対象GV153をSMRAM領域15aにコピーする手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure which copies the protection object GV153 to the SMRAM area | region 15a. バリアブル・サービスの動作手順の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement procedure of variable service.

[ハードウェアの概略構成]
図1は、ノートブック型またはラップトップ型のPC10の主要なハードウェアの構成を示す機能ブロック図である。多くのハードウェアの構成は周知であるため、本発明の理解に必要な範囲で説明する。チップセット13はさまざまな規格のインターフェース機能を備えており、CPU11、システム・メモリ(RAM)15、GPU17、HDD21、USBコネクタ23、有線または無線のLANに接続するためのネットワーク・モジュール25、およびキーボード29などが接続されている。GPU17にはLCD19が接続されている。さらにチップセット13が含む、SPI(Serial Peripheral Interface)コントローラ14にはファームウェアROM100が接続されている。
[General hardware configuration]
FIG. 1 is a functional block diagram showing a main hardware configuration of a notebook type or laptop type PC 10. Many hardware configurations are well known and will be described within the scope necessary for understanding the present invention. The chip set 13 has interface functions of various standards, and includes a CPU 11, a system memory (RAM) 15, a GPU 17, an HDD 21, a USB connector 23, a network module 25 for connecting to a wired or wireless LAN, and a keyboard. 29 and the like are connected. An LCD 19 is connected to the GPU 17. Further, a firmware ROM 100 is connected to an SPI (Serial Peripheral Interface) controller 14 included in the chip set 13.

システム・メモリ15のメモリ空間には、システムの電源が起動したときにSMRAM領域15aが確保される。SMRAM領域15aは、CPU11がシステム・マネジメント・モード(SMM)で動作するときに実行するコードをロードする領域である。HDD21はブート・デバイスで、UEFI規格に対応するOSのブート・イメージを格納する。   In the memory space of the system memory 15, an SMRAM area 15a is secured when the system power supply is activated. The SMRAM area 15a is an area for loading a code to be executed when the CPU 11 operates in the system management mode (SMM). The HDD 21 is a boot device and stores an OS boot image corresponding to the UEFI standard.

HDD21のブート・セクタは、OSのブート・イメージをロードするためのUEFI_OSローダー163(図3)を格納する。USBコネクタ23には、外付けのUSBメモリ、USB_CD、USB_FDD、USB_HDDなどのUSBデバイスを接続することができる。PC10は、USBコネクタ23に接続されたブート・イメージを格納するUSBデバイスからブートすることもできる。PC10は、PXE(Preboot eXecution Environment)などの機能により、ネットワーク・モジュール25を通じてOSのブート・イメージを受け取ってPXEブートすることもできる。   The boot sector of the HDD 21 stores a UEFI_OS loader 163 (FIG. 3) for loading an OS boot image. A USB device such as an external USB memory, USB_CD, USB_FDD, or USB_HDD can be connected to the USB connector 23. The PC 10 can also boot from a USB device that stores a boot image connected to the USB connector 23. The PC 10 can receive a boot image of the OS through the network module 25 and perform PXE boot by using a function such as PXE (Preboot eXecution Environment).

[ファームウェアROMのデータ構造]
図2は、ファームウェアROM100のデータ構造を示す図で、図3はシステム・メモリ15にロードされて実行状態にあるソフトウェアの階層構造を示す図である。ファームウェアROM100は、不揮発性で記憶内容の電気的な書き替えが可能なフラッシュ・メモリで、一例としてコード領域101、変数領域103〜109およびデータ領域111からなる記億ブロックに区分している。変数領域103〜109およびデータ領域111の記億ブロックは、ファームウェアROM100とは異なる不揮発性メモリに設けてもよい。
[Firmware ROM data structure]
FIG. 2 is a diagram showing a data structure of the firmware ROM 100, and FIG. 3 is a diagram showing a hierarchical structure of software loaded in the system memory 15 and in an execution state. The firmware ROM 100 is a flash memory that is non-volatile and can be electrically rewritten, and, as an example, is divided into memory blocks including a code area 101, variable areas 103 to 109, and a data area 111. The storage blocks of the variable areas 103 to 109 and the data area 111 may be provided in a nonvolatile memory different from the firmware ROM 100.

コード領域101は、UEFIファームウェア150およびUEFIアプリケーション165のコードを格納する。変数領域103はデフォルトGV151を格納し、変数領域105は保護対象GV153と非保護対象GV155からなるGVを格納する。なお、以下において保護対象GV153と非保護対象GV155を区別しないときは単にGVと称する。変数領域107はConfiguration Variables(CV)157を格納し、変数領域109はUser Variables(UV)159を格納する。データ領域111は制御リスト161を格納する。   The code area 101 stores codes of the UEFI firmware 150 and the UEFI application 165. The variable area 103 stores a default GV 151, and the variable area 105 stores a GV composed of a protection target GV 153 and a non-protection target GV 155. In the following, when the protection target GV153 and the non-protection target GV155 are not distinguished, they are simply referred to as GV. The variable area 107 stores Configuration Variables (CV) 157, and the variable area 109 stores User Variables (UV) 159. The data area 111 stores a control list 161.

最初に変数領域103〜109が格納する変数について説明する。デフォルトGV151はUEFIベンダーが書き込んだGVで、システムの動作に異常が発生した場合や何らかの理由で必要がある場合にユーザがシステムを初期化するために利用する。本実施の形態ではデフォルトGV151を、ブートごとに変数領域105のGVを置換するためには利用しない。   First, the variables stored in the variable areas 103 to 109 will be described. The default GV 151 is a GV written by the UEFI vendor, and is used by the user to initialize the system when an abnormality occurs in the operation of the system or for some reason. In this embodiment, the default GV 151 is not used to replace the GV in the variable area 105 at every boot.

GVはUEFI規格において定義されており、UEFIファームウェア150、UEFIアプリケーション165、OS167およびOSアプリケーション169(図3)のいずれからもアクセスできることが保証されている。なお、以下においてはOS167と称した場合にOSアプリケーション169も含む場合がある。GVに対するアクセスは、新たなGVの書き込み、変更、削除および読み取りなどに相当する。GVの書き込み、変更および削除は、オリジナル・バリアブル・サービス150bまたは新バリアブル・サービス150fのファンクションを構成するSetVariableという関数を呼び出す。   GV is defined in the UEFI standard, and is guaranteed to be accessible from any of the UEFI firmware 150, the UEFI application 165, the OS 167, and the OS application 169 (FIG. 3). In the following, the OS application 169 may be included when referred to as the OS 167. Access to the GV corresponds to writing, changing, deleting, reading, etc. of a new GV. Writing, changing, and deleting GV calls a function called SetVariable that constitutes a function of the original variable service 150b or the new variable service 150f.

GVの読み取りはオリジナル・バリアブル・サービス150bまたは新バリアブル・サービス150fのファンクションを構成するGetVariableという関数を呼び出す。保護対象GV153は、一例としてBoot####、BootOrder、BootNext、Driver####、DriverOrderといったブート・デバイスの種類とその選択順位、デバイス・ドライバの種類とその選択順位といったようなブートに関連する変数を含む。さらに保護対象GVは、ConIn、ConOutといった入出力デバイスまでのパスのようなハードウェアの構成に関連する変数を含む。   Reading GV calls a function called GetVariable that constitutes the function of the original variable service 150b or the new variable service 150f. For example, the protection target GV153 is related to booting such as boot device type such as Boot ####, BootOrder, BootNext, Driver ####, DriverOrder, and its selection order, and device driver type and its selection order. Variable to be included. Furthermore, the protection target GV includes variables related to the hardware configuration such as paths to input / output devices such as ConIn and ConOut.

保護対象GV153がUEFIファームウェア150以外のプログラムによって書き換えられるとシステムが正常に起動できなくなる可能性がある。GVの問題がある改変は、OS167、UEFIアプリケーション165またはマルウェアがSetVariableを呼び出したときに発生する。保護対象GV153は、問題がある改変から保護する対象となる変数に相当する。   If the protection target GV 153 is rewritten by a program other than the UEFI firmware 150, the system may not be able to start up normally. A modification with a GV problem occurs when the OS 167, UEFI application 165 or malware calls SetVariable. The protection target GV153 corresponds to a variable that is a target to be protected from a problematic modification.

ユーザは、UEFIファームウェア150のセット・アップ画面を通じて保護対象GV153を改変することができる。この場合、UEFIファームウェア150が認識しているため問題がある改変には相当しない。GVの保護は、UEFIファームウェア150がブートルーチンを実行するためにアクセスする場所の一例である変数領域105に格納した保護対象GV153が、UEFIファームウェア150以外のプログラムによって改変されないようにすることを意味する。   The user can modify the protection target GV 153 through the setup screen of the UEFI firmware 150. In this case, since the UEFI firmware 150 recognizes it, it does not correspond to a problematic modification. The protection of GV means that the protection target GV153 stored in the variable area 105, which is an example of a place where the UEFI firmware 150 accesses to execute the boot routine, is not modified by a program other than the UEFI firmware 150. .

本実施の形態では、図4〜図7で説明するようにGVを保護しながらOS167が所定の動作のために必要な保護対象GV153にアクセスすることを可能にする。非保護対象GV155は、保護対象GV153以外のGVで、ブートやハードウェアの構成に関係しない変数に相当する。非保護対象GV155は、UEFIファームウェア150がブートルーチンを実行する際に、変数領域105にUEFIファームウェア150以外のプログラムで改変された状態で存在してもよい。   In this embodiment, the OS 167 can access the protection target GV 153 necessary for a predetermined operation while protecting the GV as described with reference to FIGS. The non-protection target GV155 is a GV other than the protection target GV153, and corresponds to a variable not related to the boot or hardware configuration. The unprotected target GV 155 may exist in a state modified by a program other than the UEFI firmware 150 in the variable area 105 when the UEFI firmware 150 executes a boot routine.

CV157は、UEFIファームウェア150が、ブートの際にデバイスの認識や初期化などの処理をするために、変数領域107に書き込んだ変数に相当する。CV157は、UEFIファームウェア150のベンダーが定義する。UEFIファームウェア150は、オリジナル・バリアブル・サービス150bを利用してCV157を書き込むことができる。   The CV 157 corresponds to a variable written in the variable area 107 by the UEFI firmware 150 for processing such as device recognition and initialization at the time of booting. CV157 is defined by the UEFI firmware 150 vendor. The UEFI firmware 150 can write the CV 157 using the original variable service 150b.

CV157はUEFIファームウェア150が設定するデバイスの属性情報およびデバイスに設定するパラメータ、セット・アップ画面を呼び出してユーザが設定したデバイスの種類、デバイスの動作モード、およびデバイスの有効/無効などの設定情報、ブート・イメージが格納されているパーティションのパスやロードするOSの種類などの情報を含む。CV157はブートに不可欠な変数を含むが、UEFI規格では公開性が要求されないので変数領域107をライト・ロックしてOS167やマルウェアによる改変から保護することができる。   The CV157 is device attribute information set by the UEFI firmware 150 and parameters to be set in the device, device type set by the user by calling the setup screen, device operation mode, and setting information such as device enable / disable, It includes information such as the path of the partition where the boot image is stored and the type of OS to be loaded. The CV 157 includes variables indispensable for booting. However, since the publicity is not required in the UEFI standard, the variable area 107 can be write-locked to be protected from modification by the OS 167 or malware.

UV159は、OS167、UEFIアプリケーション165が、その実行に際して自らをカスタマイズするための環境変数や、デバッグ・ログまたはエラー・ログのようなダンプ・ファイルをUEFI規格の制約を受けないで自由に書き込む変数に相当する。UEFIファームウェア150は、オリジナル・バリアブル・サービス150bを利用してUV159を書き込むことができる。   UV159 is an environment variable that allows the OS 167 and UEFI application 165 to customize itself during execution, and a dump file such as a debug log or error log that can be freely written without being restricted by the UEFI standard. Equivalent to. The UEFI firmware 150 can write UV159 using the original variable service 150b.

本実施の形態では、コード領域101、変数領域103、107およびデータ領域109に、チップセット13のSPIコントローラ14においてライト・ロックが可能な記録領域を割り当てている。ライト・ロックが実行された記録領域に対しては、チップセット13がリセットされるまですべてのプログラムの書き込みが禁止される。UEFIファームウェア150は、ブートの際に安全が保証されたコードから、他のコードにCPU11の制御権を渡す前にファームウェアROM100のコード領域101、変数領域103、107およびデータ領域111をライト・ロックすることができる。   In the present embodiment, recording areas that can be write-locked by the SPI controller 14 of the chipset 13 are allocated to the code area 101, the variable areas 103 and 107, and the data area 109. In the recording area where the write lock is executed, writing of all programs is prohibited until the chip set 13 is reset. The UEFI firmware 150 writes and locks the code area 101, the variable areas 103 and 107, and the data area 111 of the firmware ROM 100 before passing the control right of the CPU 11 to other codes from the code guaranteed to be safe at the time of booting. be able to.

UEFIファームウェア150は、初期化コード150a、オリジナル・バリアブル・サービス(Variable Services)150b、ブート・マネージャ150c、セット・アップ・コード150d、GV制御コード150e、新バリアブル・サービス150f、およびUEFIドライバ150gを含む。UEFIファームウェア150は一例において、書き換えに伴うリスクを軽減するためにブート・ブロック方式を採用することができる。ブート・ブロック方式では、初期化コード150aを格納する領域をブート・ブロックに設定する。ブート・ブロックに格納されたコードはTPM(Trusted Platform Module)の仕様書に規定するCRTM(Core Root Of Trust Measurement)として扱われ特別な権限がないと書き換えができないようになっている。   The UEFI firmware 150 includes an initialization code 150a, an original variable services 150b, a boot manager 150c, a setup code 150d, a GV control code 150e, a new variable service 150f, and a UEFI driver 150g. . In one example, the UEFI firmware 150 can employ a boot block method in order to reduce the risk associated with rewriting. In the boot block method, an area for storing the initialization code 150a is set as a boot block. The code stored in the boot block is handled as CRTM (Core Root Of Trust Measurement) defined in the TPM (Trusted Platform Module) specification and cannot be rewritten without special authority.

CRTMは、プラットフォームの初期化コードの中で完全性が保証されている部分として構成され、プラットフォームのリセット時には必ず最初に実行される。CRTMは、PC10がACPIに規定するハイバネーション状態(S4ステート)またはパワー・オフ状態(S5ステート)からパワー・オン状態(S0ステート)に遷移するための動作プロセスであるいわゆるコールド・ブートのときに必ず最初に実行される。   The CRTM is configured as a part of the platform initialization code where integrity is guaranteed and is always executed first when the platform is reset. The CRTM is always executed at the time of so-called cold boot, which is an operation process for the PC 10 to transition from the hibernation state (S4 state) or the power-off state (S5 state) to the power-on state (S0 state) specified in ACPI. First run.

初期化コード150aは、PC10がコールド・ブートをする際に、システム・メモリ15にUEFIファームウェア150をロードして実行を開始するために必要なCPU11、システム・メモリ15およびその他の基本的なデバイスの検出、検査および初期化を必要な範囲で行う。初期化コード150aはまた、CPU11がリセットしてから、UEFI_OSローダー163に制御が移行するまでの期間にチップセット13のコントローラや周辺デバイスなどの所定のデバイスを初期化して使用できる状態にする。初期化コード150aは、UEFIファームウェア150のコードのオリジナルからの一貫性または完全性を検査して改竄を発見した場合はブートを停止する。   The initialization code 150a is stored in the CPU 11, the system memory 15 and other basic devices necessary for loading the UEFI firmware 150 into the system memory 15 and starting execution when the PC 10 is cold booted. Perform detection, inspection, and initialization as necessary. The initialization code 150a also initializes a predetermined device such as a controller of the chipset 13 or a peripheral device in a period from when the CPU 11 is reset to when control is transferred to the UEFI_OS loader 163. The initialization code 150a stops booting if it checks for consistency or integrity from the original of the UEFI firmware 150 code and finds tampering.

オリジナル・バリアブル・サービス150bは、変数領域105に格納したGVにアクセスするためのGetVariable、 GetNextVariableName、SetVariableなどのファンクションを含む。ブート・マネージャ150cは、ブート処理およびパスワード認証処理などを行う。ブート・マネージャ150cは、UEFIファームウェア150によるブートルーチンが終了すると、UEFIアプリケーション165、およびUEFI_OSローダー163をシステム・メモリ15にロードする。ここに、システムがコールド・ブートしてからUEFIファームウェア150以外のコードにCPU11の制御権が移るまでの動作状態をプリブートという。   The original variable service 150 b includes functions such as GetVariable, GetNextVariableName, and SetVariable for accessing the GV stored in the variable area 105. The boot manager 150c performs boot processing and password authentication processing. When the boot routine by the UEFI firmware 150 is completed, the boot manager 150 c loads the UEFI application 165 and the UEFI_OS loader 163 into the system memory 15. Here, the operation state from when the system is cold booted until the control right of the CPU 11 is transferred to a code other than the UEFI firmware 150 is referred to as preboot.

プリブートは、CRTMにより一貫性が検証されたコードを実行する動作状態ということができる。プリブートはあるいはSPIコントローラ14によりコード領域101がライト・ロックされるまでの動作状態ということもできる。プリブートの間は、安全性が確保されたUEFIファームウェア150だけが変数領域105のGVを改変することができる。ブート・マネージャ150cは、プリブートが終了してUEFIファームウェア150からOS167にCPU11の制御権が移る直前に、UEFI_OSローダー163をシステム・メモリ15に読み出して完全性の検証をすることができる。   Preboot can be said to be an operating state in which code whose consistency has been verified by CRTM is executed. It can also be said that the pre-boot is an operation state until the code area 101 is write-locked by the SPI controller 14. During the preboot, only the UEFI firmware 150 that is secured can modify the GV in the variable area 105. The boot manager 150c can read out the UEFI_OS loader 163 to the system memory 15 and verify the integrity immediately before the end of pre-boot and the control of the CPU 11 from the UEFI firmware 150 to the OS 167.

本明細書でブートとは、電源が起動してからプリブートを経由してOS167のロードが完了した状態になるまでの一連の処理をいう。UEFI_OSローダー163には作成者が計算したハッシュ値を秘密鍵で暗号化した電子署名が付されている。ブート・マネージャ150cは、UEFI_OSローダー163のコードから計算したハッシュ値と、署名データ・ベースから取得した公開鍵で復号して得た電子署名のハッシュ値を比較して、一致していれば完全性が維持されていると判断してUEFI_OSローダー163の実行を許可する。   In this specification, booting refers to a series of processes from when the power is activated until the loading of the OS 167 is completed via preboot. The UEFI_OS loader 163 has an electronic signature obtained by encrypting a hash value calculated by the creator with a secret key. The boot manager 150c compares the hash value calculated from the code of the UEFI_OS loader 163 with the hash value of the electronic signature obtained by decrypting with the public key acquired from the signature data base. Is permitted to execute the UEFI_OS loader 163.

セット・アップ・コード150dは、プリブートの段階でキーボード29の所定のファンクション・キーが押下されたたときに、LCD19にセット・アップ画面を表示する。ユーザはセット・アップ画面を通じて、ブート・デバイスの優先順位の決定、起動方法の設定、使用デバイスの設定、パスワードの設定およびパワー・マネジメントの設定などをすることができる。   The set-up code 150d displays a set-up screen on the LCD 19 when a predetermined function key of the keyboard 29 is pressed at the pre-boot stage. Through the setup screen, the user can determine the priority of the boot device, set the startup method, set the device to be used, set the password, and set the power management.

セット・アップ・コード150dは、セット・アップ画面を通じて入力された設定情報を一例として変数領域107にCVとして書き込む。セット・アップ・コード150dを通じて行われる保護対象GVの改変は、UEFIファームウェア150が認識しているのでブートルーチンに問題を生じさせない。また、UEFIアプリケーション165とOS167は、独自の必要性に基づいてGVを改変することができる。   The setup code 150d writes the setting information input through the setup screen as a CV in the variable area 107 as an example. The modification of the protection target GV performed through the setup code 150d does not cause a problem in the boot routine because the UEFI firmware 150 recognizes it. Also, the UEFI application 165 and the OS 167 can modify the GV based on unique needs.

その結果、保護対象GV153の改変がUEFIファームウェア150のブートルーチンに影響を与える場合があるため、本実施の形態では、UEFIアプリケーション165やOS167による改変から変数領域105の保護対象GV153を保護する。他方で、OS167が保護対象GV153を改変しないと意図する動作環境を構築できない場合がある。このような状況に対処するために、セット・アップ画面は、本実施の形態にかかるGVの保護機能に対してイネーブル/ディスエーブルの設定をするメニューを含む。イネーブル/ディスエーブルの設定情報は、ファームウェアROM100の所定の場所に記録される。   As a result, since the modification of the protection target GV 153 may affect the boot routine of the UEFI firmware 150, in this embodiment, the protection target GV 153 in the variable area 105 is protected from modification by the UEFI application 165 or the OS 167. On the other hand, there are cases where the intended operating environment cannot be constructed unless the OS 167 modifies the protection target GV153. In order to cope with such a situation, the setup screen includes a menu for setting enable / disable for the protection function of the GV according to the present embodiment. Enable / disable setting information is recorded in a predetermined location of the firmware ROM 100.

GV制御コード150eは、図4〜図7の手順で説明するGVの保護のための処理をする。新バリアブル・サービス150fは図6、図7で説明するように、OS167やUEFIアプリケーション165がSMRAM領域15aにコピーした保護対象GV153にアクセスするためのGetVariable、GetNextVariableName、SetVariableなどのファンクションを含む。UEFIアプリケーション165は、UEFIファームウェア150の上層で動作し、UEFIドライバ150gは、UEFIファームウェア150が特定のハードウェアにアクセスするための処理をする。制御リスト161は、保護対象GV153の識別子(VendorGuidおよびVariableName)を記述する。   The GV control code 150e performs processing for protecting the GV, which is described in the procedure of FIGS. The new variable service 150f includes functions such as GetVariable, GetNextVariableName, and SetVariable for accessing the protection target GV153 copied by the OS 167 and the UEFI application 165 to the SMRAM area 15a, as described with reference to FIGS. The UEFI application 165 operates on the upper layer of the UEFI firmware 150, and the UEFI driver 150g performs processing for the UEFI firmware 150 to access specific hardware. The control list 161 describes the identifiers (VendorGuid and VariableName) of the protection target GV153.

[保護対象GVの改変を禁止する手順]
図4〜図7は、UEFIファームウェア150がGVを保護する手順の一例を示すフローチャートである。図4のブロック201で、PC10の電源が起動してシステムがコールド・ブートを開始する。このとき図2に示すように、変数領域105には、保護対象GV153と非保護対象GV155が格納され、変数領域107にはCV157が格納され、変数領域109にはUV159が格納され、データ領域111には、制御リスト161が格納されている。図6で詳細に説明するブロック217の手順があるため、変数領域105が格納する保護対象GV153は、前回のブートで改変されていないことが保証されている。
[Procedure to prohibit modification of protected GV]
4 to 7 are flowcharts illustrating an example of a procedure in which the UEFI firmware 150 protects the GV. In block 201 of FIG. 4, the PC 10 is powered on and the system starts a cold boot. At this time, as shown in FIG. 2, the protection target GV 153 and the non-protection target GV 155 are stored in the variable area 105, the CV 157 is stored in the variable area 107, the UV 159 is stored in the variable area 109, and the data area 111. Stores a control list 161. Since there is a procedure of block 217 described in detail in FIG. 6, it is guaranteed that the protection target GV 153 stored in the variable area 105 has not been modified in the previous boot.

パワー・オン・リセットしたチップセット13は、ブロック203でSPIコントローラ14に設定していたファームウェアROM100のコード領域101、変数領域103、107およびデータ領域111に対するライト・ロックを解除する。つづいてブロック205で初期化コード150aがプリブートに必要なデバイスを初期化すると、UEFIファームウェア150がシステム・メモリ15にロードされる。初期化コード150aはつづいて変数領域105が格納する保護対象GV153、および変数領域107が格納するCV157を参照して、必要な範囲でその他のデバイスを初期化する。つづいてUEFIファーウェア150はPOST(Power On Self-Test)を開始する。   The power-on-reset chipset 13 releases the write lock on the code area 101, variable areas 103 and 107, and data area 111 of the firmware ROM 100 set in the SPI controller 14 in block 203. Subsequently, the UEFI firmware 150 is loaded into the system memory 15 when the initialization code 150a initializes a device required for preboot in block 205. The initialization code 150a refers to the protection target GV 153 stored in the variable area 105 and the CV 157 stored in the variable area 107, and initializes other devices within a necessary range. Subsequently, the UEFI firmware 150 starts POST (Power On Self-Test).

プリブートの間ブロック207でUEFIファームウェア150は、変数領域105のGVを改変する。UEFIファームウェア150は、初期化コード150aによって一貫性が検証されているか、OSの動作環境ではSPIコントローラ15aのライト・ロックによって保護されているためマルウェアによる汚染の恐れがなく、保護対象GV153が改変されても次回のプリブートに支障をきたすことはない。ブロック208で、ユーザはセット・アップ画面を呼び出してGVの保護機能をイネーブルまたはディスエーブルに設定することができる。   During preboot, the UEFI firmware 150 modifies the GV in the variable area 105 at block 207. The UEFI firmware 150 is verified for consistency by the initialization code 150a, or is protected by the write lock of the SPI controller 15a in the operating environment of the OS, so there is no risk of contamination by malware, and the protected GV153 is modified. But it won't interfere with the next pre-boot. At block 208, the user can invoke a setup screen to enable or disable GV protection.

ブロック209でGV制御コード150eは、変数領域105が格納するGVのなかで保護対象GV153だけを、システム・メモリ15のSMRAM領域15aのような代替メモリにコピーする。システム・メモリ15は書き込み速度が速いため代替メモリとして望ましいが、退避先をシステム・メモリ15に限定する必要はない。また、代替メモリにコピーする保護対象GV153は次回のプリブートで使用しないため、代替メモリは揮発性メモリでも不揮発性メモリでもよい。保護対象GV153をコピーするタイミングは、UEFIファームウェア150による保護対象GV153の改変が終了してからプリブートが終了するまでの間とすることができる。   In block 209, the GV control code 150 e copies only the protection target GV 153 in the GV stored in the variable area 105 to an alternative memory such as the SMRAM area 15 a of the system memory 15. The system memory 15 is desirable as an alternative memory because of its high writing speed, but it is not necessary to limit the save destination to the system memory 15. Further, since the protection target GV 153 to be copied to the alternative memory is not used in the next preboot, the alternative memory may be a volatile memory or a nonvolatile memory. The timing for copying the protection target GV 153 can be from the end of the modification of the protection target GV 153 by the UEFI firmware 150 to the end of preboot.

図5は、図4のブロック209の手順の一例を示すフローチャートである。ブロック213でプリブートの終了のタイミングを認識したGV制御コード150eはブロック233で、オリジナル・バリアブル・サービス150bのGetNextVariableNameを呼び出して変数領域105からGVを読み取る。GetNextVariableNameは、システムにおいて利用可能なGV、CV、UVすべての変数を列挙する関数で、呼び出されたときに保持する変数の次の変数の識別子をGV制御コード150eに戻す。GetNextVariableNameは、GV、CV、UVのすべての識別子を戻したあとにさらに呼び出されたときはエラーを戻す。ブロック235でGV制御コード150eは、オリジナル・バリアブル・サービス150bからエラーを受け取ったときにGV、CV、UVのすべての変数を読み取ったと判断してブロック241で終了する。   FIG. 5 is a flowchart showing an example of the procedure of block 209 in FIG. The GV control code 150e that has recognized the end timing of preboot in block 213 calls GetNextVariableName of the original variable service 150b and reads GV from the variable area 105 in block 233. GetNextVariableName is a function that enumerates all the variables of GV, CV, and UV that can be used in the system, and returns the identifier of the variable next to the variable that is held when called to the GV control code 150e. GetNextVariableName returns an error when called further after returning all identifiers of GV, CV, and UV. In block 235, the GV control code 150e determines that all GV, CV, and UV variables have been read when an error is received from the original variable service 150b, and the process ends in block 241.

オリジナル・バリアブル・サービス150bから変数の識別子を受け取ったGV制御コード150eはブロック237で、制御リスト161を参照して読み出したGVが制御リスト161に登録された保護対象GV153であるか否かを判断する。保護対象GV153であると判断したときはブロック239に移行し、非保護対象GV155であると判断したときはブロック233に戻る。ブロック239でGV制御コード150eは、当該保護対象GV153をSMRAM領域15aにコピーしてからブロック233に戻る。   The GV control code 150e that received the variable identifier from the original variable service 150b determines in block 237 whether the GV read with reference to the control list 161 is the protection target GV 153 registered in the control list 161. To do. When it is determined that it is the protection target GV153, the process proceeds to block 239, and when it is determined that it is the non-protection target GV155, the process returns to block 233. In block 239, the GV control code 150e copies the protection target GV153 to the SMRAM area 15a, and then returns to block 233.

GV制御コード150eはブロック233でさらにGetNextVariableNameを呼び出して、次の変数の識別子を取得してブロック237で保護対象GV153であるか否かを判断する。ブロック231〜241の手順を実行すると変数領域105に格納されたGVのなかで、保護対象GV153がすべてSMRAM領域15aにコピーされる。   The GV control code 150e further calls GetNextVariableName at block 233 to acquire the identifier of the next variable, and at block 237, determines whether or not it is a protection target GV153. When the procedures of blocks 231 to 241 are executed, all of the protection target GV153 in the GV stored in the variable area 105 is copied to the SMRAM area 15a.

SMRAM領域15aへのコピーは、他の方法でも行うことができる。たとえば、変数領域105を保護対象GV153だけを格納する記憶ブロックと非保護対象GV155だけを格納する記憶ブロックに区分する。コピーの際には、保護対象GV153だけを格納する記憶ブロックのアドレスを指定する。この方法によれば、制御リスト161を利用しないですべての保護対象GV153をコピーすることができる。   Copying to the SMRAM area 15a can also be performed by other methods. For example, the variable area 105 is divided into a storage block that stores only the protection target GV153 and a storage block that stores only the non-protection target GV155. At the time of copying, the address of the storage block that stores only the protection target GV153 is designated. According to this method, it is possible to copy all the protection target GV153 without using the control list 161.

図4に戻ってブロック211でGV制御コード150eは、プリブートが終了する直前に、コード領域101、変数領域103、107およびデータ領域111をライト・ロックするためにチップセット13のSPIコントローラ14を設定する。ブロック213でプリブートが終了すると、ブロック215で、ブート・マネージャ150cは、コード領域101からシステム・メモリ150にUEFIアプリケーション165をロードし、HDD21の所定のセクタからUEFI_OSローダー163をロードする。   Returning to FIG. 4, in block 211, the GV control code 150e sets the SPI controller 14 of the chipset 13 to write / lock the code area 101, the variable areas 103 and 107, and the data area 111 immediately before the preboot is completed. To do. When the preboot is completed in block 213, the boot manager 150c loads the UEFI application 165 from the code area 101 to the system memory 150 and loads the UEFI_OS loader 163 from a predetermined sector of the HDD 21 in block 215.

やがてOS167がロードされてPC10はOSブート状態に移行する。ブロック217でOS167はGVにアクセスすることができる。ブロック217の手順の詳細は図6を参照して説明する。ブロック219でパワー・オフ状態に遷移したあとに、ブロック201に戻って次回のコールド・ブートをする。このときブロック217の手順で、変数領域103の保護対象GV153が保護されているため次回のプリブートが失敗することはない。   Eventually, the OS 167 is loaded and the PC 10 shifts to the OS boot state. At block 217, the OS 167 can access the GV. Details of the procedure of block 217 will be described with reference to FIG. After the transition to the power-off state at block 219, the process returns to block 201 to perform the next cold boot. At this time, since the protection target GV153 in the variable area 103 is protected in the procedure of the block 217, the next pre-boot does not fail.

図6は、図4のブロック217の手順の一例を示すフローチャートである。ブロック251でUEFIファームウェア150、UEFIアプリケーション165、OS167のいずれかに相当するコーラーがGetVariable、またはSetVariableを呼び出してGVにアクセスする。ブロック253〜256は、GVの保護条件の判断に相当する。ブロック253でGV制御コード150eは、アクセスがプリブート中に行われたと判断したときはブロック261に移行し、プリブートが終了した後に行われたと判断したときはブロック255に移行する。   FIG. 6 is a flowchart showing an example of the procedure of block 217 in FIG. In block 251, a caller corresponding to any of the UEFI firmware 150, the UEFI application 165, and the OS 167 calls GetVariable or SetVariable to access the GV. Blocks 253 to 256 correspond to determination of GV protection conditions. In block 253, the GV control code 150e shifts to block 261 when it is determined that the access was performed during pre-boot, and shifts to block 255 when it is determined that the access was performed after the pre-boot was completed.

ブロック253からブロック261に移行するときは、保護対象GV153と非保護対象GV155のいずれかがアクセスの対象になっている。プリブートが終了したあとの動作環境で、変数領域105が格納する保護対象GV153の改変を許可すると、次回のブートに問題がでる可能性があるため、GVの保護機能は原則としてイネーブルに設定することが望ましい。しかし、ユーザが保護対象GV153の安全性を考慮した上で、変数領域105の保護対象GV153の改変を許可する必要がある場合もある。   When shifting from the block 253 to the block 261, either the protection target GV153 or the non-protection target GV155 is an access target. If the modification of the protection target GV153 stored in the variable area 105 is permitted in the operating environment after the preboot is completed, there is a possibility that a problem will occur in the next boot. Therefore, the protection function of GV should be enabled in principle. Is desirable. However, the user may need to permit modification of the protection target GV 153 in the variable area 105 in consideration of the safety of the protection target GV 153.

たとえば、OS167をローカルのブート・デバイスからブートするように保護対象GV153に設定しているときに、ネットワークを経由してPXEブートをしたい場合がある。このとき、OS167が変数領域105の保護対象GV153のブート・オーダーを改変しないとリモート・ブートは実現できない。また、ウィルス対策ソフトの中には、プリブートの終了後にOSより先にロードして実行するものがある。この場合も、ウィルス対策ソフトによる変数領域153の保護対象GV153の改変を許容する必要がある。   For example, when the protection target GV 153 is set to boot the OS 167 from a local boot device, it may be desired to perform a PXE boot via a network. At this time, the remote boot cannot be realized unless the OS 167 modifies the boot order of the protection target GV 153 in the variable area 105. Some anti-virus software is loaded and executed prior to the OS after pre-boot is completed. In this case as well, it is necessary to allow modification of the protection target GV153 in the variable area 153 by the anti-virus software.

OS167が変数領域105の保護対象GV153を改変する必要があるときにユーザはセット・アップ画面を通じてGVの保護機能をディスエーブルに設定する。ブロック255でGV制御コード150eはファームウェアROM100に記録された設定情報からGVの保護機能を判断する。GV制御コード150eは、GVの保護機能がイネーブルに設定されているときはブロック256に移行し、ディスエーブルに設定されているときはブロック261に移行する。   When the OS 167 needs to modify the protection target GV 153 in the variable area 105, the user sets the GV protection function to disabled through the setup screen. In block 255, the GV control code 150e determines the GV protection function from the setting information recorded in the firmware ROM 100. The GV control code 150e shifts to block 256 when the GV protection function is set to enable, and shifts to block 261 when the GV control code 150e is disabled.

ブロック255からブロック261に移行するときは、保護対象GV153と非保護対象GV155のいずれかがアクセスの対象になっている。ブロック256でGV制御コード150eは、制御リスト161を参照して、コーラーがアクセスするGVが保護対象GV153と判断したときはブロック257に移行し、非保護対象GV155と判断したときはブロック261に移行する。ブロック257でGV制御コード150eは、新バリアブル・サービス150fにコーラーから要求されたGVの識別子を渡す。   When moving from the block 255 to the block 261, either the protection target GV153 or the non-protection target GV155 is an access target. In block 256, the GV control code 150e refers to the control list 161. When the GV accessed by the caller is determined to be the protection target GV153, the process proceeds to block 257. When the GV control code 150e is determined to be the non-protection target GV155, the process proceeds to block 261. To do. In block 257, the GV control code 150e passes the identifier of the GV requested by the caller to the new variable service 150f.

ブロック259で新バリアブル・サービス150fは、SMRAM領域15aにコピーされた保護対象GV153にアクセスしてコーラーに識別子を返す。ブロック261でGV制御コード150eは、オリジナル・バリアブル・サービス150bにコーラーから要求されたGVの識別子を渡す。ブロック263でオリジナル・バリアブル・サービス150bは、変数領域105の非保護対象GV155にアクセスしてコーラーに戻り値を返す。   In block 259, the new variable service 150f accesses the protected GV 153 copied to the SMRAM area 15a and returns an identifier to the caller. In block 261, the GV control code 150e passes the identifier of the GV requested by the caller to the original variable service 150b. In block 263, the original variable service 150 b accesses the unprotected GV 155 in the variable area 105 and returns a return value to the caller.

図6の手順では、GVの保護条件が成立したときは、SMRAM領域15aにコピーされた保護対象GV153はOS167によって改変されるが、変数領域105の保護対象GV153は改変されない。OS167はアクセス先をSMRAM領域15aに指定する必要はなく、オリジナル・バリアブル・サービス150bにアクセスするのと同じ手順で保護対象GV153を改変しさらに改変した保護対象GV153を読み取って動作することができる。   In the procedure of FIG. 6, when the GV protection condition is satisfied, the protection target GV153 copied to the SMRAM area 15a is modified by the OS 167, but the protection target GV153 of the variable area 105 is not modified. The OS 167 does not need to specify the access destination in the SMRAM area 15a, and can operate by reading the modified protection target GV153 by modifying the protection target GV153 in the same procedure as accessing the original variable service 150b.

OS167は、保護対象GV153を改変しないと、インストールができない場合がある。たとえば、変数領域105の保護対象GV153にPXEブートを第1順位として設定した状態でOS167をインストールするときに、OS167は自らをブートの第1順位に設定しないとインストールが失敗することがある。図6の手順によれば、OS167はSMRAM領域15a上でブートの順位を設定してインストールを成功させることができる。しかし変数領域105の保護対象GV153は改変されていないため、UEFIファームウェア105はその後PXEブートをすることができる。   The OS 167 may not be installed unless the protection target GV 153 is modified. For example, when installing the OS 167 in a state where the PXE boot is set as the first order in the protection target GV 153 in the variable area 105, the installation may fail unless the OS 167 sets itself as the first order of boot. According to the procedure of FIG. 6, the OS 167 can set the boot order on the SMRAM area 15a to make the installation successful. However, since the protection target GV 153 in the variable area 105 is not modified, the UEFI firmware 105 can subsequently perform PXE boot.

OS167は変数領域105に記憶された非保護対象GV155を改変することができるが、非保護対象GV155の改変はシステムの動作に障害をもたらすことはない。図6の手順では、保護対象GV153をSMRAM領域15aにコピーする時間が必要になるが、SMRAM領域15aへのコピーは変数領域105をデフォルトGV151で書き換えるよりも短い時間で終了できるためブート時間の遅延問題は生じない。   The OS 167 can modify the non-protection target GV155 stored in the variable area 105, but the modification of the non-protection target GV155 does not cause a failure in the operation of the system. In the procedure of FIG. 6, it takes time to copy the protection target GV153 to the SMRAM area 15a. However, copying to the SMRAM area 15a can be completed in a shorter time than rewriting the variable area 105 with the default GV151. There is no problem.

図4のブロック219でパワー・オフ状態に遷移すると、SMRAM領域15aの保護対象GV153は消去される。OS167は、保護対象GV153を改変したつもりでも変数領域105の保護対象GV153は改変されなかったことになる。しかし、OS167が変数領域105の保護対象GV153を改変したとしても、次回のプリブートでユーザがセット・アップ画面を通じて当該保護対象GV153を改変するかもしれない。   When a transition to the power-off state is made at block 219 in FIG. 4, the protection target GV153 in the SMRAM area 15a is erased. Even though the OS 167 intends to modify the protection target GV153, the protection target GV153 in the variable area 105 has not been modified. However, even if the OS 167 modifies the protection target GV153 in the variable area 105, the user may modify the protection target GV153 through the setup screen at the next preboot.

OS167は通常、変数領域105に格納された保護対象GV153を前回のブートで書き換えていたとしても、確実にみずからの環境設定をするために今回のブートでも保護対象GV153を改変する処理をする。したがって、OS167はブートごとに同じ改変の手順を繰り返すためSMRAM領域15aの保護対象GV153が消去されても次回のブートで追加的な処理が発生することはない。   Even if the OS 167 normally rewrites the protection target GV 153 stored in the variable area 105 in the previous boot, the OS 167 performs processing to modify the protection target GV 153 even in the current boot in order to surely set the environment. Accordingly, since the OS 167 repeats the same modification procedure every boot, even if the protection target GV 153 in the SMRAM area 15a is erased, no additional processing occurs at the next boot.

図4〜図6の手順では、OS167による変数領域105の保護対象GV153の改変を禁止し、非保護対象GV155の改変を許可した。ここでOS167による変数領域105の非保護対象GV155の改変を禁止することも考えられる。しかし、非保護対象GV155の改変は、UEFIファームウェア150のブートルーチンに支障がなく、むしろ、OS167が意図する動作環境を維持したほうが望ましいため、本実施の形態では、OS167による非保護対象GVの改変を許可している。   4 to 6, modification of the protection target GV 153 of the variable area 105 by the OS 167 is prohibited, and modification of the non-protection target GV 155 is permitted. Here, it may be considered that the OS 167 prohibits modification of the unprotected GV 155 in the variable area 105. However, since the modification of the unprotected GV 155 does not interfere with the boot routine of the UEFI firmware 150 and rather it is desirable to maintain the operating environment intended by the OS 167, in this embodiment, the modification of the unprotected GV by the OS 167 is performed. Is allowed.

また、保護対象GV153と非保護対象GV155を一旦SMRAM領域15aにコピーして、いずれに対する改変もSMRAM領域15aで行い、パワー・オフ状態に遷移する際に、改変された非保護対象GV155だけを変数領域105に書き込むようにすることも考えられる。このとき、突然電源が遮断してSMRAM領域15aのデータが消失したときに、改変した非保護対象GV155が消失するが本実施の形態ではそのような事態が生ずることはない。   In addition, once the protection target GV153 and the non-protection target GV155 are copied to the SMRAM area 15a, the modification is performed in the SMRAM area 15a, and only the modified non-protection target GV155 is changed in the power-off state. It is also conceivable to write in the area 105. At this time, when the power supply is suddenly shut down and the data in the SMRAM area 15a is lost, the modified unprotected object GV155 is lost. However, in this embodiment, such a situation does not occur.

図4〜図6に示した手順は本発明を説明するための例示であり、すべてが本発明の必須の手順ではない。本発明の必須の手順は特許請求の範囲に記載するとおりである。また、各ブロックの順番も、図4〜図6に示した順番に限定するものではない。たとえば、図6のブロック253〜256の手順は任意の順番にしてもよい。本発明は、図1に示したハードウェアと図2、図3に示したソフトウェアの協働により構成するハードウェア要素で実現したシステムとして捉えることもできる。   The procedures shown in FIGS. 4 to 6 are exemplifications for explaining the present invention, and all are not essential procedures of the present invention. The essential steps of the invention are as set out in the claims. Further, the order of the blocks is not limited to the order shown in FIGS. For example, the procedures in blocks 253 to 256 in FIG. 6 may be performed in any order. The present invention can also be understood as a system realized by hardware elements configured by the cooperation of the hardware shown in FIG. 1 and the software shown in FIGS.

これまで本発明について図面に示した特定の実施の形態をもって説明してきたが、本発明は図面に示した実施の形態に限定されるものではなく、本発明の効果を奏する限り、これまで知られたいかなる構成であっても採用することができることはいうまでもないことである。   Although the present invention has been described with the specific embodiments shown in the drawings, the present invention is not limited to the embodiments shown in the drawings, and is known so far as long as the effects of the present invention are achieved. It goes without saying that any configuration can be adopted.

10 PC
15 システム・メモリ
15a SMRAM領域
100 ファームウェアROM
101 コード領域
103、105、107、109 変数領域
150 UEFIファームウェア
150b オリジナル・バリアブル・サービス
150f 新バリアブル・サービス
153 保護対象GV
155 非保護対象GV
10 PC
15 System memory 15a SMRAM area 100 Firmware ROM
101 Code area 103, 105, 107, 109 Variable area 150 UEFI firmware 150b Original variable service 150f New variable service 153 Protection target GV
155 Unprotected GV

Claims (17)

オペレーティング・システムが改変することが可能な変数を格納した不揮発性メモリを実装するコンピュータに、
前記変数を参照してプリブートを実行する機能と、
前記変数を保護対象変数と非保護対象変数のいずれかとして認識する機能と、
前記保護対象変数を代替メモリにコピーする機能と、
前記変数にアクセスするためのリクエストがあったときに、該リクエストが前記プリブートの終了前に発生したことの認識に応じて前記リクエストのアクセス先を前記不揮発性メモリと判断する機能と
を実現させるためのシステム・ファームウェア。
A computer that implements non-volatile memory that stores variables that the operating system can modify,
A function of performing a pre-boot with reference to the variable;
A function of recognizing the variable as either a protected variable or a non-protected variable;
A function of copying the protected variable to an alternative memory;
In order to realize a function of determining that the access destination of the request is the non-volatile memory when there is a request for accessing the variable, in accordance with the recognition that the request has occurred before the end of the preboot. System firmware.
前記保護対象変数は前記システム・ファームウェアがブートルーチンを実行するために前記プリブートで参照する変数である請求項1に記載のシステム・ファームウェア。   The system firmware according to claim 1, wherein the protection target variable is a variable that the system firmware refers to in the preboot in order to execute a boot routine. 前記保護対象変数は前記オペレーティング・システムがロードするブート・イメージの格納場所を指定する変数である請求項1に記載のシステム・ファームウェア。   The system firmware according to claim 1, wherein the protection target variable is a variable that specifies a storage location of a boot image loaded by the operating system. 前記リクエストが前記変数の書き込みである請求項1に記載のシステム・ファームウェア。   The system firmware of claim 1, wherein the request is a write of the variable. 前記認識する機能が、前記保護対象変数の識別子を登録したリストを参照する請求項1に記載のシステム・ファームウェア。   The system firmware according to claim 1, wherein the recognition function refers to a list in which identifiers of the protection target variables are registered. 前記代替メモリが、揮発性のメモリである請求項1に記載のシステム・ファームウェア。   The system firmware of claim 1, wherein the alternative memory is a volatile memory. 前記コピーする機能を、前記不揮発性メモリがライト・ロックされるまでの間に実行する請求項1に記載のシステム・ファームウェア。   The system firmware according to claim 1, wherein the copying function is executed before the nonvolatile memory is write-locked. オペレーティング・システムが改変することが可能な変数を格納した不揮発性メモリを実装するコンピュータに、
前記変数を参照してプリブートを実行する機能と、
前記変数を保護対象変数と非保護対象変数のいずれかとして認識する機能と、
前記保護対象変数を代替メモリにコピーする機能と、
前記変数にアクセスするためのリクエストがあったときに、前記システム・ファームウェアのセット・アップ画面を通じて前記変数の保護がディスエーブルに設定されていることの認識に応じて前記リクエストのアクセス先を前記不揮発性メモリと判断する機能と
を実現させるためのシステム・ファームウェア。
A computer that implements non-volatile memory that stores variables that the operating system can modify,
A function of performing a pre-boot with reference to the variable;
A function of recognizing the variable as either a protected variable or a non-protected variable;
A function of copying the protected variable to an alternative memory;
When there is a request to access the variable, the access destination of the request is set to the non-volatile in accordance with the recognition that the protection of the variable is disabled through the setup screen of the system firmware. System firmware for realizing the function of determining the volatile memory .
オペレーティング・システムが改変することが可能な変数を格納した不揮発性メモリを実装するコンピュータに、
前記変数を参照してプリブートを実行する機能と、
前記変数を保護対象変数と非保護対象変数のいずれかとして認識する機能と、
前記保護対象変数を代替メモリにコピーする機能と、
前記変数にアクセスするためのリクエストがあったときに、該リクエストの対象が前記非保護対象変数であることの認識に応じて前記リクエストのアクセス先を前記不揮発性メモリと判断する機能と
を実現させるためのシステム・ファームウェア。
A computer that implements non-volatile memory that stores variables that the operating system can modify,
A function of performing a pre-boot with reference to the variable;
A function of recognizing the variable as either a protected variable or a non-protected variable;
A function of copying the protected variable to an alternative memory;
When there is a request for accessing the variable, a function for determining that the access destination of the request is the non-volatile memory according to recognition that the target of the request is the non-protected variable System firmware for.
オペレーティング・システムが改変することが可能な変数を格納した不揮発性メモリを実装するコンピュータに、
前記変数を参照してプリブートを実行する機能と、
前記変数を保護対象変数と非保護対象変数のいずれかとして認識する機能と、
前記保護対象変数を代替メモリにコピーする機能と、
前記変数にアクセスするためのリクエストがあったときに、該リクエストが前記プリブートの終了後に発生し、かつ、前記リクエストの対象が前記保護対象変数であるとの認識に応じて前記リクエストのアクセス先を前記代替メモリと判断する機能と
を実現させるためのシステム・ファームウェア。
A computer that implements non-volatile memory that stores variables that the operating system can modify,
A function of performing a pre-boot with reference to the variable;
A function of recognizing the variable as either a protected variable or a non-protected variable;
A function of copying the protected variable to an alternative memory;
When there is a request to access the variable, the request is generated after completion of the preboot, and the access destination of the request is determined according to recognition that the target of the request is the protection target variable. System firmware for realizing the function of determining the replacement memory .
コンピュータが不揮発性メモリに格納した変数を保護する方法であって、
前記変数を保護対象変数と非保護対象変数に区分するステップと、
前記変数を参照してブートを実行するステップと、
前記保護対象変数を代替メモリにコピーするステップと、
オペレーティング・システムから前記変数を改変するリクエストを受け取るステップと、
前記リクエストの対象が前記保護対象変数のときに前記代替メモリにコピーした保護対象変数を改変するステップと
を有する方法。
A method for protecting variables stored in non-volatile memory by a computer,
Partitioning the variables into protected variables and unprotected variables;
Performing a boot with reference to the variable;
Copying the protected variable to an alternative memory;
Receiving a request to modify the variable from an operating system;
Modifying the protected variable copied to the alternative memory when the target of the request is the protected variable.
前記リクエストの対象が前記非保護対象変数のときに前記不揮発性メモリに格納した前記非保護対象変数を改変するステップを有する請求項11に記載の方法。 The method according to claim 11 , further comprising modifying the non-protection target variable stored in the nonvolatile memory when the target of the request is the non-protection target variable. 次回のブートの前に前記代替メモリが記憶する改変された前記保護対象変数を消去するステップを有する請求項11に記載の方法。 12. The method of claim 11 , comprising erasing the modified protected variable stored in the alternate memory prior to a next boot. システム・ファームウェアが参照する変数を格納する不揮発性メモリと、
前記変数を保護対象変数と非保護対象変数に区別することが可能な制御リストと、
プリブートが終了する前に前記保護対象変数を代替メモリに退避する退避部と、
前記変数にアクセスするためのリクエストがあったときに、該リクエストが前記プリブートの終了前に発生したことの認識に応じて前記リクエストのアクセス先を前記不揮発性メモリに設定する変数保護部と
を有するコンピュータ。
Non-volatile memory for storing variables referenced by system firmware;
A control list capable of distinguishing the variables into protected variables and unprotected variables;
A saving unit that saves the protection target variable in an alternative memory before pre-booting is completed;
A variable protection unit that sets the access destination of the request in the nonvolatile memory in response to recognition that the request has occurred before the end of the preboot when there is a request to access the variable Computer.
システム・ファームウェアが参照する変数を格納する不揮発性メモリと、
前記変数を保護対象変数と非保護対象変数に区別することが可能な制御リストと、
プリブートが終了する前に前記保護対象変数を代替メモリに退避する退避部と、
前記変数にアクセスするためのリクエストがあったときに、前記システム・ファームウェアのセット・アップ画面を通じて前記変数の保護がディスエーブルに設定されていることの認識に応じて前記リクエストのアクセス先を前記不揮発性メモリに設定する変数保護部と
を有するコンピュータ。
Non-volatile memory for storing variables referenced by system firmware;
A control list capable of distinguishing the variables into protected variables and unprotected variables;
A saving unit that saves the protection target variable in an alternative memory before pre-booting is completed;
When there is a request to access the variable, the access destination of the request is set to the non-volatile in accordance with the recognition that the protection of the variable is disabled through the setup screen of the system firmware. And a variable protection unit to be set in the memory .
システム・ファームウェアが参照する変数を格納する不揮発性メモリと、
前記変数を保護対象変数と非保護対象変数に区別することが可能な制御リストと、
プリブートが終了する前に前記保護対象変数を代替メモリに退避する退避部と、
前記変数にアクセスするためのリクエストがあったときに、該リクエストの対象が前記非保護対象変数であることの認識に応じて前記リクエストのアクセス先を前記不揮発性メモリに設定する変数保護部と
を有するコンピュータ。
Non-volatile memory for storing variables referenced by system firmware;
A control list capable of distinguishing the variables into protected variables and unprotected variables;
A saving unit that saves the protection target variable in an alternative memory before pre-booting is completed;
When there is a request for accessing the variable, a variable protection unit that sets the access destination of the request in the nonvolatile memory according to recognition that the target of the request is the non-protection target variable. Computer with.
システム・ファームウェアが参照する変数を格納する不揮発性メモリと、
前記変数を保護対象変数と非保護対象変数に区別することが可能な制御リストと、
プリブートが終了する前に前記保護対象変数を代替メモリに退避する退避部と、
前記変数にアクセスするためのリクエストがあったときに、該リクエストが前記プリブートの終了後に発生し、かつ、前記リクエストの対象が前記保護対象変数であるとの認識に応じて前記リクエストのアクセス先を前記代替メモリに設定する変数保護部と
を有するコンピュータ。
Non-volatile memory for storing variables referenced by system firmware;
A control list capable of distinguishing the variables into protected variables and unprotected variables;
A saving unit that saves the protection target variable in an alternative memory before pre-booting is completed;
When there is a request to access the variable, the request is generated after completion of the preboot, and the access destination of the request is determined according to recognition that the target of the request is the protection target variable. A computer having a variable protection unit set in the alternative memory ;
JP2016183556A 2016-09-21 2016-09-21 Method, system firmware, and computer for protecting variables stored in non-volatile memory Active JP6204555B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016183556A JP6204555B1 (en) 2016-09-21 2016-09-21 Method, system firmware, and computer for protecting variables stored in non-volatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016183556A JP6204555B1 (en) 2016-09-21 2016-09-21 Method, system firmware, and computer for protecting variables stored in non-volatile memory

Publications (2)

Publication Number Publication Date
JP6204555B1 true JP6204555B1 (en) 2017-09-27
JP2018049402A JP2018049402A (en) 2018-03-29

Family

ID=59969398

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016183556A Active JP6204555B1 (en) 2016-09-21 2016-09-21 Method, system firmware, and computer for protecting variables stored in non-volatile memory

Country Status (1)

Country Link
JP (1) JP6204555B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015153198A (en) * 2014-02-15 2015-08-24 レノボ・シンガポール・プライベート・リミテッド Method for preventing malfunction of computer, computer program and computer
JP2015222474A (en) * 2014-05-22 2015-12-10 レノボ・シンガポール・プライベート・リミテッド Method, computer program and computer for repairing variable set

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015153198A (en) * 2014-02-15 2015-08-24 レノボ・シンガポール・プライベート・リミテッド Method for preventing malfunction of computer, computer program and computer
JP2015222474A (en) * 2014-05-22 2015-12-10 レノボ・シンガポール・プライベート・リミテッド Method, computer program and computer for repairing variable set

Also Published As

Publication number Publication date
JP2018049402A (en) 2018-03-29

Similar Documents

Publication Publication Date Title
JP5889933B2 (en) Method for preventing malfunction of computer, computer program, and computer
CN103718165B (en) BIOS flash memory attack protection and notice
JP5512610B2 (en) Method, system, and machine-readable storage medium for permitting or blocking access to memory from non-firmware agent
JP6054908B2 (en) Method for repairing variable sets, computer program and computer
US7107460B2 (en) Method and system for securing enablement access to a data security device
US9880908B2 (en) Recovering from compromised system boot code
US5944821A (en) Secure software registration and integrity assessment in a computer system
US9158941B2 (en) Managing access to content in a data processing apparatus
JP5335634B2 (en) Computer that protects the privilege level of system administration mode
JP5307196B2 (en) Providing a system integrated with silicon code
Regenscheid Platform firmware resiliency guidelines
JP5346608B2 (en) Information processing apparatus and file verification system
US10430589B2 (en) Dynamic firmware module loader in a trusted execution environment container
US20040003265A1 (en) Secure method for BIOS flash data update
US10776493B2 (en) Secure management and execution of computing code including firmware
US11188321B2 (en) Processing device and software execution control method
US10698696B2 (en) Chipset fuse programming system
US20090300307A1 (en) Protection and security provisioning using on-the-fly virtualization
KR101013419B1 (en) Guarding apparatus and method for system
JP6204555B1 (en) Method, system firmware, and computer for protecting variables stored in non-volatile memory
EP3440585B1 (en) System and method for establishing a securely updatable core root of trust for measurement
JP6564549B1 (en) Validity authentication activation management system
US20230094673A1 (en) Information handling systems and related methods to prevent tampering and verify the integrity of non-volatile data stored within non-volatile memory
EP4367593A1 (en) Method and apparatus for securely backing up and restoring a computer system

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170627

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170807

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170822

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170831

R150 Certificate of patent or registration of utility model

Ref document number: 6204555

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250