TWI791138B - Security monitoring of serial peripheral interface flash - Google Patents
Security monitoring of serial peripheral interface flash Download PDFInfo
- Publication number
- TWI791138B TWI791138B TW109103275A TW109103275A TWI791138B TW I791138 B TWI791138 B TW I791138B TW 109103275 A TW109103275 A TW 109103275A TW 109103275 A TW109103275 A TW 109103275A TW I791138 B TWI791138 B TW I791138B
- Authority
- TW
- Taiwan
- Prior art keywords
- bus
- data
- memory device
- processor
- data processing
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/82—Protecting input, output or interconnection devices
- G06F21/85—Protecting input, output or interconnection devices interconnection devices, e.g. bus-connected or in-line devices
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Systems (AREA)
- Storage Device Security (AREA)
- Debugging And Monitoring (AREA)
- Burglar Alarm Systems (AREA)
- Forging (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
Description
相關申請之交互參照 Cross Reference to Related Applications
此申請書是主張2019年9月12日所提交之美國專利申請號16/568,299,其為2018年4月18日所提交之美國專利申請號15/955,715的部分繼續申請案,其為於2016年3月21日所提交之美國專利申請號15/075,219的部分繼續申請案,其主張於2015年6月8日所提交之美國臨時申請案號第62/172,298之優先權。 This application is asserting U.S. Patent Application No. 16/568,299, filed September 12, 2019, which is a continuation-in-part of U.S. Patent Application No. 15/955,715, filed April 18, 2018, filed in 2016 A continuation-in-part of U.S. Patent Application No. 15/075,219, filed March 21, 2015, which claims priority to U.S. Provisional Application No. 62/172,298, filed June 8, 2015.
本發明係有關於一種電子系統安全技術,特別是有關於用於保護對周邊裝置的安全存取的方法和系統。 The present invention relates to an electronic system security technology, in particular to a method and system for protecting safe access to peripheral devices.
電子系統使用各種匯流排介面以在主機裝置與周邊裝置間通訊。例如,匯流排介面可包含積體電路(Inter-Integrated-Circuit,I2C)匯流排及序列周邊介面(serial peripheral interface,SPI)匯流排。I2C匯流排例如在”I2C匯流排規範和用戶手冊”UM10204,NXP半導體,修訂版6,2014年4月4日,其通過引用併入本文。 Electronic systems use various bus interfaces to communicate between host devices and peripheral devices. For example, the bus interface may include an Inter-Integrated-Circuit (I 2 C) bus and a serial peripheral interface (SPI) bus. The I 2 C bus is described for example in "I 2 C Bus Specification and User Manual" UM10204, NXP Semiconductors, Rev. 6, April 4, 2014, which is incorporated herein by reference.
本發明之目的在於提出一種安全裝置,其包含一介面以及一處理器。此介面連接一匯流排,該匯流排係服務一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置。處理器係連接至該匯流排以及該一個或多個周邊裝置,該處理器用以保存區分與該記憶體裝置進行之已經授權以及未經授權之數據處置之定義,以辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施。 The purpose of the present invention is to provide a security device, which includes an interface and a processor. The interface is connected to a bus that serves one or more peripheral devices, at least one of which is a memory device. A processor is coupled to the bus and the one or more peripheral devices, the processor maintains definitions for distinguishing authorized and unauthorized data handling from the memory device to identify a The bus master attempts to access the data transaction of the memory device, and responds by initiating a response measure when the data transaction is identified as unauthorized according to the definition.
根據本發明之一實施例,匯流排包含一個或多個專用訊號以及一個或多個共用訊號,每一專用訊號係分別專用於其中一周邊裝置,該一個或多個共用訊號係在該匯流排所服務之該周邊裝置之中共用,該處理器係藉由阻斷與該記憶體裝置相關的該專用訊號,以阻斷在該匯流排上的該數據處置。根據本發明之一實施例,與該記憶體裝置相關的該專用訊號係為該記憶體裝置之一晶片選擇訊號,以及該處理器藉由將該晶片選擇訊號選擇該記憶體裝置之一持續時間延伸超出(beyond)該數據處置之實際結束時間(an actual end of the transaction),以避免該記憶體裝置執行該數據處置,藉以阻斷該數據處置。 According to an embodiment of the present invention, the bus bar includes one or more dedicated signals and one or more shared signals, each dedicated signal is dedicated to one of the peripheral devices respectively, and the one or more shared signals are connected on the bus bar. Common among the peripheral devices being served, the processor blocks the data processing on the bus by blocking the dedicated signal associated with the memory device. According to an embodiment of the present invention, the dedicated signal associated with the memory device is a chip select signal of the memory device, and the processor selects a duration of the memory device by the chip select signal Extending beyond an actual end of the transaction to prevent the memory device from performing the transaction, thereby blocking the transaction.
根據本發明之一實施例,此定義係載明對該記憶體裝置進行的已經授權數據處置,以及其中回應當辨識出該數據處置未載明在該定義,則該處理器係啟動該回應措施。 According to an embodiment of the invention, the definition specifies authorized data disposals of the memory device, and wherein the response should identify that the data disposal is not specified in the definition, then the processor initiates the response .
根據本發明之一實施例,處理器用以定義一個或多個數據處置群組,以保持一個或多個分別對應該一個或多個數據處置群組之計數器,以監控該匯流排,以及回應當辨識出在該匯流排上該匯流排主裝置以及該記憶體裝置之間的一既定數據處置時,增加該既定數據處置所屬之群組所對應的計數器之計數。 According to an embodiment of the present invention, the processor is used to define one or more data processing groups, to maintain one or more counters respectively corresponding to the one or more data processing groups, to monitor the bus, and respond to the When a predetermined data transaction between the bus master device and the memory device on the bus is identified, the counter corresponding to the group to which the predetermined data transaction belongs is increased.
根據本發明之一實施例,處理器係辨識在該匯流排上一個或多個指示該記憶體裝置進入一既定運作模式之模式進入數據處置以及一個或多個指示該記憶體裝置離開該既定運作模式之模式離開數據處置,以辨識是否該記憶體裝置操作在該既定運作模式。根據本發明之一實施例,當該記憶體裝置操作在該既定運作模式時,該處理器對一個或多個數據處置給予一第一解釋(interpretation),以及當該記憶體裝置不是操作在該既定運作模式時,該處理器對該一個或多個數據處置給予一不同的第二解釋。根據本發明之一實施例,當該記憶體裝置操作在該既定運作模式時,該處理器係中止啟動回應措施。 According to an embodiment of the invention, the processor recognizes one or more mode-enter data transactions on the bus that instruct the memory device to enter a predetermined mode of operation and one or more signals on the bus that instruct the memory device to leave the predetermined mode of operation. The mode-by-mode data is handled to identify whether the memory device is operating in the predetermined mode of operation. According to an embodiment of the present invention, the processor gives a first interpretation to one or more data transactions when the memory device is operating in the predetermined mode of operation, and when the memory device is not operating in the In a given mode of operation, the processor gives a second, different interpretation of the one or more data manipulations. According to an embodiment of the present invention, when the memory device operates in the predetermined operation mode, the processor stops initiating the response measures.
根據本發明之一實施例,處理器係從該匯流排主裝置接收該數據處置,以驗證是否該數據處置已經授權,以及當決定該數據處置已經授權,該處理器在該記憶體裝置中執行該數據處置。根據本發明之一實施例,處理器係接收該數據處置作為多個數據處置之數列之一部分,該處理器驗證是否該數據處置已經授權,作為對該多個數據處置之數列進行共同驗證之一部分。 According to an embodiment of the present invention, the processor receives the data disposal from the bus master to verify whether the data disposal has been authorized, and upon determining that the data disposal has been authorized, the processor executes in the memory device The data processing. According to an embodiment of the invention, the processor receives the data disposal as part of a sequence of data disposals, the processor verifies whether the data disposal has been authorized as part of a common verification of the sequence of data disposals .
根據本發明之一實施例,數據處置係為一由該匯流排主裝置寫入一數據至該記憶體裝置的寫入數據處置,其中該處理器係對數據執行一加密操作,並於該加密操作成功時判斷該數據處置已經授權。 According to an embodiment of the present invention, the data processing is a write data processing of writing a data to the memory device by the bus master device, wherein the processor performs an encryption operation on the data, and When the operation is successful, it is determined that the data processing has been authorized.
本發明之再一目的在於提出一種安全裝置,其包含一介面以及一處理器。此介面用以連接一匯流排,該匯流排係服務一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置。處理器係連接至該匯流排以及該一個或多個周邊裝置,該處理器用以辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應對該數據處置之辨識,啟動一回應措施,代替該記憶體裝置回應該匯流排主裝置。 Another object of the present invention is to provide a security device, which includes an interface and a processor. The interface is used to connect a bus that serves one or more peripheral devices, at least one of which is a memory device. A processor is connected to the bus and the one or more peripheral devices, the processor is used to identify a data transaction on the bus that a bus master device attempts to access the memory device, and to respond to the data transaction Identifying and initiating a response action instead of the memory device responding to the bus master device.
根據本發明之一實施例,根據對該數據處置之辨識,該處理器阻斷在該匯流排上的該數據處置、或是發出一警訊。 According to an embodiment of the invention, upon recognition of the data transaction, the processor blocks the data transaction on the bus, or issues an alert.
根據本發明之一實施例,數據處置係為對記憶體裝置之能力之查詢,處理器係以一修改過的能力回應該匯流排主裝置,而修改過的能力係與該記憶體裝置之實際能力不同。根據本發明之一實施例,此查詢包含一串列式快閃記憶體可發現參數讀取指令,以及其中該處理器係以修改過的串列式快閃記憶體可發現參數回應該串列式快閃記憶體可發現參數讀取指令。 According to one embodiment of the present invention, data processing is a query of the capabilities of the memory device, and the processor responds to the bus master with a modified capability that is consistent with the actual capabilities of the memory device. Different abilities. According to an embodiment of the invention, the query includes a Serial Flash discoverable parameter read command, and wherein the processor responds to the serial Flash discoverable parameter with a modified Type flash memory can be found parameter read instruction.
根據本發明之一實施例,在來自該匯流排主裝置之查詢之前,該處理器係從該記憶體裝置取得該記憶體裝置之該實際能力,且該處理器修改該實際能力以產生該修改過的能力以回應該匯流排主裝置。根據本發明之一實施例,處理器係在該修改過的能力中增加一該記憶體裝置不支援的能力。根據本發明之一實施例,處理器係省略一該記憶體裝置支援的能力,以產生該修改過的能力。 According to an embodiment of the invention, prior to the query from the bus master, the processor obtains the actual capabilities of the memory device from the memory device, and the processor modifies the actual capabilities to generate the modification through the ability to respond to the bus master. According to an embodiment of the present invention, the processor adds a capability not supported by the memory device to the modified capability. According to one embodiment of the invention, the processor omits a capability supported by the memory device to generate the modified capability.
本發明之再一目的在於提出一種安全方法,其包含下列步驟:使用一安全裝置在一匯流排上進行通訊,該安全裝置係連接至該匯流排以及一個或多個周邊裝置,至少其中之一該周邊裝置係為一記憶體裝置;保存一區分與該記憶體裝置進行之已經授權以及未經授權之數據處置之定義;以及使用該安全裝置辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施。 Yet another object of the present invention is to propose a security method comprising the steps of: communicating on a bus using a security device connected to the bus and one or more peripheral devices, at least one of which The peripheral device is a memory device; maintains a definition that distinguishes authorized and unauthorized data handling from the memory device; and uses the security device to identify a bus master attempting to store data on the bus. accessing the data processing of the memory device, and responding to initiating a response measure should the data processing be identified as unauthorized according to the definition.
本發明之再一目的在於提出一種安全方法,其包含下列步驟:使用一安全裝置在一匯流排上進行通訊,該安全裝置係連接至該匯流排以及一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置;使用該安全裝置辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置, 以及回應對該數據處置之辨識,啟動一回應措施,代替記憶體裝置回應匯流排主裝置。 Yet another object of the present invention is to propose a security method comprising the steps of: using a security device to communicate on a bus, the security device being connected to the bus and one or more peripheral devices, at least one of which a peripheral device is a memory device; using the security device to identify a bus master device on the bus attempting to access a data transaction of the memory device, And in response to the identification of the data handling, a response measure is initiated to respond to the bus master instead of the memory device.
本發明之再一目的在於提供一種安全裝置,其包含一介面以及一處理器。此介面用於連接一服務至少一周邊裝置的匯流排。此匯流排包含(i)至少一專用訊號,其分別專用於其中一周邊裝置;(ii)至少一共用訊號,其由匯流排所服務之周邊裝置共用。除了周邊裝置,處理器係連接至匯流排作為一額外裝置,藉由阻斷一既定周邊裝置相關的專用訊號,以阻斷在匯流排上匯流排主裝置(bus-master device)嘗試存取此既定周邊裝置之數據處置。 Another object of the present invention is to provide a security device, which includes an interface and a processor. The interface is used to connect a bus serving at least one peripheral device. The bus includes (i) at least one dedicated signal dedicated to one of the peripheral devices respectively; (ii) at least one common signal shared by the peripheral devices served by the bus. In addition to peripheral devices, the processor is connected to the bus as an additional device, by blocking the dedicated signals associated with a given peripheral device, to block the bus-master device (bus-master device) on the bus from trying to access this Data processing of predetermined peripheral devices.
在一些實施例中,當阻斷數據處置時,處理器保持共用訊號在匯流排上連續傳送。在一實施例中,此介面包含(i)一輸入端,用以接收來自匯流排主裝置的專用訊號;(ii)一輸出端,用以傳送專用訊號至既定周邊裝置,而處理器係藉由阻止輸入端接收之專用訊號從輸出端輸出,以阻斷數據處置。在一些實施例中,當阻斷專用訊號時,處理器係代替此既定周邊裝置回應匯流排主裝置。在一示例性實施例,專用訊號包含一晶片選擇(CS)訊號。 In some embodiments, the processor keeps common signals continuously transmitted on the bus while blocking data processing. In one embodiment, the interface includes (i) an input for receiving dedicated signals from the bus master; (ii) an output for sending dedicated signals to a given peripheral, and the processor is A dedicated signal received by the blocking input is output from the output to block data processing. In some embodiments, when a dedicated signal is blocked, the processor responds to the bus master instead of the intended peripheral. In an exemplary embodiment, the dedicated signal includes a chip select (CS) signal.
在本發明揭露之實施例中,處理器係監控匯流排,以偵測待阻斷之數據處置。在其他實施例中,處理器係透過一匯流排外部之輔助介面與匯流排主裝置通訊,以偵測待阻斷之數據處置。 In an embodiment of the present disclosure, the processor monitors the bus to detect pending data transactions. In other embodiments, the processor communicates with the bus master through an auxiliary interface external to the bus to detect pending data transactions.
在一實施例中,處理器係無限時地(indefinitely)阻斷專用訊號,直到處理器被重置。在另一實施例中,在偵測到數據處置之後,處理器係在有限時間週期內阻斷專用訊號。在一實施例中,藉由阻斷數據處置,處理器可造成至少一周邊裝置捨棄一數據處置。在一些實施例中,在阻斷數據處置之後,處理器係回復正常操作。 In one embodiment, the processor blocks dedicated signals indefinitely until the processor is reset. In another embodiment, the processor blocks dedicated signals for a finite period of time after detecting data handling. In one embodiment, the processor can cause at least one peripheral device to discard a data transaction by blocking the data transaction. In some embodiments, after blocking data processing, the processor resumes normal operation.
根據本發明一實施例,本發明再提供一安全裝置,其包含一介面以及一處理器。此介面係連接一服務至少一周邊裝置的匯流排。處理器係分別 連接至匯流排以及周邊裝置,並代替一既定周邊裝置回應匯流排主裝置,藉此阻斷在匯流排上匯流排主裝置嘗試存取此既定周邊裝置之數據處置。 According to an embodiment of the present invention, the present invention further provides a security device, which includes an interface and a processor. The interface is connected to a bus serving at least one peripheral device. processor system Connect to the bus and peripheral devices, and respond to the bus master device instead of a predetermined peripheral device, thereby blocking the data processing of the bus master device trying to access the predetermined peripheral device on the bus.
在一實施例中,此匯流排包含(i)至少一專用訊號,每一專用訊號係專用於其中一周邊裝置;(ii)至少一共用訊號,其由匯流排所服務之周邊裝置所共用。處理器可藉由(i)阻斷既定周邊裝置相關的專用訊號,以及(ii)阻斷專用訊號時回應匯流排主裝置,以阻斷此數據處置。 In one embodiment, the bus includes (i) at least one dedicated signal, each dedicated to one of the peripheral devices; (ii) at least one common signal, shared by the peripheral devices served by the bus. The processor can block this data processing by (i) blocking dedicated signals associated with a given peripheral device, and (ii) responding to the bus master while blocking dedicated signals.
在一些實施例中,既定周邊裝置包含一記憶體裝置,處理器係辨識此數據處置中來自匯流排主裝置對記憶體裝置讀取數據之請求,並以儲存在安全裝置內部之另一數據回應此請求。在一示例性實施例,回應辨識出此匯流排主裝置請求存取記憶體裝置中預先定義之位址區時,處理器阻斷數據處置並以另一數據回應匯流排主裝置。 In some embodiments, the given peripheral device includes a memory device, and the processor recognizes a request from the bus master to read data from the memory device during the data transaction and responds with another data stored inside the secure device this request. In an exemplary embodiment, in response to identifying that the bus master requests access to a predefined address area in the memory device, the processor blocks data processing and responds to the bus master with another data.
在另一實施例中,根據在數據處置期間既定周邊裝置回傳至匯流排主裝置的數據,處理器係辨識匯流排主裝置嘗試存取既定周邊裝置之數據處置。在其他實施例中,處理器根據數據處置使用之一指令碼(command code),以辨識匯流排主裝置嘗試存取既定周邊裝置之數據處置。 In another embodiment, the processor identifies a data transaction in which the bus master attempts to access a given peripheral device based on data sent back from the given peripheral device to the bus master during the data transaction. In other embodiments, the processor uses a command code based on the data transaction to identify a data transaction in which the bus master device attempts to access a given peripheral device.
根據本發明一實施例,本發明提供一種方法,其包含使用一安全裝置通過一匯流排進行通訊,除了至少一周邊裝置連接至匯流排,安全裝置係連接至匯流排作為一額外裝置,其中匯流排包含(i)至少一專用訊號,每一專用訊號係專用於其中一周邊裝置,以及(ii)至少一共用訊號,其由匯流排所服務之周邊裝置所共用。使用安全裝置阻斷一既定周邊裝置相關的專用訊號,以阻斷在匯流排上匯流排主裝置嘗試存取此既定周邊裝置之數據處置。 According to an embodiment of the present invention, the present invention provides a method comprising using a security device to communicate through a bus, in addition to at least one peripheral device connected to the bus, the security device is connected to the bus as an additional device, wherein the bus A row includes (i) at least one dedicated signal, each dedicated to one of the peripheral devices, and (ii) at least one common signal, shared by the peripheral devices served by the bus. A dedicated signal associated with a given peripheral device is blocked using a security device to block data transactions on the bus by a bus master device attempting to access the given peripheral device.
根據本發明一實施例,本發明再提供一種方法,其包含使用一安全裝置通過一匯流排進行通訊,至少一周邊裝置連接至匯流排,而安全裝置係 連接至匯流排。藉由使用安全裝置代替既定周邊裝置回應匯流排主裝置,以阻斷在匯流排上此匯流排主裝置嘗試存取既定周邊裝置之數據處置。 According to an embodiment of the present invention, the present invention further provides a method, which includes using a security device to communicate through a bus, at least one peripheral device is connected to the bus, and the security device is Connect to busbar. By using a security device instead of a given peripheral device to respond to the bus master device, data transactions on the bus that the bus master device attempts to access the given peripheral device are blocked.
在本發明所述之實施例中,提供了一種裝置包含介面跟處理器。介面被設置為透過匯流排通訊,處理器被設置為在匯流排主裝置未通過授權要存取周邊裝置時,強制地並行寫入一個或多個虛擬值至匯流排的至少一條線上以中斷至少一部分數據處置(transaction)。 In an embodiment of the present invention, a device including an interface and a processor is provided. The interface is configured to communicate via the bus, and the processor is configured to force parallel writing of one or more dummy values to at least one line of the bus to interrupt at least Part of data processing (transaction).
在一個實施例中,處理器被設置為強制寫入虛擬值至匯流排上的數據線,以阻斷透過數據線接收或周邊裝置所傳送的數據值。附加地或替代地,處理器被設置為強制寫入虛擬值至匯流排上的時脈線,以中斷數據處置所使用的時脈訊號。進一步附加地或替代地,處理器被設置為強制寫入虛擬值至匯流排上的晶片選擇線,以中斷匯流排主裝置(bus-master device)選擇周邊裝置。 In one embodiment, the processor is configured to force write dummy values to the data lines on the bus to block data values received over the data lines or transmitted by peripheral devices. Additionally or alternatively, the processor is arranged to force writing of a dummy value to a clock line on the bus to interrupt the clock signal used for data processing. Further additionally or alternatively, the processor is configured to force a dummy value to be written to a die select line on the bus to interrupt a bus-master device from selecting a peripheral device.
在一些實施例中,匯流排包含一個具有預設邏輯值的集極開路匯流排(open-collector bus)或汲極開路匯流排(open-drain bus),且處理器被設置為強制寫入與預設邏輯值相反的虛擬值至匯流排上的至少一線路。 In some embodiments, the bus comprises an open-collector bus or an open-drain bus with preset logic values, and the processor is configured to force write and A dummy value with opposite logic value is preset to at least one line on the bus.
在一些實施例中,透過強制寫入虛擬值,處理器可覆寫匯流排主裝置或周邊裝置上被寫入的至少一線路的對應值。在一個舉例的實施例中的,處理器被設置為透過驅動其驅動強度大於匯流排主裝置或周邊裝置的至少一線路,來覆寫(override)匯流排主裝置或周邊裝置上被寫入的至少一線路的對應值。在另一個實施例中,此裝置包含至少一電阻,其被設置於至少一線路上,電阻係設置用以將被寫入至匯流排主裝置或周邊裝置的值減弱(attenuate)到比處理器所寫入之虛擬值還弱。 In some embodiments, by forcing a dummy value to be written, the processor can overwrite a corresponding value written to at least one line on the bus master or peripheral. In an exemplary embodiment, the processor is configured to override the data written on the bus master or peripheral by driving at least one line having a drive strength greater than that of the bus master or peripheral. Corresponding value of at least one line. In another embodiment, the device includes at least one resistor disposed on at least one line, the resistor configured to attenuate a value written to the bus master or peripheral to a value lower than that of the processor. The dummy value written is still weak.
在一些實施例中,處理器被設置為僅透過被用於在匯流排主裝置與周邊裝置之間通訊的匯流排的現有的一線路上強制寫入虛擬值。在一些實施例中,處理器被設置為透過監控匯流排來檢測要阻斷的數據處置。在一個實施 例中,處理器係透過在匯流排主裝置外部的輔助介面上與匯流排主裝置通訊,來檢測要阻斷的數據處置。 In some embodiments, the processor is configured to force the writing of the dummy value only over an existing line of the bus used for communication between the bus master and the peripheral. In some embodiments, the processor is configured to detect data transactions to be blocked by monitoring the bus. in an implementation In one example, the processor detects data transactions to be blocked by communicating with the bus master on an auxiliary interface external to the bus master.
在一個公開的實施例中,處理器係無限時地強制寫入虛擬值直到此裝置被重置。在另一個實施例中,處理器被設置為在偵測到數據處置時,在有限時間內強制寫入虛擬值。在一個實施例中,處理器被設置為在數據處置被中斷後,適度地回復匯流排的正常操作。 In one disclosed embodiment, the processor forces the dummy value to be written indefinitely until the device is reset. In another embodiment, the processor is configured to force a dummy value to be written within a limited time when data disposal is detected. In one embodiment, the processor is configured to gracefully resume normal operation of the bus after data handling has been interrupted.
根據本發明的實施例,還提供了一種包括周邊裝置和安全裝置的系統。周邊裝置可以透過匯流排存取一個或多個匯流排主裝置。此安全裝置被設置為在匯流排主裝置未通過授權要存取周邊裝置時,強制地並行寫入一個或多個虛擬值至匯流排的至少一條線上,以阻斷至少一部分數據處置(transaction)。 According to an embodiment of the present invention, a system including a peripheral device and a security device is also provided. Peripheral devices can access one or more bus master devices through the bus. The security device is configured to forcibly write one or more dummy values in parallel to at least one line of the bus to block at least a part of the data processing (transaction) when the bus master device is not authorized to access the peripheral device .
依據實施例,本發明還提供了一種方法,包含使用耦合到匯流排的安全裝置,決定是否中斷匯流排主裝置未經授權嘗試存取周邊裝置的數據處置,並透過強制地並行寫入一個或多個虛擬值至匯流排的至少一條線上,以阻斷至少一部分數據處置。 According to an embodiment, the present invention also provides a method comprising using a security device coupled to a bus to determine whether to interrupt data handling by a bus master device from unauthorized attempts to access a peripheral device, and by forcibly parallel writing one or A plurality of dummy values are applied to at least one line of the bus to block at least a portion of data processing.
從下面結合附圖對其實施例的詳細描述中,將更全面地理解本發明。 The present invention will be more fully understood from the following detailed description of its embodiments when taken in conjunction with the accompanying drawings.
20、70、90、110、130、132:系統 20, 70, 90, 110, 130, 132: system
24、74:主機裝置 24, 74: host device
28、78:周邊裝置 28, 78: Peripheral devices
32:I2C匯流排 32: I 2 C bus
36:安全裝置 36: Safety device
40:介面 40: interface
44:處理器 44: Processor
48:記憶體 48: Memory
82:SPI匯流排 82:SPI bus
86:安全裝置 86:Safety device
91:從屬介面邏輯電路 91: slave interface logic circuit
92:介面監控邏輯電路 92: Interface monitoring logic circuit
94:處理器 94: Processor
98:內部記憶體 98:Internal memory
100:電阻 100: resistance
134:及閘 134: and gate
50、54、58、62、66、100a、104、108、112、116、120、140、144、148、152、156、160、164、170、174、178、182、186、190、194:步驟 50, 54, 58, 62, 66, 100a, 104, 108, 112, 116, 120, 140, 144, 148, 152, 156, 160, 164, 170, 174, 178, 182, 186, 190, 194: step
第1圖係為本發明實施例中多個裝置通過I2C匯流排進行通訊的安全系統的方塊示意圖。 FIG. 1 is a schematic block diagram of a security system in which multiple devices communicate through an I 2 C bus in an embodiment of the present invention.
第2圖係為本發明實施例透過I2C匯流排保護對周邊裝置的存取的方法的流程圖。 FIG. 2 is a flowchart of a method for protecting access to peripheral devices through an I 2 C bus according to an embodiment of the present invention.
第3-5圖係為本發明的一個替代的實施例中,多個裝置透過SPI匯流排進行通訊的安全系統的方塊示意圖。 3-5 are block diagrams of a security system in which multiple devices communicate via an SPI bus in an alternative embodiment of the present invention.
第6圖係根據本發明之一實施例之一安全裝置之示意方塊圖。 FIG. 6 is a schematic block diagram of a safety device according to an embodiment of the present invention.
第7圖係根據本發明之一實施例之使主機裝置安全開機之方法一示意流程圖。 FIG. 7 is a schematic flowchart of a method for securely booting a host device according to an embodiment of the present invention.
第8圖係根據本發明的另一實施例之安全系統之示意方塊圖,在安全系統中多個裝置係在SPI匯流排上進行通訊。 FIG. 8 is a schematic block diagram of a security system according to another embodiment of the present invention. In the security system, multiple devices communicate on the SPI bus.
第9圖係根據本發明之一實施例之使用數據處置組計數器(transaction-group counter)監控SPI數據處置之方法之示意流程圖。 FIG. 9 is a schematic flowchart of a method for monitoring SPI data processing using a transaction-group counter according to an embodiment of the present invention.
第10圖一根據本發明之一實施例之在主機以及SPI快閃記憶體之間對寫入/抹除數據處置之安全調解(secure mediation)之方法之示意流程圖。 FIG. 10 is a schematic flowchart of a method for secure mediation (secure mediation) between the host and the SPI flash memory for writing/erasing data processing according to an embodiment of the present invention.
上述圖式為示意性且並未按比例縮放。圖式中相對尺寸與比例因精確與/或方便之目的而放大或縮小,且尺寸為任意的且不限於此。於圖式中相似之參考符號代表相似之元件。 The above drawings are schematic and not to scale. Relative sizes and proportions in the drawings are exaggerated or reduced for accuracy and/or convenience, and the dimensions are arbitrary and not limited thereto. Like reference symbols in the drawings represent like elements.
以下將配合圖式及實施例來詳細說明本發明之實施方式,藉此對本發明如何應用技術手段來解決技術問題並達成技術功效的實現過程能充分理解並據以實施。 The implementation of the present invention will be described in detail below in conjunction with the drawings and examples, so as to fully understand and implement the implementation process of how the present invention uses technical means to solve technical problems and achieve technical effects.
當在此使用時,除非文中另行明確地表示,否則「一」、「該」、「此」等單數型式亦旨在包含複數型式。 As used herein, the singular forms "a", "the", and "the" are intended to include the plural unless the context clearly dictates otherwise.
本發明之實施例為敘述改進的方法與裝置如何透過匯流排介面保護對周邊裝置的存取。周邊裝置可包含加密引擎(cryptographic engine)、儲存敏感數據(sensitive data)的記憶體裝置、或任何可通過匯流排存取的裝置。本發明之一些實施例主要以串列式快閃記憶體裝置(serial Flash memory device)進行說明,但本發明所揭露之技術不限於任何特定類型之周邊裝置。 Embodiments of the present invention describe an improved method and apparatus for securing access to peripheral devices through a bus interface. Peripheral devices may include a cryptographic engine, a memory device storing sensitive data, or any device accessible through a bus. Some embodiments of the present invention are mainly described with a serial flash memory device, but the techniques disclosed in the present invention are not limited to any specific type of peripheral devices.
在一些被揭露的實施例中,安全裝置監控匯流排上的數據處置,並且在主機裝置或其他匯流排主裝置試圖存取周邊裝置卻未經授權時將其識別出。數據處置可透過各種合適的標準(criterion)或策略(policy)被分類為經授權或未經授權。 In some disclosed embodiments, a security device monitors data transactions on the bus and identifies when a host device or other bus master device attempts to access a peripheral device without authorization. Data processing can be classified as authorized or unauthorized by various suitable criteria or policies.
識別出未經授權的數據處置時,安全裝置平行地透過在匯流排上的一條或多條線上強制寫入數據或訊號至某個虛擬值以將其阻斷。強制寫入虛擬值可被執行在,例如,時脈訊號、數據訊號及/或晶片選擇(Chip-Select)訊號。 When unauthorized data handling is identified, the security device blocks it in parallel by forcing data or signals to a dummy value on one or more lines on the bus. Forced writing of dummy values can be performed on, for example, clock signals, data signals and/or chip-select signals.
強制寫入虛擬值適用於阻斷匯流排上的訊號,例如適用於汲極開路或集極開路的匯流排,例如I2C匯流排或推挽式(push-pull)的匯流排,例如序列周邊介面(serial periphery interface,SPI)匯流排。與匯流排上的數據處置並行地強制寫入虛擬值使與周邊裝置的通訊中斷,且/或阻斷各自的時脈訊號。 Forcing to write a dummy value is suitable for blocking signals on a bus, such as an open-drain or open-collector bus, such as an I 2 C bus or a push-pull bus, such as a serial peripheral interface (serial peripheral interface, SPI) bus. Forcing dummy writes in parallel with data processing on the bus interrupts communication with peripheral devices and/or blocks respective clock signals.
本文描述了用於阻斷I2C和SPI匯流排上的未授權數據處置的幾種技術範例,還描述了用於在阻斷之後恢復正常操作的技術。在一些實施例中,安全裝置可以阻斷數據處置,但不須先在匯流排上偵測到此數據處置,或者甚至根本不監控匯流排。例如,安全裝置可以強行輸入某個主機的芯片選擇(CS)線上的虛擬值,直到或者除非該主機被授權。 This article describes several examples of techniques for blocking unauthorized data handling on the I2C and SPI buses, and also describes techniques for restoring normal operation after blocking. In some embodiments, a security device may block data transactions without first detecting such data transactions on the bus, or even without monitoring the bus at all. For example, a security device may force a dummy value on a chip select (CS) line of a certain host until or unless the host is authorized.
在一些實施例中,例如SPI匯流排,由此安全裝置保護的匯流排包含一個或多個專用訊號,其各自由不同周邊裝置專用;以及一個或多個共用訊號,其透過匯流排在多個周邊裝置之間共用。例如,共用訊號可為數據訊號以及時脈訊號。例如,專用訊號可為CS訊號。在一些實施例中,安全裝置藉由阻斷受保護之周邊裝置相關的專用訊號,而維持匯流排上之共用訊號不受阻斷,藉以阻斷數據處置。然而,應注意的是,並非所有匯流排都具有專用訊號。例如,在I2C匯流排中所有訊號都是共用訊號。 In some embodiments, such as an SPI bus, the bus protected by this safety device includes one or more dedicated signals, each dedicated to a different peripheral device; Shared among peripheral devices. For example, the common signal can be a data signal and a clock signal. For example, the dedicated signal can be a CS signal. In some embodiments, the security device blocks data processing by blocking dedicated signals associated with protected peripherals while leaving common signals on the bus unblocked. It should be noted, however, that not all buses have dedicated signals. For example, all signals in the I 2 C bus are common signals.
在其他的實施例中,安全裝置係藉由代替受保護之周邊裝置回應未經授權之主機,藉此阻斷數據處置。在一示例性實施例,周邊裝置包含一快閃記憶體,此快閃記憶體包含一個或多個位址區(address zone)用以儲存敏感數據,例如金鑰、組態數據及/或啟動代碼。藉由選擇性覆寫快閃記憶體之CS訊號,安全裝置可覆蓋對快閃記憶體之數據的存取,且由安全裝置使用其內存數據來回應主機。本發明將會說明此類型的安全開機程序(secure boot process)。 In other embodiments, the security device blocks data processing by responding to unauthorized hosts instead of protected peripheral devices. In an exemplary embodiment, the peripheral device includes a flash memory that includes one or more address zones for storing sensitive data, such as keys, configuration data, and/or boot code. By selectively overwriting the flash memory's CS signal, the secure device can override access to data in the flash memory, and the secure device can respond to the host with its memory data. The present invention will describe this type of secure boot process.
此處揭露的技術在逐筆操作的等級(transaction-by-transaction level)上提供即時的安全選擇性存取至周邊裝置。在本文所描述的大多數技術中,僅使用匯流排的現有訊號來執行數據處置的識別和阻斷。因此,所揭露的技術不需要額外的引腳或互連線路(interconnection),從而減小了整個系統尺寸和成本。 The techniques disclosed herein provide instant secure selective access to peripheral devices on a transaction-by-transaction level. In most of the techniques described herein, only the existing signals on the bus are used to perform the identification and blocking of data transactions. Therefore, the disclosed technique does not require additional pins or interconnections, thereby reducing overall system size and cost.
透過I2C匯流排對周邊裝置安全存取數據 Securely access data to peripheral devices through the I2C bus
第1圖係為本發明實施例中受安全保護之系統20的方塊示意圖。在本發明的實施例中,系統20包含一主機裝置24及一周邊裝置28,其皆連接至I2C匯流排32。為了簡潔起見,本文中,主機裝置24和周邊裝置28也被稱為主機(host)和周邊(peripheral),主機裝置24亦可為匯流排主裝置(bus master)。
FIG. 1 is a schematic block diagram of a security-protected
安全裝置36透過監控I2C匯流排32上的數據處置,以保護對周邊裝置28的數據存取,並避免主機裝置24或其他具有匯流排主裝置能力的裝置嘗試未經授權的存取周邊裝置28。安全裝置36有時也被稱為控制裝置或信任平台模組(TPM)。在本發明的實施例中,安全裝置36包含一介面40、一記憶體48以及一處理器44,介面40用於連結至I2C匯流排32,處理器44用以執行本發明的技術,記憶體48用於儲存一個或多個由處理器44所實行的安全策略。
處理器44可依據任何預先定義或是設定策略來將數據處置分類為未經授權的。通常未經授權的數據處置可能會嘗試對周邊裝置28寫入數據、
讀取周邊裝置28的數據、設置或發送命令至周邊裝置28,或是以其他合適之方式存取周邊裝置28。由安全裝置36所實施的策略可包含肯定策略(如:白名單)、否定策略(如:黑名單)、取決於裝置地址或暫存器偏移(register offset)的策略、或其他任何形式的策略。
例如,安全裝置36可以要求主機在經授權存取周邊裝置28之前,對主機的身分進行認證,由未經授權的主機所嘗試的數據處置可被視為未授權。認證可以透過如在主機與安全裝置間進行問題詢答程序(challenge-response process)來執行。另外地或可選擇地,可以要求主機以其他的某種合適方式證明其身分,或是成功的完成安全開機程序。
For example,
此外,附加的或替代的,有些類型的數據處置(如:讀取數據處置)可被視為被授權的,而其他類型的數據處置(如:寫入數據處置)可被視為未經授權的。在又另一個實施例中,對被選定的周邊裝置的地址存取可被視為被授權的,而存取其他地址則可被視為未經授權的。另一個實施例,匯流排上的某些位元序列(bit sequences)可被視為未授權數據處置。 Furthermore, additionally or alternatively, some types of data processing (e.g. read data processing) may be considered authorized while other types of data processing (e.g. write data processing) may be considered unauthorized of. In yet another embodiment, access to addresses of selected peripheral devices may be considered authorized, while access to other addresses may be considered unauthorized. In another example, certain bit sequences on the bus may be treated as unauthorized data.
通常處理器44可透過任何合適的方法分辨數據處置是否經授權。記憶體48儲存了一個或多個策略以分辨數據處置是否經授權。
Typically
I2C匯流排32包含帶有串列數據訊號的串列數據(SDA)線及帶有串列時脈訊號的串列時脈(SCL)線。術語”線”、”線路”與”訊號”在本文中可被交互使用。透過監控SDA線及SCL線,處理器44得以監控I2C匯流排32上的所有數據處置,並辨識出未經授權的數據處置。
The I 2 C bus 32 includes a serial data (SDA) line carrying a serial data signal and a serial clock (SCL) line carrying a serial clock signal. The terms "wire", "circuit" and "signal" are used interchangeably herein. By monitoring the SDA line and the SCL line, the
在識別出未經授權數據處置後,處理器44透過強行寫入一個或多個虛擬值至I2C匯流排32上的SDA線及/或SCL線,以阻斷數據處置。此機制由於I2C匯流排具有汲極開路/集極開路結構而可能實現。通常SDA線與SCL線都使用
上拉電阻而被預設上拉至邏輯”1”的狀態。任何裝置皆可隨時在SDA線或SCL線上寫入邏輯”0”值,而不管其他裝置可能同時寫入的值。
After identifying an unauthorized data transaction,
因此,在一些實施例中,當識別出未經授權的數據處置時,安全裝置36中的處理器44會透過介面40在I2C匯流排32的SDA線或SCL線上強行輸入邏輯值”0”(預設邏輯值”1”的相反值)。在本文中”0”值被視為虛擬值(dummy value)。在SDA線上強制寫入的”0”值將改寫任何同時由主機裝置24送至周邊裝置28的值或主機裝置24從周邊裝置28讀取的值,或改寫預設的邏輯值”1”。強制寫入”0”值在SCL線上將使時脈訊號停止,在上述任一情況之下,數據處置將被阻斷。
Therefore, in some embodiments, when unauthorized data handling is identified, the
在一些實施例中,處理器44將持續強制寫入”0”值,直到裝置被重置。在其他實施例中,處理器44允許從中斷中適度回復(graceful recovery),即允許主機裝置24和周邊裝置28從阻斷中回復數據處置,並回復正常運作。一些主機及/或周邊裝置無法從時脈暫停(clock stall)中回復。因此,若之後需要對簡單主機及周邊裝置適度回復時,則較佳的是在SDA線上強行寫入虛擬值而非在SCL線上。
In some embodiments,
在一個實施例中,為了在中斷數據處置後恢復正常運作,處理器44會在匯流排上生成I2C停止條件或I2C重新啟動條件。在本文中,I2C停止條件或I2C重新啟動條件可包含任何匯流排訊號值序列,其可指示該裝置匯流排處於閒置狀態且可以開始數據處置。
In one embodiment,
處理器44可使用各種技術允許數據處置被阻斷後進行適度回復。在一個實施例中,處理器44在預定時間長度內持續強制寫入”0”值,其被視為足以阻斷未經授權的數據處置。任何預定時間長度皆可被使用。例如,SM匯流排定義之暫停時間長度為25mS。因此,在SM匯流排於I2C的應用中,將預定義的持續時間設置為至少25mS是有意義的,以便觸發暫停。
在另一個實施例中,處理器44在預定時間內持續在SDA線上強制寫入”0”值,直到檢測到SCL線為邏輯高值,例如在非擾動(not toggling)狀況。此條件可以指示主機中止或捨棄數據處置。處理器44可以接著釋放SDA線,並且可能產生I2C停止條件。
In another embodiment, the
在又另一個實施例中,對於阻斷從周邊裝置讀取的數據處置有用的是,將安全裝置36設置為具有跟周邊裝置28同樣地址的I2C從屬裝置。安全裝置36中的處理器44使用”0”數據值來回應任何未經授權的讀取要求。周邊裝置28同樣會並行回應這些讀取要求至處理器44,但其數據值會被安全裝置36所傳的”0”值覆寫。此過程會持續至主機結束數據處置,例如透過停止條件。須注意,依據I2C規範,I2C從屬裝置在發送數據時並不會驅動ACK/NEGACK位元。
In yet another embodiment, it is useful to block the handling of data read from the peripheral device to configure the
在另一個實施例中,同時對於阻斷讀及寫的數據處置有用的方式是由處理器44在SDA線上強制寫入”0”值。接著,若主機裝置24沒有識別出此阻斷,則此數據處置係以匯流排上的”0”數據正常結束,而非從周邊裝置28發送的數據。若主機裝置24偵測到此中斷並捨棄數據處置,例如,因為主機裝置24支援I2C多主機仲裁(multi-master arbitration),則處理器44通常可透過在SCL線上生成額外的時脈週期,以接管主機裝置24捨棄的數據處置。處理器44可以接著完成正在被傳送的當前位元組,並透過發出停止條件來中止此數據處置。
In another embodiment, it is useful for data handling to block both reads and writes by the
上面描述的阻斷和回復技術僅通過實施例來說明。在一個替代的實施例中,安全裝置36的處理器44可以透過任何其他技術來阻斷數據處置及/或從阻斷中進行回復。
The blocking and recovery techniques described above are by way of example only. In an alternative embodiment,
在上述實施例中,僅使用匯流排的現有線路來實現對未經授權數據處置的檢測、阻斷及阻斷後的回復。在一個替代的實施例中,安全裝置36和主機裝置24也通過在匯流排32外部的一些輔助介面連接。例如,當安全裝置36
和主機裝置24整合在同一積體電路(IC)中並且共享積體電路的SDA和SCL引腳時,這種機制是可行的。
In the above-described embodiments, only the existing wiring of the bus is used to achieve detection, blocking and post-blocking recovery of unauthorized data handling. In an alternate embodiment,
在這些實施例中,安全裝置36和主機裝置24使用輔助介面(auxiliary interface)來驗證是否有其他主機裝置存取周邊裝置28。在一個示範的實施例中,當主機裝置24存取周邊裝置28時,主機裝置24透過輔助介面通知安全裝置36。為回應該通知,處理器44不強制寫入虛擬值”0”至匯流排,並允許數據處置實行。在檢測到存取周邊裝置28但未在輔助介面上報告的數據處置時,處理器44會假定該數據處置由一些未經授權的主機發出,並且通過強制寫入”0”值來中斷它。
In these embodiments, the
第2圖為本發明實施例透過I2C匯流排32保護對周邊裝置28的存取的方法的流程圖。此方法在監控步驟50時啟動,安全裝置36上的處理器44透過介面40監控I2C匯流排32上的數據處置。
FIG. 2 is a flowchart of a method for securing access to a peripheral device 28 through an I 2 C bus 32 according to an embodiment of the present invention. The method starts at a
在數據處置檢測步驟54時,處理器44識別出主機裝置24試圖存取周邊裝置28的數據處置。在檢查步驟58時,處理器44檢查數據處置是否經過授權。例如,處理器44可以檢查此數據處置是否違反儲存於記憶體48的安全策略。
At a data
若此數據處置被授權,則在一允許步驟62,處理器44將允許數據處置正常進行。否則,若檢測出此數據處置未經授權,則在一阻斷步驟66,處理器44會透過強制寫入虛擬值”0”至I2C匯流排32的SCL及/或SDA線,以中斷此數據處置。
If the data processing is authorized, then in an enabling
透過SPI匯流排安全存取周邊裝置 Secure access to peripheral devices via the SPI bus
第3圖為本發明的一個替代的實施例中,受安全保護之系統70的方塊示意圖。如第3圖所示,系統70包含主機裝置74、周邊裝置78以及安全裝置86,其均連接至SPI匯流排82。
FIG. 3 is a block diagram of a
在主機裝置74未經授權的嘗試存取周邊裝置78時,安全裝置86會識別並阻斷此數據處置。在本發明的實施例中,安全裝置86包含介面90,其連接於SPI匯流排82;處理器94,其被設置為執行本發明的技術;記憶體98,其被設置為儲存一個或多個由處理器94所實行的安全策略。
When the
用於區分授權和未經授權之數據處置的安全策略,以及安全裝置86的處理器94識別未經授權的數據處置的方式,基本與上述系統20所描述的相似。以下描述之技術與上述技術之不同點在於,安全裝置86在匯流排82上強制寫入虛擬值以阻斷未經授權的數據處置。
The security policy for distinguishing between authorized and unauthorized data handling, and the manner in which
SPI匯流排82包含時脈(CLK)線、及被稱為主輸出從輸入(MOSI)和主輸入從輸出(MISO)的兩條數據傳輸線。CLK線、MISO線和MOSI線對於所有裝置(在本實施例中為裝置74、78和86)是共用的。此外,每個從屬裝置可透過專用的晶片選擇線來選擇。在本實施例中,主機裝置74使用標記為CS2#的CS線來選擇周邊裝置78,並且使用標記為CS1#的CS線來選擇安全裝置86。
The
作為主控裝置的主機裝置74係連接到所有CS線。另一方面,由於周邊裝置78是從屬裝置,因此每個周邊裝置78僅連接到其自己的CS線。通常,主機裝置74通過使用相應的CS線選擇期望的周邊裝置78來啟動數據處置,然後使用CLK、MOSI和MISO線與裝置進行通訊。MOSI線用於從主機裝置74向周邊裝置78發送訊號,MISO線則用於從周邊裝置78發送訊號至主機裝置74。
A
安全裝置86與常規SIP從屬裝置不同,其被定義為從屬裝置但能驅動所有CS線。如第3圖所示,安全裝置86的介面90被配置為與主機裝置74並行地驅動CS2#線。當系統70包含多個具有相對應CS線之周邊裝置78時,安全裝置86通常被設置為可平行地驅動任何連結至主機裝置74的CS線。
The
在一些實施例中,系統70被設計為當主機裝置74與安全裝置86以相反邏輯值驅動CS線時,安全裝置86所驅動的邏輯值將覆寫主機裝置74所驅
動的邏輯值。也可以說,當主機裝置74與安全裝置86在CS線上驅動相反的邏輯值時,周邊裝置78會收到並執行由安全裝置86所驅動的邏輯值。
In some embodiments,
覆寫CS線是阻止匯流排上的數據處置以中斷主機和周邊裝置78之間的未經授權數據處置的另一種範例。上述覆蓋機制可透過各種方式實現。下面的描述涉及用於選擇周邊裝置78的CS2#線,但當使用多個周邊裝置78及多個相對應的CS線時,應使用同樣的機制。
Overriding the CS line is another example of preventing data transactions on the bus to interrupt unauthorized data transactions between the host and
在一個實施例中,安全裝置86透過介面90驅動CS2#線的線驅動器比主機裝置74驅動CS2#線的線驅動器要強。在一個替代的實施例中,串聯電阻100可以在主機裝置74的輸出處插入CS2#線中。相對於安全裝置86對CS2#的線驅動器的輸出,串聯電阻100會減弱主機裝置74對CS2#線的線驅動器的輸出。另外,安全裝置86可以被設置為以其他任何合適的方式覆蓋主機裝置74驅動CS2#線的訊號。
In one embodiment, the
安全裝置86的處理器94可以透過監控SPI匯流排82的CS線、CLK線、MISO線及/或MOSI線,並以任何合適的方式識別未經授權的數據處置。在一些實施例中,在辨識出主機裝置74未授權地嘗試存取某個周邊裝置78的數據處置時,安全裝置86的處理器94透過設定周邊裝置78的CS線失效(de-assert)來中斷數據處置。由於安全裝置86被設置為在覆寫主機裝置74對CS2#線的驅動,所以周邊裝置78將被取消選擇,且數據處置中斷。另一方面,當確定數據處置以被授權時,處理器94將停止自己的CS2#線驅動器,從而使主機不被中斷的存取周邊裝置78。
第4圖為本發明另一個實施例中安全系統110之方塊示意圖。系統110同樣是基於SPI匯流排82,與第3圖的系統70相似。然而,在系統110中,安全裝置86通過在CLK線、MISO線及/或MOSI線上強制寫入虛擬值來破壞未經授權的數據處置,而不是覆寫CS線。
FIG. 4 is a schematic block diagram of a
在本示例中,系統110係用以使得安全裝置86覆寫主機裝置74對CLK線、MISO線及/或MOSI線的驅動。如圖所示,為達到此目的,串聯電阻100係插置在CLK線、MISO線以及MOSI中。由於CS2#線在此例中沒有被覆蓋,所以不須插置串聯電阻。
In this example,
在其他實施例,覆寫機制可用使安全裝置86之CLK線、MISO線及/或MOSI線的線驅動器比主機裝置74之線驅動器更強來實現。
In other embodiments, the overriding mechanism may be implemented by making the line drivers of the
在其他實施例中,同時使用覆寫CS線(如第3圖所示)及覆寫CLK線、MISO線及/或MOSI線(如第4圖所示)的混合方案也是可行的。 In other embodiments, a hybrid scheme of overwriting the CS lines (as shown in FIG. 3 ) and overwriting the CLK lines, MISO lines and/or MOSI lines (as shown in FIG. 4 ) is also feasible.
覆寫專用點對點訊號以保護周邊裝置存取安全 Override dedicated point-to-point signals to secure access to peripheral devices
匯流排之訊號,例如SPI匯流排,可區分成共用訊號以及專用訊號。共用訊號係在匯流排上平行連接至多個(例如,所有)周邊裝置的訊號。共用SPI訊號之例子為數據(MOSI以及MISO)訊號以及時脈(CLK)訊號。專用訊號係為專用於特殊周邊裝置的訊號。專用訊號之例子為晶片選擇(CS)訊號。除此之外,匯流排可擴充有帶外專用訊號(out-of-band dedicated signal),例如,寫入保護(write protect,WP)訊號,例如周邊裝置包含一記憶體裝置,可使用WP訊號。專用訊號亦可稱為一點對點(PTP)線。 The signals of the bus, such as the SPI bus, can be divided into shared signals and dedicated signals. A common signal is a signal that is connected in parallel on a bus to multiple (eg, all) peripheral devices. Examples of shared SPI signals are data (MOSI and MISO) signals and clock (CLK) signals. Dedicated signals are signals dedicated to specific peripheral devices. An example of a dedicated signal is a chip select (CS) signal. In addition, the bus can be extended with an out-of-band dedicated signal (out-of-band dedicated signal), such as a write protect (WP) signal, such as a peripheral device including a memory device, which can use the WP signal . Dedicated signals may also be referred to as point-to-point (PTP) lines.
在一些實施例中,在傳送至周邊裝置之前,一個或多個專用訊號係先通過安全裝置86。相反地,共用訊號係從傳統路線傳送至周邊裝置且不通過安全裝置。此連線機制可使安全裝置有效保護周邊裝置之安全。以下將詳細描述。
In some embodiments, one or more dedicated signals pass through the
第5圖係根據本發明的再一實施例之系統130之示意方塊圖。受安全保護之系統130與第3圖之系統70相似。然而,在此實施例,CS2#訊號不受周邊裝置78之輸入端直接驅動。取而代之,來自主機裝置74之CS2#線係輸入至安全裝置86,而由安全裝置86驅動CS2_O#訊號輸入至周邊裝置78。
FIG. 5 is a schematic block diagram of a
在此實施例中,訊號CS2#係作為專用點對點訊號之例子,其通過安全裝置重新連接至受保護之周邊裝置。如第5圖所示,在主機裝置74以及周邊裝置78之間的共用訊號(MOSI、MISO以及CLK)不會被阻斷。
In this embodiment, signal CS2# is used as an example of a dedicated point-to-point signal that reconnects to the protected peripheral device through the security device. As shown in FIG. 5, the common signals (MOSI, MISO, and CLK) between the
安全裝置86藉由選擇性讓CS2#訊號達到至周邊裝置、或是阻止CS2#訊號傳送至周邊裝置,以阻斷主機裝置74以及周邊裝置78之間的數據處置。在第5圖之例子中,藉由設定控制訊號MASK_CS2#有效(assert)或是失效(de-assert),以執行上述選擇。
The
第6圖係根據本發明之一實施例之第5圖所示系統130之安全裝置86之方塊圖。在本示例中,安全裝置86包含一介面90、一處理器94以及一記憶體98。介面90連接SPI匯流排82。處理器94執行本發明揭露之技術。記憶體98儲存一個或多個由處理器94實施之安全策略。處理器94包含一從屬介面邏輯電路91以及一介面監控邏輯電路(IML)92。從屬介面邏輯電路91係處理安全裝置86以及主機裝置74之間的通訊。介面監控邏輯電路92監控、控制控制以及選擇性覆寫主機裝置74對周邊裝置78的存取。
FIG. 6 is a block diagram of the
在一實施例中,安全裝置86辨識以及阻斷在SPI匯流排82上主機嘗試對周邊裝置78的未經授權之數據處置。從第5圖及第6圖可瞭解的是,第3圖所示之系統之任何安全特徵亦可實現在第5圖之系統。
In one embodiment, the
在一些實施例中,安全裝置86之處理器94之從屬介面邏輯電路92包含一組暫存器或其他適合數據結構,其用以定義已經授權的數據處置以及未經授權的數據處置。例如,當周邊裝置78為SPI快閃記憶體裝置,上述定義可載明視為已經授權的指令以及相關位址範圍。根據定義之分類,安全裝置86讓符合規定之指令以及對應位址範圍的數據處置通過,並阻斷不符合定義的數據處置。在一實施例中,一些指令並不強制有位址範圍的規範,例如抹除指令,其不規定位址。
In some embodiments, the
除了阻斷數據處置,介面監控邏輯電路92可發出警訊至較高軟體層,或是啟動其他任何適合回應措施,例如,重置系統或是重置系統之一部分、接管快閃記憶體裝置之控制、以及從另一位置恢復黃金映像檔(golden image),或是甚至永久停止系統並防止以後的任何開機動作。
In addition to blocking data processing, the
在一些實施例中,已經授權數據處置以及未經授權數據處置之規範會遵循一”白名單”邏輯,例如,安全裝置86只讓明確規定在介面監控邏輯電路92中的已經授權數據處置通過,並拒絕以及阻斷未明確規定的數據處置。
In some embodiments, the specification of authorized data processing and unauthorized data processing will follow a "white list" logic, for example, the
在上述實施例,安全裝置係連接至匯流排以及作為一額外從屬裝置。然而,在其他的實施例中,安全裝置可連接作為一主控元件。例如,此實現方式適用於支援多主控裝置(multi-master)能力之匯流排協議(bus protocol)。 In the embodiments described above, the safety device is connected to the busbar and acts as an additional slave device. However, in other embodiments, the security device may be connected as a master control element. For example, this implementation is applicable to a bus protocol that supports multi-master capability.
代替周邊裝置回應未經授權數據處置的保護措施 Protection against unauthorized data handling in place of peripheral devices
在另一實施例中,安全裝置86可代替周邊裝置78回應所選的主機之數據處置。以下說明主要參考第5圖及第6圖之組態,進行示例性說明。一般而言,本發明之技術不限於特殊系統組態,也可應用於其他任何組態,例如第3圖或是第4圖所示之組態。
In another embodiment, the
在第5圖及第6圖所示之一示例性實施例之組態中,依照對周邊裝置78之位址空間中的某一位址區讀取指令形式的偵測,介面監控邏輯電路92可對CS2_O#強加”高位準訊號”,並從安全裝置之內部記憶體98服務一主機讀取指令(或是讀取指令之一部分)。主機裝置74通常不知道此回應不是來自周邊裝置。在一些實施例中,此情境亦適用於第4圖之系統110,例如,安全裝置可覆寫MISO訊號。
In the configuration of an exemplary embodiment shown in FIG. 5 and FIG. 6, the interface
在此機制之另一例子,系統之周邊裝置78包含一SPI快閃記憶體裝置,安全裝置86用以覆寫快閃記憶體位址空間之一部分,藉此仿真(emulate)一受保護的快閃記憶體之位址區。例如,安全裝置86可包含一信任平台模組
(TPM),其使用IML 92覆寫儲存初始主機啟動代碼(其為主機開機時第一個提取(fetch)的開機指令)的快閃記憶體位址區。信任平台模組可用獨有且經過驗證之初始啟動代碼來覆寫此快閃記憶體位址區,例如此獨有且經過驗證之初始啟動代碼可在系統跳至執行之前驗證其餘程式碼。
In another example of this mechanism, the
在一些實施例中,安全裝置86更包含一用於SPI快閃記憶體裝置的主控介面。除此之外,安全裝置86可包含一適當的介面以及電路,用以當存取SPI快閃記憶體裝置時將主機裝置74保持在重置狀態,其可作為系統開機程序之一部份。例如,安全裝置86可為一嵌入控制器(embedded controller,EC)、一超級輸入輸出(super I/O,SIO)裝置或是一基板管理控制器(baseboard management controller,BMC)裝置。
In some embodiments, the
第7圖係為根據本發明之一實施例之安全開機程序之示意流程圖。方法從系統上電(例如系統電力有效)開始,在一保持重置步驟100a,安全裝置86將主機裝置74保持在重置狀態,並進行開機,例如,可從SPI快閃記憶體(周邊裝置78)開始開機。在一初始載入步驟104(此為可選的步驟),安全裝置86從SPI快閃記憶體載入一數據段,驗證此數據段之真實性,並將其儲存在記憶體98內。
FIG. 7 is a schematic flowchart of a secure boot procedure according to an embodiment of the present invention. The method begins with system power-on (e.g., system power is valid). In a hold-
在一覆寫步驟108,安全裝置86設置介面監控邏輯電路92以覆寫對SPI快閃記憶體(例如,本發明的周邊裝置78)之至少一預先定義位址區的存取。此位址區可包含,例如一個或多個金鑰、主機裝置74之組態數據(configuration data)及/或初始開機數據段(initial boot block)。
In an
在一重置解除步驟112,安全裝置86將主機從重置狀態解除。因此,在一開機步驟116,主機裝置74開始開機程序。在一區域存取子步驟120中,由安全裝置86從內部記憶體98服務開機程序之一部份對此預先定義位址區的存取。
In a
在此方式中,敏感資訊例如金鑰、組態數據及/或初始啟動代碼可由安全裝置安全地提供。主機裝置74不知道此資訊是由安全裝置提供而非SPI快閃記憶體。
In this way, sensitive information such as keys, configuration data and/or initial boot codes can be securely provided by the secure device. The
第7圖之方法繪示一安全裝置如何能覆寫對周邊裝置之預先定義位址區的存取的實施例。在其他實施例,其他任何適當方法也可使用於使方法。此外,當冒充SPI快閃記憶體裝置時。安全裝置可藉由其他任何適當方式來覆寫及/或阻斷未經授權的數據處置,以保護此快閃記憶體裝置(或其他周邊裝置)。 The method of FIG. 7 illustrates an example of how a secure device can override access to a predefined address area of a peripheral device. In other embodiments, any other suitable method can also be used for the method. Also, when impersonating an SPI flash device. The security device can protect the flash memory device (or other peripheral devices) by overwriting and/or blocking unauthorized data handling by any other suitable means.
再者,對未經授權數據處置覆寫手段不限於保護一特殊預先定義位址區。例如,可根據受保護之周邊裝置之回傳數據或是根據SPI指令碼觸發此覆寫手段。例如,安全裝置可實施禁用程式化、抹除、寫入、狀態、組態及/或其他任何指令或是快閃記憶體裝置之功能的安全策略。華邦(Winbond)電子公司2015年8月24日出版的”SPI Flash-3V Serial Flash Memory with Dual/Quad SPI and QPI”數據已經規定SPI快閃記憶體指令以及命令之示例規範。 Furthermore, the overwriting means for handling unauthorized data is not limited to protecting a specific pre-defined address area. For example, the overwriting method can be triggered according to the returned data of the protected peripheral device or according to the SPI instruction code. For example, a security device may enforce a security policy that disables programming, erasing, writing, status, configuration, and/or any other command or function of the flash memory device. The "SPI Flash-3V Serial Flash Memory with Dual/Quad SPI and QPI" data published by Winbond Electronics on August 24, 2015 has stipulated the example specifications of SPI flash memory instructions and commands.
在另一實施例,第7圖所示之方法中,敏感資訊一開始係儲存於快閃記憶體裝置中,在開機程序之一部份是安全裝置從快閃記憶體裝置讀取敏感資訊。在其他實施例,敏感資訊可一開始儲存在安全裝置中(用以取代快閃記憶體,或是敏感資訊也有儲存於快閃記憶體)。在此實施例中,安全裝置不需要從快閃記憶體裝置讀取資訊。 In another embodiment, in the method shown in FIG. 7, the sensitive information is initially stored in the flash memory device, and as part of the boot process, the security device reads the sensitive information from the flash memory device. In other embodiments, the sensitive information may be initially stored in the secure device (in place of the flash memory, or the sensitive information may also be stored in the flash memory). In this embodiment, the security device does not need to read information from the flash memory device.
在另一示例中,第7圖之方法係與搭配一SPI匯流排。在其他實施例,安全裝置可使用其他匯流排之任何專用訊號及/或共用訊號,以在其他匯流排以及協議中覆寫對一周邊裝置之預先定義位址區的存取。例如,I2C匯流排係為一雙向上拉匯流排(pull-up bidirectional bus),其設計以支援多個從屬裝置以及多個主控元件。因此,此通訊協議具有一嵌入式機制以處理裝置之間的競爭關係。例如,當I2C裝置偵測在SDA線上的”0”,便嘗試設定”1”(上拉),此裝置假定
出現競爭並解除匯流排直到下一數據處置。在一實施例中,I2C安全裝置(例如,第1圖之安全裝置36)係用以疊合(overlap)另一周邊裝置從屬(例如,第1圖之安全裝置28)之一些位址空間。例如,此安全裝置可回答另一周邊裝置所期待的相同數據。若安全裝置偵測到數據不符合之情況,例如安全裝置嘗試上拉成”1”但是卻偵測到SDA線上仍是”0”,則安全裝置可啟動回應措施,例如,造成一停止條件,在一個或多個數據線上驅動訊號”0”,以設定一無限時脈延長或是其他任何適當動作。此技術可使用傳統的I2C從屬裝置在數據位準監控裝置,而不須改變實體層硬體。
In another example, the method of FIG. 7 is used with an SPI bus. In other embodiments, the security device may use any dedicated and/or shared signals of other buses to override access to a predefined address area of a peripheral device in other buses and protocols. For example, the I 2 C bus is a pull-up bidirectional bus designed to support multiple slave devices as well as multiple master components. Therefore, the protocol has an embedded mechanism to handle contention between devices. For example, when an I2C device detects a "0" on the SDA line and attempts to set a "1" (pull-up), the device assumes contention and releases the bus until the next data transaction. In one embodiment, an I2C secure device (eg,
在又一實施例,安全裝置86(使用ILM 92)亦監控SPI位址之數據相位(data phase)。當辨識出數據不符合,安全裝置可啟動回應措施,例如,斷開數據處置、重置系統、鎖住對金鑰之存取、或是其他任何適當動作。 In yet another embodiment, the watchdog 86 (using the ILM 92) also monitors the data phase of the SPI address. When data non-compliance is identified, the security device may initiate response measures, such as disconnecting data handling, resetting the system, locking access to keys, or any other appropriate action.
在一示例情境,安全裝置86保存有儲存在SPI快閃記憶體中的某一代碼部份之簽章(signature)或是摘要(digest)。安全裝置監控主機裝置74對SPI快閃記憶體之存取,並在背景下計算此代碼部份之簽章或是雜湊值。若偵測到錯誤簽章、錯誤雜湊值或是錯誤的SPI提取數列(SPI fetch sequence),安全裝置86可啟動適當回應措施。
In an example scenario, the
在又一實施例,安全裝置可在匯流排上監控一個以上的周邊裝置78,並驗證對不同裝置的存取命令是否與預期相同。
In yet another embodiment, the security device may monitor more than one
在又一實施例,當偵測到對周邊裝置78進行的數據處置已經授權時,安全裝置86可使用一個或多個CS之外的訊號,以限制對周邊裝置78的存取,或是實施某一系統狀態。以下描述上述訊號的類型或用途,但其僅為舉例而非為限制本發明。
In yet another embodiment, the
(1)搭配第4圖之安全系統而呈現的任何訊號 (1) Any signal presented with the security system in Figure 4
(2)快閃記憶體之防寫訊號 (2) Anti-write signal of flash memory
(3)重置控制訊號 (3) Reset control signal
(4)電力管理控制訊號 (4) Power management control signal
(5)控制一個或多個裝置之電力 (5) Control the power of one or more devices
(6)禁用系統通訊,例如禁用網路介面控制器(network interface controller,NIC) (6) Disable system communication, such as disabling network interface controller (network interface controller, NIC)
(7)系統重置 (7) System reset
此外,上述訊號或是其他任何適當訊號可用於產生系統警訊及/或啟動任何適當回應措施。 Additionally, the above signals or any other appropriate signals may be used to generate system alerts and/or initiate any appropriate response measures.
藉由延長CS持續時間以阻斷對SPI快閃記憶體的未經授權之數據處置 Block unauthorized data handling to SPI flash memory by extending CS duration
第8圖係為根據本發明的另一實施例之受安全保護之系統132中多個裝置在SPI匯流排上進行通訊的示意性方塊圖。第8圖之系統132係與第5圖之系統130相似,不同之處在於第8圖之系統132額外具有一及閘134以及一控制訊號MASK_LOW_CS2。在第8圖中,周邊裝置78係為一SPI快閃記憶體裝置。如同第5圖之說明,安全裝置86藉由選擇性讓CS2#訊號到達周邊裝置或是阻止CS2#訊號到達周邊裝置,以阻斷主機裝置74以及周邊裝置78之間的數據處置。第5圖中,藉由設定控制訊號MASK_CS2#有效或無效,以執行此選擇動作。
FIG. 8 is a schematic block diagram of multiple devices communicating on the SPI bus in the
在一實施例中,周邊裝置78係為一SPI快閃記憶體裝置。在本實施例中,將快閃記憶體裝置CS訊號(圖中所示之CS2_O#)設定成”低位準”,表示選擇快閃記憶體裝置;反之,將CS訊號設定成”高位準”,表示不選擇此快閃記憶體裝置。
In one embodiment,
第5圖所示之範例中,安全裝置86藉由在數據處置結束之前設定MASK_CS2#訊號為高位準,以阻斷主機裝置74以及快閃記憶體78之間的數據處
置。此操作係在數據處置結束之前將快閃記憶體裝置之CS訊號設定成”高位準”,而不選擇此快閃記憶體裝置。
In the example shown in FIG. 5, the
然而,在一些情況,上述技術可能無法阻斷一些未經授權的數據處置。例如,當一已經授權的數據處置與一未經授權的數據處置的差別只有最後一個位元。例如,在一實施例中,指令操作碼0x60已經授權,但指令操作碼0x61未經授權而應該阻斷。在此情況,在取樣最後一位元後不選擇快閃記憶體裝置的CS訊號則將不會阻斷數據處置。 However, in some cases, the aforementioned techniques may not be able to prevent some unauthorized data processing. For example, when an authorized data disposal differs from an unauthorized data disposal by only the last bit. For example, in one embodiment, instruction opcode 0x60 is authorized, but instruction opcode 0x61 is not authorized and should be blocked. In this case, a CS signal that does not select the flash device after sampling the last bit will not block data processing.
第8圖之其他實施例可克服此問題。在第8圖之組態中,MASK_LOW_CS2訊號係通常設定成”高位準”。回應偵測到未經授權數據處置,安全裝置86可設定MASK_LOW_CS2為”低”位準。此操作可將快閃記憶體裝置78之CS訊號之持續時間延長超出此數據處置之實際結束時間。因此,快閃記憶體裝置78可以偵測到數據處置之長度超過預期長度一個或多個時脈週期,則阻止執行此數據處置。
The other embodiment of Fig. 8 can overcome this problem. In the configuration in Figure 8, the MASK_LOW_CS2 signal is usually set to "high level". In response to detection of unauthorized data handling,
當使用第8圖所示之技術時,安全裝置86可延長CS訊號之持續時間至任何適當長度,例如,延長一個時脈週期、幾個時脈週期、或是無限個時脈週期,例如直到下一次重置或是上電。
When using the technique shown in FIG. 8, the
在第8圖之示例性實施例(以及第5圖之示例性實施例),藉由使用CS1#訊號選擇安全裝置86,可讓安全裝置86在SPI匯流排82上與主機裝置74進行通訊。在其他實施例,安全裝置非強制必須有一個別CS訊號。此安全裝置可使用其他任何適當介面,直接或是間接與主機裝置進行通訊。在一些實施例中,只要安全裝置能在沒有介面的情況下監控SPI數據處置以及保護匯流排安全,主機裝置以及安全裝置之間也可以沒有介面。
In the exemplary embodiment of FIG. 8 (and the exemplary embodiment of FIG. 5 ), the
使用數據處置組計數器監控SPI快閃記憶體的數據處置 Monitor data disposition of SPI flash memory using data disposition group counters
在一些實施例中,安全裝置86之處理器94會載明一個或多個SPI數據處置群組(group of SPI transactions),以及在每一群組中保持對SPI數據處置數量的持續計數。每一SPI數據處置群組可包含一個或多個符合一些預先定義標準的SPI數據處置。
In some embodiments, the
在一示例中,一數據處置群組可包含多種類型的讀取數據處置,而另一數據處置群組可包含多種類型的寫入數據處置。在另一範例,一數據處置可包含多種類型的已經授權數據處置,而另一數據處置群組可包含多種類型的未經授權數據處置。此外,可使用其他任何適當的數據處置分類。處理器94可定義任何適當數量的群組。此群組不必包含所有可能的數據處置類型。此分類可以是使用者自訂的。
In one example, one data handling group may include multiple types of read data handling, while another data handling group may include multiple types of writing data handling. In another example, a data handling group may include multiple types of authorized data handling, while another data handling group may include multiple types of unauthorized data handling. Also, any other suitable data disposition classification may be used.
在一實施例中,安全裝置86包含多個由硬體實現或由軟體實現的計數器,其為本發明之數據處置組計數器(transaction-group counter)。處理器94分別分配一計數器給每一數據處置群組。處理器94之軟體可重置一既定計數器,例如,當系統重置或是上電後重置、讀取計數器之後重置、計數器達到某一門檻值之後重置、或是符合其他任何適當條件或是事件後重置。
In one embodiment, the
一般而言,某一數據處置類型可出現在一個以上數據處置群組,其表示一個數據處置可能會讓多個計數器增加計數。例如,考量一實施例,包含一具有所有寫入數據處置類型之第一群組、一具有所有讀取數據處置類型之第二群組、以及一具有所有未經授權數據處置之第三群組。然而,在此例中,寫入數據處置之一些類型已經授權而其他類型未經授權。3個計數器可分別界定為3個群組所用。在本實施例中,回應辨識到一未經授權之寫入數據處置,處理器94將增加第一計數器以及第三計數器之計數。此外,其他任何計數群組可省略未經授權之數據處置。
In general, a certain data treatment type can appear in more than one data treatment group, which means that one data treatment may cause multiple counters to count up. For example, consider an embodiment that includes a first group with all write data disposition types, a second group with all read data disposition types, and a third group with all unauthorized data disposition . However, in this example, some types of write data dispositions are authorized and others are not. 3 counters can be defined for 3 groups respectively. In this embodiment, the
在正常操作期間,處理器94持續增加計數器。因此,在一個給定的時間點,每一數據處置組計數器可表示在此既定時間中屬於其群組之SPI數據處置的發生數量。安全裝置86或其他裝置可使用此資訊來判斷主機裝置74之操作狀況,以偵測主機裝置74之可能為安全威脅的反常行為,或是使用此資訊於其他任何適當用途。在一些實施例中,如果計數器數值表現出主機裝置74之可疑行為特徵,例如寫入或是抹除數據處置之數量出乎預料的高,處理器94可發出一警訊或是觸發另一些回應措施。
During normal operation,
第9圖係為根據本發明之一實施例之使用數據處置組計數器監控SPI數據處置之方法的示意流程圖。在此方法中,一開始,在分群以及指定步驟140,處理器94將多種類型之SPI數據處置區分成至少二群組,並將個別數據處置組計數器分配給至少其中之一群組。
FIG. 9 is a schematic flowchart of a method for monitoring SPI data processing using a data processing group counter according to an embodiment of the present invention. In this method, initially, in the grouping and assigning
在數據處置辨識步驟144,處理器94辨識在SPI匯流排上主機裝置74以及SPI快閃記憶體78之間的SPI數據處置。在分類步驟148,處理器94辨識數據處置屬於哪一個SPI數據處置群組。
In a data
在檢查授權步驟152,處理器94檢查是否所辨識的SPI數據處置已經授權。如果已經授權,則進行數據處置接受步驟156,處理器94允許數據處置執行完成。如果未經授權,則進行數據處置阻斷步驟160,處理器94阻斷數據處置。
In a
在增加計數步驟164,處理器94增加在步驟148辨識出的群組所對應的數據處置組計數器。接著,此方法返回步驟144,處理器94繼續監控SPI匯流排82後續的數據處置。
In
第9圖之流程僅為範例以清楚解釋概念。其他任何適當流程可用於其他實施例。例如,在一些實施例中,處理器94不必阻斷未經授權數據處置,而是處理器94可啟動適當回應措施,例如觸發警訊或是進入警示模式。另一範
例,使用數據處置組計數器機制也不一定需要檢查未經授權數據處置,例如,不去判斷任何數據處置是否為未經授權。
The flow chart in Figure 9 is just an example to explain the concept clearly. Any other suitable procedures may be used in other embodiments. For example, in some embodiments,
在安全裝置支援SPI快閃記憶體模式 Supports SPI flash memory mode in secure device
在一些實施例中,SPI快閃記憶體裝置78係支援專用運作模式。回應來自主機裝置之專用SPI指令,例如模式進入數據處置(mode-entry transaction)或是模式離開數據處置(mode-exit transaction),可進入專用模式(dedicated mode)或是離開專用模式。依據SPI快閃記憶體裝置是否在專用模式,一些SPI數據處置可具有不同的格式或是解釋。在一些實施例中,安全裝置86之處理器94知道並支援SPI快閃記憶體78之專用模式。
In some embodiments, SPI
例如,專用模式可為一”連續讀取”模式,其也稱為XIP模式。華邦電子公司在2015年11月13日發表之”W25Q257FV SPI Flash-3V 256M-Bit Serial Flash Memory with Dual/Quad SPI & QPI”的數據表中描述此用語”XIP模式”。當操作在連續讀取模式,快閃記憶體裝置預期只會接收到讀取數據處置,因此主機裝置不會在每個指令傳送讀取操作碼。此外,安全裝置86之處理器94可支援其他任何適當專用模式。
For example, the dedicated mode may be a "sequential read" mode, also known as XIP mode. Winbond Electronics described this term "XIP mode" in the data sheet of "W25Q257FV SPI Flash-3V 256M-Bit Serial Flash Memory with Dual/Quad SPI & QPI" published on November 13, 2015. When operating in continuous read mode, the flash memory device is only expected to receive read data transactions, so the host device does not send a read opcode with every command. Additionally,
在一些實施例中,處理器94可藉由以下方式支援某一專用模式:(i)辨識出主機裝置74(在SPI匯流排82上)指示快閃記憶體裝置78進入此專用模式之SPI數據處置,以進入專用模式;(ii)藉由辨識主機裝置74指示快閃記憶體裝置78離開專用模式之SPI數據處置,以從專用模式離開;(iii)依據快閃記憶體裝置是否在專用模式下操作,以符合安全裝置操作。
In some embodiments,
在一些實施例中,根據對進入專用模式之辨識,處理器94可實現此專用模式之實際邏輯,其與在快閃記憶體裝置78實現之邏輯相似。在此些實施例,在此專用模式下處理器94繼續監控SPI數據處置,並將此數據處置解釋與此模式定義相適配(adapt)。例如,在“連續讀取”模式,處理器94假設所省略的
讀取指令操作碼與前一個讀取指令操作碼相同,並從此數據處置的起始位置(CS#訊號變成低位準的第一週期開始)便監控/分析位址位元。換句話說,當該記憶體裝置操作在該既定運作模式時,該處理器對一個或多個數據處置給予一第一解釋(first interpretation),以及當該記憶體裝置不是操作在該既定運作模式時,該處理器對該一個或多個數據處置給予一不同的第二解釋(second interpretation)。
In some embodiments, upon recognition of entry into a special-purpose mode,
在其他的實施例中,依照對進入專用模式之辨識,處理器94中止對SPI數據處置之監控直到離開此專用模式。因為處理器94只被要求辨識進入專用模式以及離開專用模式,而不須實現整個專用模式之操作邏輯,上述方式更容易實現。此方式係適用於只預期有已經授權數據處置(因此數據處置不會阻斷)之專用模式。例如,在一實施例,安全裝置86只被要求防範未經授權之寫入數據處置,因此當進入”連續讀取(continuous read)”模式時可以中止(suspend)對數據處置監控。
In other embodiments, upon recognition of entering the dedicated mode,
安全裝置之串列式快閃記憶體可發現參數(SFDP)之操作 Operation of Serial Flash Discoverable Parameters (SFDP) of Secure Device
串列式快閃記憶體可發現參數(SFDP)標準規定內部參數表之標準組中串列式快閃記憶體裝置之功能性以及特徵能力。主機系統軟體可詰問(interrogate)此些參數表。 The Serial Flash Discoverable Parameters (SFDP) standard specifies the functionality and feature capabilities of Serial Flash devices in a standard set of internal parameter tables. Host system software can interrogate these parameter tables.
SFDP係規定在JEDEC JESD216標準系列,並在旺宏國際公司(Marconix International Co.)2011年發表之應用說明”Introduction-Serial Flash Discoverable Parameter Structure”,以及在美光科技公司(Micron Technology Inc.)在2012年發表之技術說明”Serial Flash Discovery parameter for MT25Q Family-Introduction”所有描述。 SFDP is stipulated in the JEDEC JESD216 standard series, and in the application note "Introduction-Serial Flash Discoverable Parameter Structure" published by Marconix International Co. in 2011, and in Micron Technology Inc. (Micron Technology Inc.) in 2012 All the descriptions of the technical note "Serial Flash Discovery parameter for MT25Q Family-Introduction" published in 2016.
在一些實施例中,在主機裝置74第一次與快閃記憶體裝置進行通訊之前,安全裝置86之處理器94可從快閃記憶體裝置78取得SFDP。處理器94接
著修改SFDP並將此修改後的SFDP提出(暴露)給主機裝置74。為了清楚起見,以下內容係以主要以SFDP進行說明,但是本發明可應用對記憶體裝置之能力(capabilities)進行查詢的其他任何類型之數據處置。
In some embodiments,
在一些實施例中,修改SFDP時,處理器94可在SFDP中增加一個或多個快閃記憶體裝置78不支援的能力。當提出修改後的SFDP,主機裝置74可能會嘗試使用此快閃記憶體裝置不支援的新增能力。通常,當監控在SPI匯流排82上之SPI數據處置時,處理器94可辨識出此嘗試,而安全裝置86可代替快閃記憶體裝置實現此能力。例如,上述新增能力可以是支援重放保護單向性計數器(replay-protected monotonic counter,RPMC),其已經揭露在美國專利申請號16/503,501,標題為”RPMC Flash Emulation”的內容,其公開內容通過引用併入本文。此外,其他任何適當的能力也可增加至此SFDP中。
In some embodiments, when modifying the SFDP,
在一些實施例中,為了對主機裝置74隱藏支援功能,修改SFDP時,處理器94可省略SFDP中快閃記憶體裝置78可以支援的一個或多個能力。例如,處理器94可隱藏一些模式的支援,例如双傳輸速率(DDR)能力、快速通道互聯(QPI)能力、連續讀取(XIP)能力、或是其他任何適當能力。在某些情況下,隱藏快閃記憶體裝置78可以支援的能力可能是有用處的,例如,可以讓安全裝置86之實現變得簡單。當對主機裝置隱藏某一能力時,安全裝置就不會被要求要支援此能力,但是仍然通常會被要求辨識相關的SPI數據處置,而如果其出現在匯流排上,安全裝置會阻斷此SPI數據處置。
In some embodiments, in order to hide the supported functions from the
在各種實施例中,處理器94可在不同時期從快閃記憶體裝置78取得實際SFDP。例如,在系統整合或是測試期間,安全裝置86之非揮發性記憶體可預編程有快閃記憶體裝置78之實際SFDP。在另一範例,在主機裝置存取裝置之前,處理器94可在上電時序期間(power-up sequence),從快閃記憶體裝置78取得此SFDP。
In various embodiments,
隨後,當主機裝置74發出一SFDP讀取數據處置,處理器94辨識此指令操作碼,則阻斷此數據處置,例如,將第5圖或是第8圖之CS2_O#訊號設定成”高位準”,接著在匯流排82之MISO線上供應修改過的SFDP給主機裝置74,藉此完成此數據處置。主機裝置沒有辦法偵測出此SFDP是由安全裝置提供而非快閃記憶體裝置。
Subsequently, when the
藉由安全裝置安全調解寫入/抹除數據處置 Write/erase data processing through safe mediation of security devices
在一些實施例中,安全裝置86不僅監控在SPI匯流排上的數據處置,也會調解(mediate)主機裝置以及快閃記憶體裝置。在此些實施例,安全裝置86從主機裝置78接收所選的SPI指令,例如寫入指令或抹除指令,並驗證此指令已經授權。只有當此數據處置已經授權,安全裝置86才會讓此數據處置完成,例如,代表主機裝置74在快閃記憶體裝置78中執行此指令。
In some embodiments, the
通常,安全裝置86之驗證處理包含評估(evaluate)待寫入快閃記憶體裝置之數據。在一些實施例中,此評估包含加密操作,例如驗證此數據之簽章(signature)。此類驗證工作通常要求相當多計算量,並比較不適用於即時動態驗證(以及可能之後的阻斷)在匯流排上的數據處置。
Typically, the verification process of the
第10圖係為根據本發明之一實施例之用以安全調解主機以及SPI快閃記憶體之間的寫入/抹除數據處置之示意性流程圖。在此方法中,一開始,在一監控步驟170,安全裝置86之處理器94監控在SPI匯流排上的數據處置。
FIG. 10 is a schematic flow chart for safely mediating write/erase data processing between the host and the SPI flash memory according to an embodiment of the present invention. In this method, initially, in a
在一辨識步驟174,處理器94辨識主機裝置74要求對快閃記憶體裝置之寫入數據處置。在一阻擋步驟178,處理器94阻擋所要求之寫入數據處置在快閃記憶體裝置中執行。在一取得步驟182,在主機裝置以及安全裝置之間的SPI匯流排上或是其他任何適當介面上,處理器94從主機裝置74取得此寫入數據處置之指令以及數據。
In an
在一評估步驟186,處理器94評估此寫入數據處置。如上所述,此評估可包含對待寫入之數據進行加密操作或其他操作。在一步驟190,如果此驗證成功,例如,寫入數據處置已經授權,則在一步驟194,處理器在快閃記憶體裝置78中代表主機裝置74執行此寫入數據處置。如果此驗證未成功,例如,驗證失敗,則不執行此寫入數據處置,而流程返回到步驟170。
In an
第10圖之流程僅為一範例以清楚解釋概念。其他實施例可使用其他任何適當流程。例如,第10圖之流程係用於辨識、阻擋以及有條件地執行單一數據處置。在其他實施例,可阻擋、評估以及執行多個數據處置、或拒絕全體數據處置。例如,處理器94可依序辨識用於寫入大量數據至記憶體的多個寫入數據處置。處理器可阻擋此些數據處置(如果其指向快閃記憶體),從主機裝置取得整個數據(多個數據處置之序列的數據),並評估整體數據。只有當全部數據都已經授權,處理器94才將此數據寫入快閃記憶體裝置。
The flow chart in Figure 10 is just an example to explain the concept clearly. Other embodiments may use any other suitable process. For example, the flow chart of Figure 10 is used to identify, block and conditionally perform single data processing. In other embodiments, multiple data manipulations may be blocked, evaluated, and performed, or all data manipulations may be denied. For example,
在本發明中,用語”寫入數據處置”意指多種類型之數據處置,例如,編寫快閃記憶體(Flash-program)、抹除快閃記憶體數據區段/數據區塊/全部晶片(sector/block/chip-erase)、寫入致能、以及多種會改變快閃記憶體裝置狀態之其他指令。 In the present invention, the term "writing data processing" means various types of data processing, for example, writing flash memory (Flash-program), erasing flash memory data segment/data block/whole chip ( sector/block/chip-erase), write enable, and various other commands that change the state of the flash memory device.
通常,為了支援此方法,安全裝置86應能在匯流排82上開始SPI數據處置。安全裝置以及主機裝置之間應提供一適當介面(匯流排82或其他匯流排)。當安全裝置控制匯流排時,主機裝置應避免在SPI匯流排上傳送數據處置。
Typically, to support this approach, the
為清楚描述概念起見,第1、3-6以及8圖所示之系統20、70、110、130以及132之組態與多個系統元件例如安全裝置36與86、匯流排32與82之組態係僅為組態範例,而本發明不受其限制。在其他實施例,組態使用其他任何適當組態。
The configurations of
例如,為清楚起見,圖中僅顯示單一周邊裝置以及單一主機裝置。在一些實施例中,安全系統可包含至少二周邊裝置及/或至少二主機裝置。此外,本發明之實施例所以描述的I2C以及SPI匯流排係僅為舉例。在其他實施例,本發明所揭露之技術可經過必要的修改而實現在其他任何適當類型之匯流排。 For example, for clarity, only a single peripheral device and a single host device are shown in the figure. In some embodiments, the security system may include at least two peripheral devices and/or at least two host devices. In addition, the I 2 C and SPI buses described in the embodiments of the present invention are only examples. In other embodiments, the technology disclosed in the present invention can be implemented in any other suitable type of busbar with necessary modifications.
為了清楚說明起見,本文中SPI相關的實施例係主要參考單一位元SPI模式(single-bit SPI mode)。在其他實施例,本發明所揭露之技術可亦使用於其他SPI模式,例如雙線式SPI、四線式SPI、快速通道互聯(QPI)、或是DDR模式。本發明所揭露之技術可亦施加至其他模式,例如連續讀取模式。 For clarity, the SPI-related embodiments herein mainly refer to the single-bit SPI mode. In other embodiments, the technology disclosed in the present invention can also be used in other SPI modes, such as 2-wire SPI, 4-wire SPI, QuickPath Interconnect (QPI), or DDR mode. The techniques disclosed herein can also be applied to other modes, such as continuous read mode.
系統20、70、110、130以及132之不同元件可用任何適當硬體來實現,例如使用一特殊應用積體電路(ASIC)或一現場可程式邏輯閘陣列(FPGA)來實現。在一些實施例中,安全裝置32與86之一些元件,例如處理器44或是94,可用軟體、或是硬體以及軟體元件之組合來實現。記憶體48以及98可使用任何適當類型之記憶體裝置來實現,例如使用隨機讀取記憶體(RAM)或是快閃記憶體(Flash)來實現。
The various elements of
在一些實施例中,處理器44及/或處理器94可包含一通用可編程處理器,其可用軟體編程以執行本發明所揭露之功能。可以透過網路將軟體以電子形式下載到處理器,或者可附加的或可替換的以非暫態之有形媒體(non-transitory tangible media)如磁記憶體、光記憶體、電子記憶體儲存。
In some embodiments,
在上述實施例中,安全裝置先透過監控匯流排以檢測出未經授權之數據處置,接著中斷數據處置。在一個替代的實施例中,安全裝置不須先偵測到數據處置便可以中斷數據處置,甚至不須監控匯流排。例如,安全裝置可以覆寫某個主機的晶片選擇(CS)線,直到或者除非該主機被授權。授權可以以任何合適的方式執行,並非必須使用相同的匯流排。 In the above embodiments, the security device first detects unauthorized data processing by monitoring the bus, and then interrupts the data processing. In an alternative embodiment, the security device can interrupt the data transaction without first detecting the data transaction, or even monitoring the bus. For example, a security device may override a certain host's chip select (CS) line until or unless the host is authorized. Authorization can be performed in any suitable way and does not have to use the same bus.
作為非限制性實施例,本文描述的方法和系統可用於各種應用,例如在安全記憶體應用、物聯網(IoT)應用、嵌入式應用或汽車應用中,在此僅舉幾個例子。 As a non-limiting example, the methods and systems described herein can be used in various applications, such as in secure memory applications, Internet of Things (IoT) applications, embedded applications, or automotive applications, just to name a few.
因此,應當理解的是,上述實施例以實施例的方式引用,並且本發明不限於上述具體示出和描述的內容。相反的,本發明的範圍包括上述各種特徵的組合及子組合,以及本領域之熟練技術者在閱讀前述描述時將想到的未揭露的技術。通過引用併入本申請的文件為本申請的一部分,除非在這些被併入的文件中有任何術語的定義與本文明確地或隱含地與本文相衝突時,應參考本文之定義。 Therefore, it should be understood that the above embodiments are cited by way of example, and the present invention is not limited to what has been particularly shown and described above. Rather, the scope of the present invention includes combinations and subcombinations of the various features described above, as well as undisclosed techniques that would occur to those skilled in the art upon reading the foregoing description. Documents incorporated by reference into this application are made a part of this application, and unless there is a definition of any term in these incorporated documents that conflicts with this document, either expressly or implicitly, reference should be made to the definition herein.
雖然本發明以前述之實施例揭露如上,然其並非用以限定本發明,任何熟習相像技藝者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之專利保護範圍須視本說明書所附之申請專利範圍所界定者為準。 Although the present invention is disclosed above with the aforementioned embodiments, it is not intended to limit the present invention. Any person familiar with similar skills may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of patent protection shall be subject to what is defined in the scope of patent application attached to this specification.
86:安全裝置 86:Safety device
90:系統 90: system
91:從屬介面邏輯電路 91: slave interface logic circuit
92:介面監控邏輯電路 92: Interface monitoring logic circuit
94:處理器 94: Processor
98:內部記憶體 98:Internal memory
Claims (29)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US16/568,299 | 2019-09-12 | ||
| US16/568,299 US10776527B2 (en) | 2015-06-08 | 2019-09-12 | Security monitoring of SPI flash |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW202112114A TW202112114A (en) | 2021-03-16 |
| TWI791138B true TWI791138B (en) | 2023-02-01 |
Family
ID=74863157
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW109103275A TWI791138B (en) | 2019-09-12 | 2020-02-03 | Security monitoring of serial peripheral interface flash |
Country Status (3)
| Country | Link |
|---|---|
| JP (1) | JP7079558B2 (en) |
| CN (1) | CN112487509B (en) |
| TW (1) | TWI791138B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20240184735A1 (en) * | 2021-04-23 | 2024-06-06 | Google Llc | Secure Serial Peripheral Interface Communication |
| TWI845325B (en) | 2023-05-31 | 2024-06-11 | 新唐科技股份有限公司 | Control circuit and control method thereof |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8006095B2 (en) * | 2007-08-31 | 2011-08-23 | Standard Microsystems Corporation | Configurable signature for authenticating data or program code |
| US20120255012A1 (en) * | 2011-03-29 | 2012-10-04 | Mcafee, Inc. | System and method for below-operating system regulation and control of self-modifying code |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102017828B1 (en) * | 2012-10-19 | 2019-09-03 | 삼성전자 주식회사 | Security management unit, host controller interface including the same, method for operating the host controller interface, and devices including the host controller interface |
| JP5630886B2 (en) | 2013-12-16 | 2014-11-26 | ルネサスエレクトロニクス株式会社 | Semiconductor device |
| CN106156632B (en) * | 2015-05-17 | 2019-10-29 | 新唐科技股份有限公司 | Security device, method for providing security service to host in security device and security equipment |
| US10452582B2 (en) * | 2015-06-08 | 2019-10-22 | Nuvoton Technology Corporation | Secure access to peripheral devices over a bus |
| US10095891B2 (en) * | 2015-06-08 | 2018-10-09 | Nuvoton Technology Corporation | Secure access to peripheral devices over a bus |
-
2020
- 2020-02-03 TW TW109103275A patent/TWI791138B/en active
- 2020-04-28 JP JP2020079437A patent/JP7079558B2/en active Active
- 2020-05-27 CN CN202010459272.3A patent/CN112487509B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8006095B2 (en) * | 2007-08-31 | 2011-08-23 | Standard Microsystems Corporation | Configurable signature for authenticating data or program code |
| US20120255012A1 (en) * | 2011-03-29 | 2012-10-04 | Mcafee, Inc. | System and method for below-operating system regulation and control of self-modifying code |
Also Published As
| Publication number | Publication date |
|---|---|
| JP7079558B2 (en) | 2022-06-02 |
| CN112487509A (en) | 2021-03-12 |
| TW202112114A (en) | 2021-03-16 |
| CN112487509B (en) | 2024-04-09 |
| JP2021043944A (en) | 2021-03-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10776527B2 (en) | Security monitoring of SPI flash | |
| US10691807B2 (en) | Secure system boot monitor | |
| US10452582B2 (en) | Secure access to peripheral devices over a bus | |
| JP6703064B2 (en) | How to safely access peripheral devices over the bus | |
| US7917716B2 (en) | Memory protection for embedded controllers | |
| US10783250B2 (en) | Secured master-mediated transactions between slave devices using bus monitoring | |
| US11188321B2 (en) | Processing device and software execution control method | |
| TWI791138B (en) | Security monitoring of serial peripheral interface flash | |
| TWI698769B (en) | Secure access to peripheral devices over a bus | |
| TWI791244B (en) | Monitor system booting security device and method thereof | |
| CN111797440B (en) | Security device, method and system | |
| CN104054063B (en) | Locking a system management interrupt (smi) enable register of a chipset | |
| CN103164352A (en) | Flash memory storage system and data protection method thereof |