[go: up one dir, main page]

TWI791138B - Security monitoring of serial peripheral interface flash - Google Patents

Security monitoring of serial peripheral interface flash Download PDF

Info

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
Application number
TW109103275A
Other languages
Chinese (zh)
Other versions
TW202112114A (en
Inventor
赫詩曼 日弗
哈永 尤爾
亞隆 摩西
Original Assignee
新唐科技股份有限公司
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
Priority claimed from US16/568,299 external-priority patent/US10776527B2/en
Application filed by 新唐科技股份有限公司 filed Critical 新唐科技股份有限公司
Publication of TW202112114A publication Critical patent/TW202112114A/en
Application granted granted Critical
Publication of TWI791138B publication Critical patent/TWI791138B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/82Protecting input, output or interconnection devices
    • G06F21/85Protecting input, output or interconnection devices interconnection devices, e.g. bus-connected or in-line devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus 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

A security device for SPI flash includes an interface and a processor. The interface is configured for connecting to a bus that serves one or more peripheral devices, at least one of the peripheral devices being a memory device. The processor is connected to the bus in addition to the peripheral devices, and is configured to hold a definition that distinguishes between authorized and unauthorized transactions with the memory device, to identify on the bus a transaction in which a bus-master device attempts to access the memory device, and to initiate a responsive action in response to identifying that the transaction is unauthorized in accordance with the definition.

Description

序列周邊介面快閃記憶體之安全裝置 Security Device for Serial Peripheral Interface Flash Memory

相關申請之交互參照 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 system 20 in an embodiment of the present invention. In an embodiment of the present invention, the system 20 includes a host device 24 and a peripheral device 28 , both of which are connected to the I 2 C bus 32 . For brevity, herein, the host device 24 and the peripheral device 28 are also referred to as host and peripheral, and the host device 24 can also be a bus master.

安全裝置36透過監控I2C匯流排32上的數據處置,以保護對周邊裝置28的數據存取,並避免主機裝置24或其他具有匯流排主裝置能力的裝置嘗試未經授權的存取周邊裝置28。安全裝置36有時也被稱為控制裝置或信任平台模組(TPM)。在本發明的實施例中,安全裝置36包含一介面40、一記憶體48以及一處理器44,介面40用於連結至I2C匯流排32,處理器44用以執行本發明的技術,記憶體48用於儲存一個或多個由處理器44所實行的安全策略。 Security device 36 protects data access to peripheral device 28 by monitoring data transactions on I2C bus 32 and prevents unauthorized attempts by host device 24 or other bus master-capable devices to access the peripheral Device 28. Security device 36 is also sometimes referred to as a control device or a trusted platform module (TPM). In an embodiment of the present invention, the security device 36 includes an interface 40, a memory 48, and a processor 44. The interface 40 is used to connect to the I 2 C bus 32, and the processor 44 is used to implement the technology of the present invention. The memory 48 is used to store one or more security policies implemented by the processor 44 .

處理器44可依據任何預先定義或是設定策略來將數據處置分類為未經授權的。通常未經授權的數據處置可能會嘗試對周邊裝置28寫入數據、 讀取周邊裝置28的數據、設置或發送命令至周邊裝置28,或是以其他合適之方式存取周邊裝置28。由安全裝置36所實施的策略可包含肯定策略(如:白名單)、否定策略(如:黑名單)、取決於裝置地址或暫存器偏移(register offset)的策略、或其他任何形式的策略。 Processor 44 may classify data handling as unauthorized according to any predefined or set policy. Typically unauthorized data handling may attempt to write data to the peripheral device 28, Read data of the peripheral device 28 , set or send commands to the peripheral device 28 , or access the peripheral device 28 in other suitable ways. Policies enforced by security device 36 may include positive policies (e.g., whitelists), negative policies (e.g., blacklists), policies based on device addresses or register offsets, or any other form of Strategy.

例如,安全裝置36可以要求主機在經授權存取周邊裝置28之前,對主機的身分進行認證,由未經授權的主機所嘗試的數據處置可被視為未授權。認證可以透過如在主機與安全裝置間進行問題詢答程序(challenge-response process)來執行。另外地或可選擇地,可以要求主機以其他的某種合適方式證明其身分,或是成功的完成安全開機程序。 For example, security device 36 may require a host to authenticate the host's identity before being authorized to access peripheral device 28, and attempted data handling by an unauthorized host may be considered unauthorized. Authentication can be performed, for example, through a challenge-response process between the host and the secure device. Additionally or alternatively, the host may be required to prove its identity in some other suitable manner, or to successfully complete a secure boot procedure.

此外,附加的或替代的,有些類型的數據處置(如:讀取數據處置)可被視為被授權的,而其他類型的數據處置(如:寫入數據處置)可被視為未經授權的。在又另一個實施例中,對被選定的周邊裝置的地址存取可被視為被授權的,而存取其他地址則可被視為未經授權的。另一個實施例,匯流排上的某些位元序列(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 processor 44 can determine whether data handling is authorized by any suitable means. Memory 48 stores one or more policies to determine whether data handling is authorized.

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 processor 44 is able to monitor all data transactions on the I 2 C bus 32 and identify unauthorized data transactions.

在識別出未經授權數據處置後,處理器44透過強行寫入一個或多個虛擬值至I2C匯流排32上的SDA線及/或SCL線,以阻斷數據處置。此機制由於I2C匯流排具有汲極開路/集極開路結構而可能實現。通常SDA線與SCL線都使用 上拉電阻而被預設上拉至邏輯”1”的狀態。任何裝置皆可隨時在SDA線或SCL線上寫入邏輯”0”值,而不管其他裝置可能同時寫入的值。 After identifying an unauthorized data transaction, processor 44 blocks the data transaction by forcibly writing one or more dummy values to the SDA line and/or the SCL line on I 2 C bus 32 . This mechanism is possible due to the open-drain/open-collector structure of the I2C bus. Usually both the SDA line and the SCL line are pulled up to a logic "1" state by default using a pull-up resistor. Any device can write a logic "0" value on the SDA line or the SCL line at any time, regardless of the value that other devices may write at the same time.

因此,在一些實施例中,當識別出未經授權的數據處置時,安全裝置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 processor 44 in the security device 36 will force a logic value "0" on the SDA line or the SCL line of the I 2 C bus 32 through the interface 40 " (opposite of default logical value "1"). A value of "0" is considered a dummy value in this paper. A forced "0" value on the SDA line will overwrite any value simultaneously sent to the peripheral device 28 by the host device 24 or read from the peripheral device 28 by the host device 24, or overwrite the default logical value "1". Forcing a "0" value on the SCL line will stop the clock signal. In either case, data processing will be blocked.

在一些實施例中,處理器44將持續強制寫入”0”值,直到裝置被重置。在其他實施例中,處理器44允許從中斷中適度回復(graceful recovery),即允許主機裝置24和周邊裝置28從阻斷中回復數據處置,並回復正常運作。一些主機及/或周邊裝置無法從時脈暫停(clock stall)中回復。因此,若之後需要對簡單主機及周邊裝置適度回復時,則較佳的是在SDA線上強行寫入虛擬值而非在SCL線上。 In some embodiments, processor 44 will continue to force write a "0" value until the device is reset. In other embodiments, the processor 44 allows graceful recovery from the interruption, ie, allows the host device 24 and the peripheral device 28 to recover data handling from the interruption and resume normal operation. Some hosts and/or peripherals cannot recover from clock stalls. Therefore, it is better to force-write the dummy value on the SDA line instead of the SCL line if there is a need to gracefully restore the simple host and peripheral devices later.

在一個實施例中,為了在中斷數據處置後恢復正常運作,處理器44會在匯流排上生成I2C停止條件或I2C重新啟動條件。在本文中,I2C停止條件或I2C重新啟動條件可包含任何匯流排訊號值序列,其可指示該裝置匯流排處於閒置狀態且可以開始數據處置。 In one embodiment, processor 44 may generate an I 2 C stop condition or an I 2 C restart condition on the bus in order to resume normal operation after interrupting data handling. Herein, an I2C stop condition or an I2C restart condition may include any sequence of bus signal values that may indicate to the device that the bus is in an idle state and data transactions may begin.

處理器44可使用各種技術允許數據處置被阻斷後進行適度回復。在一個實施例中,處理器44在預定時間長度內持續強制寫入”0”值,其被視為足以阻斷未經授權的數據處置。任何預定時間長度皆可被使用。例如,SM匯流排定義之暫停時間長度為25mS。因此,在SM匯流排於I2C的應用中,將預定義的持續時間設置為至少25mS是有意義的,以便觸發暫停。 Processor 44 may use various techniques to allow graceful recovery after data handling is blocked. In one embodiment, processor 44 continues to forcibly write a "0" value for a predetermined length of time, which is deemed sufficient to deter unauthorized handling of the data. Any predetermined length of time can be used. For example, the pause time defined by the SM bus is 25mS. Therefore, in applications where the SM bus is over I2C , it makes sense to set the predefined duration to at least 25mS in order to trigger a pause.

在另一個實施例中,處理器44在預定時間內持續在SDA線上強制寫入”0”值,直到檢測到SCL線為邏輯高值,例如在非擾動(not toggling)狀況。此條件可以指示主機中止或捨棄數據處置。處理器44可以接著釋放SDA線,並且可能產生I2C停止條件。 In another embodiment, the processor 44 continues to forcibly write a value of "0" on the SDA line for a predetermined time until a logic high value on the SCL line is detected, such as in a non-toggling condition. This condition may instruct the host to abort or discard data processing. Processor 44 may then release the SDA line, and possibly generate an I2C stop condition.

在又另一個實施例中,對於阻斷從周邊裝置讀取的數據處置有用的是,將安全裝置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 security device 36 as an I 2 C slave device with the same address as the peripheral device 28 . Processor 44 in security device 36 responds to any unauthorized read request with a "0" data value. The peripheral device 28 will also respond to these read requests to the processor 44 in parallel, but its data value will be overwritten by the “0” value transmitted by the security device 36 . This process continues until the host ends data processing, for example via a stop condition. It should be noted that according to the I 2 C specification, the I 2 C slave device does not drive the ACK/NEGACK bit when sending data.

在另一個實施例中,同時對於阻斷讀及寫的數據處置有用的方式是由處理器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 processor 44 forcing a "0" value on the SDA line. Then, if the host device 24 does not recognize the block, the data transaction ends normally with "0" data on the bus, rather than the data sent from the peripheral device 28 . If the host device 24 detects this interrupt and aborts the data transaction, for example, because the host device 24 supports I 2 C multi-master arbitration, the processor 44 can typically generate additional clock cycles on the SCL line , to take over the disposal of data discarded by the host device 24 . Processor 44 may then complete the current byte being transmitted and abort this data processing by issuing a STOP condition.

上面描述的阻斷和回復技術僅通過實施例來說明。在一個替代的實施例中,安全裝置36的處理器44可以透過任何其他技術來阻斷數據處置及/或從阻斷中進行回復。 The blocking and recovery techniques described above are by way of example only. In an alternative embodiment, processor 44 of security device 36 may block data processing and/or recover from blocking via any other technique.

在上述實施例中,僅使用匯流排的現有線路來實現對未經授權數據處置的檢測、阻斷及阻斷後的回復。在一個替代的實施例中,安全裝置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, security device 36 and host device 24 are also connected through some secondary interface external to bus 32 . For example, when the safety device 36 This mechanism is possible when integrated in the same integrated circuit (IC) with the host device 24 and shares the SDA and SCL pins of the IC.

在這些實施例中,安全裝置36和主機裝置24使用輔助介面(auxiliary interface)來驗證是否有其他主機裝置存取周邊裝置28。在一個示範的實施例中,當主機裝置24存取周邊裝置28時,主機裝置24透過輔助介面通知安全裝置36。為回應該通知,處理器44不強制寫入虛擬值”0”至匯流排,並允許數據處置實行。在檢測到存取周邊裝置28但未在輔助介面上報告的數據處置時,處理器44會假定該數據處置由一些未經授權的主機發出,並且通過強制寫入”0”值來中斷它。 In these embodiments, the security device 36 and the host device 24 use an auxiliary interface to verify whether other host devices are accessing the peripheral device 28 . In an exemplary embodiment, when the host device 24 accesses the peripheral device 28, the host device 24 notifies the security device 36 through the auxiliary interface. In response to this notification, processor 44 does not force a dummy value "0" to be written to the bus, and allows data processing to proceed. Upon detecting a data transaction that is accessed by the peripheral device 28 but not reported on the secondary interface, the processor 44 will assume that the data transaction was issued by some unauthorized host and interrupt it by forcing a "0" value to be written.

第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 monitoring step 50 in which the processor 44 on the security device 36 monitors data transactions on the I 2 C bus 32 through the interface 40 .

在數據處置檢測步驟54時,處理器44識別出主機裝置24試圖存取周邊裝置28的數據處置。在檢查步驟58時,處理器44檢查數據處置是否經過授權。例如,處理器44可以檢查此數據處置是否違反儲存於記憶體48的安全策略。 At a data handle detection step 54 , the processor 44 recognizes that the host device 24 is attempting to access the data handle of the peripheral device 28 . During a check step 58, the processor 44 checks whether the data handling is authorized. For example, processor 44 may check whether the data handling violates a security policy stored in memory 48 .

若此數據處置被授權,則在一允許步驟62,處理器44將允許數據處置正常進行。否則,若檢測出此數據處置未經授權,則在一阻斷步驟66,處理器44會透過強制寫入虛擬值”0”至I2C匯流排32的SCL及/或SDA線,以中斷此數據處置。 If the data processing is authorized, then in an enabling step 62, the processor 44 will allow the data processing to proceed normally. Otherwise, if it is detected that the data handling is unauthorized, then in a blocking step 66, the processor 44 interrupts the process by forcing the writing of a dummy value "0" to the SCL and/or SDA lines of the I 2 C bus 32. This data is disposed of.

透過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 secured system 70 in an alternative embodiment of the present invention. As shown in FIG. 3 , system 70 includes host device 74 , peripheral device 78 , and security device 86 , all connected to SPI bus 82 .

在主機裝置74未經授權的嘗試存取周邊裝置78時,安全裝置86會識別並阻斷此數據處置。在本發明的實施例中,安全裝置86包含介面90,其連接於SPI匯流排82;處理器94,其被設置為執行本發明的技術;記憶體98,其被設置為儲存一個或多個由處理器94所實行的安全策略。 When the host device 74 attempts to access the peripheral device 78 without authorization, the security device 86 will identify and block this data processing. In an embodiment of the present invention, security device 86 includes interface 90, which is connected to SPI bus 82; processor 94, which is configured to perform the techniques of the present invention; memory 98, which is configured to store one or more Security policy enforced by processor 94.

用於區分授權和未經授權之數據處置的安全策略,以及安全裝置86的處理器94識別未經授權的數據處置的方式,基本與上述系統20所描述的相似。以下描述之技術與上述技術之不同點在於,安全裝置86在匯流排82上強制寫入虛擬值以阻斷未經授權的數據處置。 The security policy for distinguishing between authorized and unauthorized data handling, and the manner in which processor 94 of security device 86 identifies unauthorized data handling, is substantially similar to that described for system 20 above. The technique described below differs from the technique described above in that the security device 86 forces the writing of dummy values on the bus 82 to block unauthorized handling of the data.

SPI匯流排82包含時脈(CLK)線、及被稱為主輸出從輸入(MOSI)和主輸入從輸出(MISO)的兩條數據傳輸線。CLK線、MISO線和MOSI線對於所有裝置(在本實施例中為裝置74、78和86)是共用的。此外,每個從屬裝置可透過專用的晶片選擇線來選擇。在本實施例中,主機裝置74使用標記為CS2#的CS線來選擇周邊裝置78,並且使用標記為CS1#的CS線來選擇安全裝置86。 The SPI bus 82 includes a clock (CLK) line, and two data transmission lines called master-out-slave-in (MOSI) and master-in-slave-out (MISO). The CLK, MISO, and MOSI lines are common to all devices (in this embodiment, devices 74, 78, and 86). In addition, each slave device can be selected through a dedicated chip select line. In this embodiment, host device 74 uses the CS line labeled CS2# to select peripheral device 78 and uses the CS line labeled CS1# to select secure device 86 .

作為主控裝置的主機裝置74係連接到所有CS線。另一方面,由於周邊裝置78是從屬裝置,因此每個周邊裝置78僅連接到其自己的CS線。通常,主機裝置74通過使用相應的CS線選擇期望的周邊裝置78來啟動數據處置,然後使用CLK、MOSI和MISO線與裝置進行通訊。MOSI線用於從主機裝置74向周邊裝置78發送訊號,MISO線則用於從周邊裝置78發送訊號至主機裝置74。 A host device 74 as the master device is connected to all CS lines. On the other hand, since the peripheral devices 78 are slave devices, each peripheral device 78 is only connected to its own CS line. Typically, the host device 74 initiates data handling by selecting the desired peripheral device 78 using the corresponding CS line, and then communicates with the device using the CLK, MOSI, and MISO lines. The MOSI line is used to send signals from the host device 74 to the peripheral device 78 , and the MISO line is used to send signals from the peripheral device 78 to the host device 74 .

安全裝置86與常規SIP從屬裝置不同,其被定義為從屬裝置但能驅動所有CS線。如第3圖所示,安全裝置86的介面90被配置為與主機裝置74並行地驅動CS2#線。當系統70包含多個具有相對應CS線之周邊裝置78時,安全裝置86通常被設置為可平行地驅動任何連結至主機裝置74的CS線。 The watchdog 86 differs from a conventional SIP slave in that it is defined as a slave but can drive all CS lines. As shown in FIG. 3 , the interface 90 of the security device 86 is configured to drive the CS2# line in parallel with the host device 74 . When the system 70 includes multiple peripheral devices 78 with corresponding CS lines, the safety device 86 is typically configured to drive any CS lines connected to the host device 74 in parallel.

在一些實施例中,系統70被設計為當主機裝置74與安全裝置86以相反邏輯值驅動CS線時,安全裝置86所驅動的邏輯值將覆寫主機裝置74所驅 動的邏輯值。也可以說,當主機裝置74與安全裝置86在CS線上驅動相反的邏輯值時,周邊裝置78會收到並執行由安全裝置86所驅動的邏輯值。 In some embodiments, system 70 is designed so that when host device 74 and watchdog 86 drive the CS line with opposite logic values, the logic value driven by watchdog 86 overrides the logic value driven by host device 74. Active logical value. It can also be said that when the host device 74 and the watchdog 86 drive opposite logic values on the CS line, the peripheral device 78 will receive and execute the logic value driven by the watchdog 86 .

覆寫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 peripheral device 78 . The overriding mechanism described above can be implemented in various ways. The following description refers to the CS2# line for selecting a peripheral 78, but the same mechanism should be used when multiple peripherals 78 and corresponding CS lines are used.

在一個實施例中,安全裝置86透過介面90驅動CS2#線的線驅動器比主機裝置74驅動CS2#線的線驅動器要強。在一個替代的實施例中,串聯電阻100可以在主機裝置74的輸出處插入CS2#線中。相對於安全裝置86對CS2#的線驅動器的輸出,串聯電阻100會減弱主機裝置74對CS2#線的線驅動器的輸出。另外,安全裝置86可以被設置為以其他任何合適的方式覆蓋主機裝置74驅動CS2#線的訊號。 In one embodiment, the secure device 86 drives the CS2# line driver through the interface 90 stronger than the host device 74 drives the CS2# line driver. In an alternate embodiment, the series resistor 100 may be inserted into the CS2# line at the output of the host device 74 . Series resistor 100 attenuates the output of host device 74's line driver for CS2# line relative to the output of watchdog 86 for the CS2# line driver. Additionally, the safety device 86 may be configured to override the signal of the host device 74 driving the CS2# line in any other suitable manner.

安全裝置86的處理器94可以透過監控SPI匯流排82的CS線、CLK線、MISO線及/或MOSI線,並以任何合適的方式識別未經授權的數據處置。在一些實施例中,在辨識出主機裝置74未授權地嘗試存取某個周邊裝置78的數據處置時,安全裝置86的處理器94透過設定周邊裝置78的CS線失效(de-assert)來中斷數據處置。由於安全裝置86被設置為在覆寫主機裝置74對CS2#線的驅動,所以周邊裝置78將被取消選擇,且數據處置中斷。另一方面,當確定數據處置以被授權時,處理器94將停止自己的CS2#線驅動器,從而使主機不被中斷的存取周邊裝置78。 Processor 94 of security device 86 may identify unauthorized data handling in any suitable manner by monitoring the CS, CLK, MISO, and/or MOSI lines of SPI bus 82 . In some embodiments, the processor 94 of the security device 86 de-asserts the CS line of the peripheral device 78 when it recognizes that the host device 74 has attempted to access the data processing of a peripheral device 78 without authorization. Interrupt data processing. Since the safety device 86 is set to override the drive of the CS2# line by the host device 74, the peripheral device 78 will be deselected and data processing is interrupted. On the other hand, when it is determined that the data handling is authorized, the processor 94 will stop its own CS2# line driver, so that the host computer can access the peripheral device 78 without being interrupted.

第4圖為本發明另一個實施例中安全系統110之方塊示意圖。系統110同樣是基於SPI匯流排82,與第3圖的系統70相似。然而,在系統110中,安全裝置86通過在CLK線、MISO線及/或MOSI線上強制寫入虛擬值來破壞未經授權的數據處置,而不是覆寫CS線。 FIG. 4 is a schematic block diagram of a security system 110 in another embodiment of the present invention. System 110 is also based on SPI bus 82 , similar to system 70 of FIG. 3 . In system 110, however, security device 86 defeats unauthorized data handling by forcing the writing of dummy values on the CLK, MISO, and/or MOSI lines, rather than overwriting the CS line.

在本示例中,系統110係用以使得安全裝置86覆寫主機裝置74對CLK線、MISO線及/或MOSI線的驅動。如圖所示,為達到此目的,串聯電阻100係插置在CLK線、MISO線以及MOSI中。由於CS2#線在此例中沒有被覆蓋,所以不須插置串聯電阻。 In this example, system 110 is used to cause watchdog device 86 to override the driving of CLK line, MISO line, and/or MOSI line by host device 74 . As shown, for this purpose, a series resistor 100 is inserted in the CLK line, MISO line and MOSI. Since the CS2# line is not covered in this example, there is no need to insert a series resistor.

在其他實施例,覆寫機制可用使安全裝置86之CLK線、MISO線及/或MOSI線的線驅動器比主機裝置74之線驅動器更強來實現。 In other embodiments, the overriding mechanism may be implemented by making the line drivers of the watchdog 86 CLK lines, MISO lines, and/or MOSI lines stronger than the line drivers of the host device 74 .

在其他實施例中,同時使用覆寫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 security device 86 before being sent to peripheral devices. Instead, shared signals are routed to peripheral devices via conventional routes and do not pass through security devices. This connection mechanism enables the safety device to effectively protect the safety of peripheral devices. It will be described in detail below.

第5圖係根據本發明的再一實施例之系統130之示意方塊圖。受安全保護之系統130與第3圖之系統70相似。然而,在此實施例,CS2#訊號不受周邊裝置78之輸入端直接驅動。取而代之,來自主機裝置74之CS2#線係輸入至安全裝置86,而由安全裝置86驅動CS2_O#訊號輸入至周邊裝置78。 FIG. 5 is a schematic block diagram of a system 130 according to yet another embodiment of the present invention. The secured system 130 is similar to the system 70 of FIG. 3 . However, in this embodiment, the CS2# signal is not directly driven by the input of the peripheral device 78 . Instead, the CS2# line from the host device 74 is input to the safety device 86 , and the safety device 86 drives the CS2_O# signal to the peripheral device 78 .

在此實施例中,訊號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 host device 74 and the peripheral device 78 are not blocked.

安全裝置86藉由選擇性讓CS2#訊號達到至周邊裝置、或是阻止CS2#訊號傳送至周邊裝置,以阻斷主機裝置74以及周邊裝置78之間的數據處置。在第5圖之例子中,藉由設定控制訊號MASK_CS2#有效(assert)或是失效(de-assert),以執行上述選擇。 The security device 86 blocks data processing between the host device 74 and the peripheral device 78 by selectively allowing the CS2# signal to reach the peripheral device, or preventing the CS2# signal from being transmitted to the peripheral device. In the example in FIG. 5, the above selection is performed by setting the control signal MASK_CS2# to be valid (assert) or invalid (de-assert).

第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 security device 86 of the system 130 shown in FIG. 5 in accordance with one embodiment of the present invention. In this example, the security device 86 includes an interface 90 , a processor 94 and a memory 98 . The interface 90 is connected to the SPI bus 82 . Processor 94 performs the techniques disclosed herein. Memory 98 stores one or more security policies implemented by processor 94 . The processor 94 includes a slave interface logic circuit 91 and an interface monitoring logic circuit (IML) 92 . The slave interface logic 91 handles communications between the security device 86 and the host device 74 . Interface monitoring logic 92 monitors, controls and selectively overrides host device 74 access to peripheral device 78 .

在一實施例中,安全裝置86辨識以及阻斷在SPI匯流排82上主機嘗試對周邊裝置78的未經授權之數據處置。從第5圖及第6圖可瞭解的是,第3圖所示之系統之任何安全特徵亦可實現在第5圖之系統。 In one embodiment, the security device 86 identifies and blocks attempts by the host on the SPI bus 82 to attempt unauthorized data manipulation of the peripheral device 78 . As can be appreciated from Figures 5 and 6, any of the security features of the system shown in Figure 3 can also be implemented in the system of Figure 5.

在一些實施例中,安全裝置86之處理器94之從屬介面邏輯電路92包含一組暫存器或其他適合數據結構,其用以定義已經授權的數據處置以及未經授權的數據處置。例如,當周邊裝置78為SPI快閃記憶體裝置,上述定義可載明視為已經授權的指令以及相關位址範圍。根據定義之分類,安全裝置86讓符合規定之指令以及對應位址範圍的數據處置通過,並阻斷不符合定義的數據處置。在一實施例中,一些指令並不強制有位址範圍的規範,例如抹除指令,其不規定位址。 In some embodiments, the slave interface logic 92 of the processor 94 of the security device 86 includes a set of registers or other suitable data structures for defining authorized data handling and unauthorized data handling. For example, when the peripheral device 78 is an SPI flash memory device, the above-mentioned definition may specify the commands deemed to be authorized and the related address ranges. According to the defined classification, the security device 86 allows the processing of data conforming to the specified instruction and the corresponding address range, and blocks the processing of data not conforming to the definition. In one embodiment, some commands do not enforce address range specification, such as the erase command, which does not specify an address.

除了阻斷數據處置,介面監控邏輯電路92可發出警訊至較高軟體層,或是啟動其他任何適合回應措施,例如,重置系統或是重置系統之一部分、接管快閃記憶體裝置之控制、以及從另一位置恢復黃金映像檔(golden image),或是甚至永久停止系統並防止以後的任何開機動作。 In addition to blocking data processing, the interface monitoring logic 92 can send an alert to a higher software layer, or initiate any other suitable response, such as resetting the system or resetting a part of the system, taking over the flash memory device Take control and restore the golden image from another location, or even permanently halt the system and prevent any future boot actions.

在一些實施例中,已經授權數據處置以及未經授權數據處置之規範會遵循一”白名單”邏輯,例如,安全裝置86只讓明確規定在介面監控邏輯電路92中的已經授權數據處置通過,並拒絕以及阻斷未明確規定的數據處置。 In some embodiments, the specification of authorized data processing and unauthorized data processing will follow a "white list" logic, for example, the security device 86 only allows authorized data processing that is clearly specified in the interface monitoring logic circuit 92 to pass through, And refuse and block the processing of data that is not clearly stipulated.

在上述實施例,安全裝置係連接至匯流排以及作為一額外從屬裝置。然而,在其他的實施例中,安全裝置可連接作為一主控元件。例如,此實現方式適用於支援多主控裝置(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 security device 86 may respond to the selected host's data handling instead of the peripheral device 78 . The following description mainly refers to the configurations in Fig. 5 and Fig. 6 for exemplary description. In general, the technology of the present invention is not limited to a specific system configuration, and can also be applied to any other configuration, such as the configuration shown in FIG. 3 or FIG. 4 .

在第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 monitoring logic circuit 92 detects the form of a read command in a certain address area in the address space of the peripheral device 78. A "high level signal" can be imposed on CS2_O# and serve a host read command (or part of a read command) from the internal memory 98 of the security device. The host device 74 is generally unaware that the response is not from a peripheral device. In some embodiments, this scenario also applies to the system 110 of FIG. 4, for example, a security device may overwrite the MISO signal.

在此機制之另一例子,系統之周邊裝置78包含一SPI快閃記憶體裝置,安全裝置86用以覆寫快閃記憶體位址空間之一部分,藉此仿真(emulate)一受保護的快閃記憶體之位址區。例如,安全裝置86可包含一信任平台模組 (TPM),其使用IML 92覆寫儲存初始主機啟動代碼(其為主機開機時第一個提取(fetch)的開機指令)的快閃記憶體位址區。信任平台模組可用獨有且經過驗證之初始啟動代碼來覆寫此快閃記憶體位址區,例如此獨有且經過驗證之初始啟動代碼可在系統跳至執行之前驗證其餘程式碼。 In another example of this mechanism, the peripheral device 78 of the system includes an SPI flash memory device, and the security device 86 is used to overwrite a portion of the flash memory address space, thereby emulating a protected flash memory device. The address area of the memory. For example, security device 86 may include a trusted platform module (TPM), which uses the IML 92 to overwrite the address area of the flash memory that stores the initial host boot code (which is the first boot command fetched when the host is powered on). The trusted platform module can overwrite this flash memory address area with unique and authenticated initial boot code, such as this unique and authenticated initial boot code, which can verify the rest of the code before the system jumps to execution.

在一些實施例中,安全裝置86更包含一用於SPI快閃記憶體裝置的主控介面。除此之外,安全裝置86可包含一適當的介面以及電路,用以當存取SPI快閃記憶體裝置時將主機裝置74保持在重置狀態,其可作為系統開機程序之一部份。例如,安全裝置86可為一嵌入控制器(embedded controller,EC)、一超級輸入輸出(super I/O,SIO)裝置或是一基板管理控制器(baseboard management controller,BMC)裝置。 In some embodiments, the security device 86 further includes a host interface for the SPI flash memory device. Additionally, security device 86 may include an appropriate interface and circuitry to hold host device 74 in reset while accessing the SPI flash memory device, which may be part of the system boot process. For example, the security device 86 can be an embedded controller (EC), a super I/O (SIO) device or a baseboard management controller (BMC) device.

第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-reset step 100a, the security device 86 holds the host device 74 in a reset state, and boots up, for example, from SPI flash memory (peripheral device 78) Start booting. In an initial load step 104 (this is an optional step), the security device 86 loads a data segment from the SPI flash memory, verifies the authenticity of the data segment, and stores it in the memory 98 .

在一覆寫步驟108,安全裝置86設置介面監控邏輯電路92以覆寫對SPI快閃記憶體(例如,本發明的周邊裝置78)之至少一預先定義位址區的存取。此位址區可包含,例如一個或多個金鑰、主機裝置74之組態數據(configuration data)及/或初始開機數據段(initial boot block)。 In an override step 108, the security device 86 configures the interface monitoring logic 92 to override access to at least one predefined address area of the SPI flash memory (eg, the peripheral device 78 of the present invention). The address field may include, for example, one or more keys, configuration data for the host device 74, and/or an initial boot block.

在一重置解除步驟112,安全裝置86將主機從重置狀態解除。因此,在一開機步驟116,主機裝置74開始開機程序。在一區域存取子步驟120中,由安全裝置86從內部記憶體98服務開機程序之一部份對此預先定義位址區的存取。 In a reset release step 112, the security device 86 releases the host from the reset state. Therefore, in a booting step 116, the host device 74 starts a booting procedure. In a region access sub-step 120, access to this predefined address region is serviced by the secure device 86 from the internal memory 98 as part of the boot process.

在此方式中,敏感資訊例如金鑰、組態數據及/或初始啟動代碼可由安全裝置安全地提供。主機裝置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 host device 74 is unaware that this information is provided by the secure device and not the SPI flash.

第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, secure device 36 of FIG. 1 ) is used to overlap some addresses of another peripheral device slave (eg, secure device 28 of FIG. 1 ). space. For example, the security device may reply with the same data that another peripheral device expects. If the safety device detects that the data does not match, for example, the safety device tries to pull up to "1" but detects that the SDA line is still "0", the safety device can initiate response measures, for example, causing a stop condition, Drive a signal "0" on one or more data lines to set an infinite clock stretch or any other suitable action. This technique can use conventional I 2 C slave devices to monitor the data level of the device without changing the physical layer hardware.

在又一實施例,安全裝置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 secure device 86 holds a signature or digest of a certain code portion stored in SPI flash memory. The security device monitors host device 74 access to the SPI flash memory and computes a signature or hash value for this code portion in the background. If an incorrect signature, incorrect hash value, or incorrect SPI fetch sequence is detected, the security device 86 can initiate appropriate response measures.

在又一實施例,安全裝置可在匯流排上監控一個以上的周邊裝置78,並驗證對不同裝置的存取命令是否與預期相同。 In yet another embodiment, the security device may monitor more than one peripheral device 78 on the bus and verify that access commands to the different devices are as expected.

在又一實施例,當偵測到對周邊裝置78進行的數據處置已經授權時,安全裝置86可使用一個或多個CS之外的訊號,以限制對周邊裝置78的存取,或是實施某一系統狀態。以下描述上述訊號的類型或用途,但其僅為舉例而非為限制本發明。 In yet another embodiment, the security device 86 may use one or more signals other than CS to restrict access to the peripheral device 78, or implement a system state. The types or uses of the above signals are described below, but they are only examples and not limiting the present invention.

(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 secured system 132 according to another embodiment of the present invention. The system 132 in FIG. 8 is similar to the system 130 in FIG. 5, except that the system 132 in FIG. 8 additionally has an AND gate 134 and a control signal MASK_LOW_CS2. In FIG. 8, peripheral device 78 is an SPI flash memory device. As illustrated in FIG. 5, the security device 86 blocks data processing between the host device 74 and the peripheral device 78 by selectively allowing the CS2# signal to reach the peripheral device or preventing the CS2# signal from reaching the peripheral device. In Fig. 5, the selection action is performed by setting the control signal MASK_CS2# to be valid or invalid.

在一實施例中,周邊裝置78係為一SPI快閃記憶體裝置。在本實施例中,將快閃記憶體裝置CS訊號(圖中所示之CS2_O#)設定成”低位準”,表示選擇快閃記憶體裝置;反之,將CS訊號設定成”高位準”,表示不選擇此快閃記憶體裝置。 In one embodiment, peripheral device 78 is an SPI flash memory device. In this embodiment, the flash memory device CS signal (CS2_O# shown in the figure) is set to "low level", indicating that the flash memory device is selected; otherwise, the CS signal is set to "high level", Indicates that this flash memory device is not selected.

第5圖所示之範例中,安全裝置86藉由在數據處置結束之前設定MASK_CS2#訊號為高位準,以阻斷主機裝置74以及快閃記憶體78之間的數據處 置。此操作係在數據處置結束之前將快閃記憶體裝置之CS訊號設定成”高位準”,而不選擇此快閃記憶體裝置。 In the example shown in FIG. 5, the security device 86 blocks data transactions between the host device 74 and the flash memory 78 by setting the MASK_CS2# signal to a high level before the data transaction is completed. place. This operation is to set the CS signal of the flash memory device to "high level" before the end of data processing, and not select the flash memory device.

然而,在一些情況,上述技術可能無法阻斷一些未經授權的數據處置。例如,當一已經授權的數據處置與一未經授權的數據處置的差別只有最後一個位元。例如,在一實施例中,指令操作碼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, security device 86 may set MASK_LOW_CS2 to a "low" level. This operation can extend the duration of the CS signal of the flash memory device 78 beyond the actual end time of this data transaction. Thus, flash memory device 78 may detect that a data transaction is longer than expected by one or more clock cycles and prevent the data transaction from being performed.

當使用第8圖所示之技術時,安全裝置86可延長CS訊號之持續時間至任何適當長度,例如,延長一個時脈週期、幾個時脈週期、或是無限個時脈週期,例如直到下一次重置或是上電。 When using the technique shown in FIG. 8, the safety device 86 can extend the duration of the CS signal to any suitable length, e.g., by one clock cycle, several clock cycles, or an infinite number of clock cycles, e.g., until Next reset or power on.

在第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 secure device 86 is enabled to communicate with the host device 74 over the SPI bus 82 by selecting the secure device 86 using the CS1# signal. In other embodiments, it is not mandatory for the security device to have an individual CS signal. The security device may communicate directly or indirectly with the host device using any other suitable interface. In some embodiments, there may be no interface between the host device and the security device as long as the security device can monitor the SPI data handling and secure the bus without the interface.

使用數據處置組計數器監控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 processor 94 of the security device 86 registers one or more groups of SPI transactions and keeps a running count of the number of SPI transactions in each group. Each SPI data handling group may contain one or more SPI data handling that meet some predefined criteria.

在一示例中,一數據處置群組可包含多種類型的讀取數據處置,而另一數據處置群組可包含多種類型的寫入數據處置。在另一範例,一數據處置可包含多種類型的已經授權數據處置,而另一數據處置群組可包含多種類型的未經授權數據處置。此外,可使用其他任何適當的數據處置分類。處理器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. Processor 94 may define any suitable number of groups. This group does not have to contain all possible data disposition types. This category can be user-defined.

在一實施例中,安全裝置86包含多個由硬體實現或由軟體實現的計數器,其為本發明之數據處置組計數器(transaction-group counter)。處理器94分別分配一計數器給每一數據處置群組。處理器94之軟體可重置一既定計數器,例如,當系統重置或是上電後重置、讀取計數器之後重置、計數器達到某一門檻值之後重置、或是符合其他任何適當條件或是事件後重置。 In one embodiment, the security device 86 includes a plurality of hardware-implemented or software-implemented counters, which are transaction-group counters of the present invention. The processor 94 assigns a counter to each data handling group respectively. The software of processor 94 may reset a given counter, for example, when the system is reset or reset after power-on, reset after reading the counter, reset after the counter reaches a certain threshold value, or meet any other suitable condition Or reset after the event.

一般而言,某一數據處置類型可出現在一個以上數據處置群組,其表示一個數據處置可能會讓多個計數器增加計數。例如,考量一實施例,包含一具有所有寫入數據處置類型之第一群組、一具有所有讀取數據處置類型之第二群組、以及一具有所有未經授權數據處置之第三群組。然而,在此例中,寫入數據處置之一些類型已經授權而其他類型未經授權。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 processor 94 increments the first counter and the third counter in response to identifying an unauthorized write data transaction. Also, any other count group can omit unauthorized data handling.

在正常操作期間,處理器94持續增加計數器。因此,在一個給定的時間點,每一數據處置組計數器可表示在此既定時間中屬於其群組之SPI數據處置的發生數量。安全裝置86或其他裝置可使用此資訊來判斷主機裝置74之操作狀況,以偵測主機裝置74之可能為安全威脅的反常行為,或是使用此資訊於其他任何適當用途。在一些實施例中,如果計數器數值表現出主機裝置74之可疑行為特徵,例如寫入或是抹除數據處置之數量出乎預料的高,處理器94可發出一警訊或是觸發另一些回應措施。 During normal operation, processor 94 continues to increment the counter. Therefore, at a given point in time, each data handling group counter can represent the number of occurrences of SPI data handling belonging to its group at that given time. Security device 86 or other devices may use this information to determine the operating condition of host device 74, to detect anomalous behavior of host device 74 that may be a security threat, or for any other suitable purpose. In some embodiments, processor 94 may issue an alert or trigger some other response if the counter value is characteristic of suspicious behavior of host device 74, such as an unexpectedly high number of write or erase data transactions measure.

第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 step 140, the processor 94 divides multiple types of SPI data handling areas into at least two groups, and assigns individual data handling group counters to at least one of the groups.

在數據處置辨識步驟144,處理器94辨識在SPI匯流排上主機裝置74以及SPI快閃記憶體78之間的SPI數據處置。在分類步驟148,處理器94辨識數據處置屬於哪一個SPI數據處置群組。 In a data handling identification step 144 , the processor 94 identifies the SPI data handling between the host device 74 and the SPI flash memory 78 on the SPI bus. In a classification step 148, the processor 94 identifies which SPI data handling group the data handling belongs to.

在檢查授權步驟152,處理器94檢查是否所辨識的SPI數據處置已經授權。如果已經授權,則進行數據處置接受步驟156,處理器94允許數據處置執行完成。如果未經授權,則進行數據處置阻斷步驟160,處理器94阻斷數據處置。 In a check authorization step 152, the processor 94 checks whether the identified SPI data handling is authorized. If authorized, a data handling acceptance step 156 is performed and the processor 94 allows the data handling execution to complete. If not authorized, a data handling blocking step 160 is performed in which the processor 94 blocks data handling.

在增加計數步驟164,處理器94增加在步驟148辨識出的群組所對應的數據處置組計數器。接著,此方法返回步驟144,處理器94繼續監控SPI匯流排82後續的數據處置。 In increment count step 164 , processor 94 increments the data handling group counter corresponding to the group identified in step 148 . Then, the method returns to step 144 where the processor 94 continues to monitor the SPI bus 82 for subsequent data processing.

第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, processor 94 need not block unauthorized data handling, but processor 94 may initiate appropriate response measures, such as triggering an alert or entering an alert mode. another fan For example, the use of the data disposal group counter mechanism does not necessarily require checking for unauthorized data disposal, eg, without determining whether any data disposal is unauthorized.

在安全裝置支援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 flash memory device 78 supports a dedicated mode of operation. Respond to dedicated SPI commands from the host device, such as mode-entry transaction or mode-exit transaction, to enter dedicated mode or leave dedicated mode. Some SPI data transactions may have different formats or interpretations depending on whether the SPI flash memory device is in dedicated mode or not. In some embodiments, the processor 94 of the secure device 86 is aware of and supports a dedicated mode of the SPI flash memory 78 .

例如,專用模式可為一”連續讀取”模式,其也稱為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, processor 94 of secure device 86 may support any other suitable special-purpose modes.

在一些實施例中,處理器94可藉由以下方式支援某一專用模式:(i)辨識出主機裝置74(在SPI匯流排82上)指示快閃記憶體裝置78進入此專用模式之SPI數據處置,以進入專用模式;(ii)藉由辨識主機裝置74指示快閃記憶體裝置78離開專用模式之SPI數據處置,以從專用模式離開;(iii)依據快閃記憶體裝置是否在專用模式下操作,以符合安全裝置操作。 In some embodiments, processor 94 may support a specific mode by (i) recognizing SPI data from host device 74 (on SPI bus 82) that instructs flash memory device 78 to enter the specific mode Handling to enter dedicated mode; (ii) disposing of SPI data by identifying host device 74 instructing flash memory device 78 to leave dedicated mode to leave from dedicated mode; (iii) depending on whether the flash memory device is in dedicated mode Operate below to comply with safety device operation.

在一些實施例中,根據對進入專用模式之辨識,處理器94可實現此專用模式之實際邏輯,其與在快閃記憶體裝置78實現之邏輯相似。在此些實施例,在此專用模式下處理器94繼續監控SPI數據處置,並將此數據處置解釋與此模式定義相適配(adapt)。例如,在“連續讀取”模式,處理器94假設所省略的 讀取指令操作碼與前一個讀取指令操作碼相同,並從此數據處置的起始位置(CS#訊號變成低位準的第一週期開始)便監控/分析位址位元。換句話說,當該記憶體裝置操作在該既定運作模式時,該處理器對一個或多個數據處置給予一第一解釋(first interpretation),以及當該記憶體裝置不是操作在該既定運作模式時,該處理器對該一個或多個數據處置給予一不同的第二解釋(second interpretation)。 In some embodiments, upon recognition of entry into a special-purpose mode, processor 94 may implement the actual logic for this special-purpose mode, which is similar to the logic implemented in flash memory device 78 . In these embodiments, processor 94 continues to monitor SPI data handling in the dedicated mode and adapts the data handling interpretation to the mode definition. For example, in "sequential read" mode, processor 94 assumes that the omitted The read instruction opcode is the same as the previous read instruction opcode, and the address bits are monitored/analyzed from the start position of the data processing (the first cycle when the CS# signal goes low). In other words, 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 predetermined mode of operation , the processor gives a different second interpretation to the one or more data manipulations.

在其他的實施例中,依照對進入專用模式之辨識,處理器94中止對SPI數據處置之監控直到離開此專用模式。因為處理器94只被要求辨識進入專用模式以及離開專用模式,而不須實現整個專用模式之操作邏輯,上述方式更容易實現。此方式係適用於只預期有已經授權數據處置(因此數據處置不會阻斷)之專用模式。例如,在一實施例,安全裝置86只被要求防範未經授權之寫入數據處置,因此當進入”連續讀取(continuous read)”模式時可以中止(suspend)對數據處置監控。 In other embodiments, upon recognition of entering the dedicated mode, processor 94 suspends monitoring of SPI data handling until leaving the dedicated mode. This is easier to implement because the processor 94 is only required to recognize entering and leaving the dedicated mode without having to implement the entire dedicated mode operation logic. This approach is suitable for dedicated modes where only authorized data processing is expected (so data processing is not blocked). For example, in one embodiment, the security device 86 is only required to guard against unauthorized write data handling, so data handling monitoring can be suspended when entering "continuous read" 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, processor 94 of security device 86 may obtain the SFDP from flash memory device 78 before host device 74 communicates with the flash memory device for the first time. Processor 94 Then modify the SFDP and present (expose) this modified SFDP to the host device 74. For the sake of clarity, the following is mainly described in terms of SFDP, but the present invention is applicable to any other type of data processing that queries the capabilities of memory devices.

在一些實施例中,修改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, processor 94 may add one or more capabilities to the SFDP that are not supported by flash memory device 78 . When a modified SFDP is proposed, the host device 74 may attempt to use added capabilities not supported by the flash memory device. Typically, processor 94 can recognize such an attempt when monitoring SPI data transactions on SPI bus 82, and security device 86 can implement this capability in place of a flash memory device. For example, the above-mentioned added capability may support replay-protected monotonic counter (RPMC), which has been disclosed in US Patent Application No. 16/503,501, titled "RPMC Flash Emulation", which discloses The contents are incorporated herein by reference. In addition, any other suitable capabilities may also be added to this 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 host device 74, when modifying the SFDP, the processor 94 may omit one or more capabilities in the SFDP that the flash memory device 78 can support. For example, processor 94 may hide support for modes such as dual data rate (DDR) capability, quick path interconnect (QPI) capability, sequential read (XIP) capability, or any other suitable capability. In some cases, it may be useful to hide the capabilities that the flash memory device 78 can support, for example, to simplify the implementation of the security device 86 . When a capability is hidden from the host device, the security device is not required to support this capability, but is still generally required to identify the relevant SPI data transaction, and if it is present on the bus, the security device will block it. SPI data handling.

在各種實施例中,處理器94可在不同時期從快閃記憶體裝置78取得實際SFDP。例如,在系統整合或是測試期間,安全裝置86之非揮發性記憶體可預編程有快閃記憶體裝置78之實際SFDP。在另一範例,在主機裝置存取裝置之前,處理器94可在上電時序期間(power-up sequence),從快閃記憶體裝置78取得此SFDP。 In various embodiments, processor 94 may retrieve the actual SFDP from flash memory device 78 at different times. For example, the non-volatile memory of security device 86 may be pre-programmed with the actual SFDP of flash memory device 78 during system integration or testing. In another example, processor 94 may obtain the SFDP from flash memory device 78 during a power-up sequence before the host device accesses the device.

隨後,當主機裝置74發出一SFDP讀取數據處置,處理器94辨識此指令操作碼,則阻斷此數據處置,例如,將第5圖或是第8圖之CS2_O#訊號設定成”高位準”,接著在匯流排82之MISO線上供應修改過的SFDP給主機裝置74,藉此完成此數據處置。主機裝置沒有辦法偵測出此SFDP是由安全裝置提供而非快閃記憶體裝置。 Subsequently, when the host device 74 sends an SFDP read data processing, the processor 94 recognizes the command operation code, then blocks the data processing, for example, the CS2_O# signal in the 5th or 8th figure is set to "high level" ”, and then supply the modified SFDP to the host device 74 on the MISO line of the bus 82, thereby completing the data processing. There is no way for the host device to detect that the SFDP is provided by the security device and not the flash memory device.

藉由安全裝置安全調解寫入/抹除數據處置 Write/erase data processing through safe mediation of security devices

在一些實施例中,安全裝置86不僅監控在SPI匯流排上的數據處置,也會調解(mediate)主機裝置以及快閃記憶體裝置。在此些實施例,安全裝置86從主機裝置78接收所選的SPI指令,例如寫入指令或抹除指令,並驗證此指令已經授權。只有當此數據處置已經授權,安全裝置86才會讓此數據處置完成,例如,代表主機裝置74在快閃記憶體裝置78中執行此指令。 In some embodiments, the security device 86 not only monitors data transactions on the SPI bus, but also mediates the host device and the flash memory device. In these embodiments, security device 86 receives a selected SPI command, such as a write command or an erase command, from host device 78 and verifies that the command has been authorized. Security device 86 will allow the data processing to complete only if the data processing has been authorized, eg, executing the command in flash memory device 78 on behalf of host device 74 .

通常,安全裝置86之驗證處理包含評估(evaluate)待寫入快閃記憶體裝置之數據。在一些實施例中,此評估包含加密操作,例如驗證此數據之簽章(signature)。此類驗證工作通常要求相當多計算量,並比較不適用於即時動態驗證(以及可能之後的阻斷)在匯流排上的數據處置。 Typically, the verification process of the secure device 86 includes evaluating data to be written to the flash memory device. In some embodiments, this evaluation includes cryptographic operations, such as verifying the signature of the data. Such verification work is usually quite computationally intensive and less suitable for immediate dynamic verification (and possibly subsequent blocking) of data handling on the bus.

第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 monitoring step 170, the processor 94 of the security device 86 monitors the transaction of data on the SPI bus.

在一辨識步驟174,處理器94辨識主機裝置74要求對快閃記憶體裝置之寫入數據處置。在一阻擋步驟178,處理器94阻擋所要求之寫入數據處置在快閃記憶體裝置中執行。在一取得步驟182,在主機裝置以及安全裝置之間的SPI匯流排上或是其他任何適當介面上,處理器94從主機裝置74取得此寫入數據處置之指令以及數據。 In an identification step 174, the processor 94 identifies that the host device 74 requires a write data transaction to the flash memory device. In a blocking step 178, processor 94 blocks the required write data processing from being performed in the flash memory device. In a fetch step 182, the processor 94 retrieves the write data handling instructions and data from the host device 74 over the SPI bus or any other suitable interface between the host device and the secure device.

在一評估步驟186,處理器94評估此寫入數據處置。如上所述,此評估可包含對待寫入之數據進行加密操作或其他操作。在一步驟190,如果此驗證成功,例如,寫入數據處置已經授權,則在一步驟194,處理器在快閃記憶體裝置78中代表主機裝置74執行此寫入數據處置。如果此驗證未成功,例如,驗證失敗,則不執行此寫入數據處置,而流程返回到步驟170。 In an evaluation step 186, processor 94 evaluates the write data disposition. As noted above, this evaluation may include cryptographic or other operations on the data to be written. In a step 190, if the verification is successful, eg, the write data transaction has been authorized, then in a step 194, the processor performs the write data transaction in the flash memory device 78 on behalf of the host device 74. If this verification is not successful, eg, verification fails, then this write data handling is not performed, and the flow returns to step 170 .

第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, processor 94 may sequentially identify multiple write data transactions for writing large amounts of data to memory. The processor can block such data transactions (if they point to flash memory), fetch the whole data (data of a sequence of multiple data transactions) from the host device, and evaluate the whole data. Only when all the data has been authorized, the processor 94 writes the data into the flash memory device.

在本發明中,用語”寫入數據處置”意指多種類型之數據處置,例如,編寫快閃記憶體(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 watchdog 86 should be able to initiate SPI data transactions on the bus 82 . A suitable interface (bus 82 or other bus) should be provided between the security device and the host device. The host device should refrain from transmitting data transactions on the SPI bus when the security device controls the bus.

為清楚描述概念起見,第1、3-6以及8圖所示之系統20、70、110、130以及132之組態與多個系統元件例如安全裝置36與86、匯流排32與82之組態係僅為組態範例,而本發明不受其限制。在其他實施例,組態使用其他任何適當組態。 The configurations of systems 20, 70, 110, 130, and 132 shown in FIGS. The configurations are merely configuration examples, and the present invention is not limited thereto. In other embodiments, the configuration uses any other suitable configuration.

例如,為清楚起見,圖中僅顯示單一周邊裝置以及單一主機裝置。在一些實施例中,安全系統可包含至少二周邊裝置及/或至少二主機裝置。此外,本發明之實施例所以描述的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 systems 20, 70, 110, 130, and 132 may be implemented in any suitable hardware, such as using an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). In some embodiments, some components of security devices 32 and 86, such as processor 44 or 94, may be implemented in software, or a combination of hardware and software components. Memories 48 and 98 may be implemented using any suitable type of memory device, such as random access memory (RAM) or flash memory (Flash).

在一些實施例中,處理器44及/或處理器94可包含一通用可編程處理器,其可用軟體編程以執行本發明所揭露之功能。可以透過網路將軟體以電子形式下載到處理器,或者可附加的或可替換的以非暫態之有形媒體(non-transitory tangible media)如磁記憶體、光記憶體、電子記憶體儲存。 In some embodiments, processor 44 and/or processor 94 may comprise a general purpose programmable processor, which may be programmed with software to perform the functions disclosed herein. The software can be electronically downloaded to the processor through the network, or can be additionally or alternatively stored in non-transitory tangible media (non-transitory tangible media) such as magnetic memory, optical memory, and electronic memory.

在上述實施例中,安全裝置先透過監控匯流排以檢測出未經授權之數據處置,接著中斷數據處置。在一個替代的實施例中,安全裝置不須先偵測到數據處置便可以中斷數據處置,甚至不須監控匯流排。例如,安全裝置可以覆寫某個主機的晶片選擇(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)

一種安全裝置,包含:一介面,用以連接一匯流排,該匯流排係服務一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置;以及一處理器,係連接至該匯流排以及該一個或多個周邊裝置,該處理器用以保存區分與該記憶體裝置進行之已經授權以及未經授權之數據處置之定義,以辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施;其中該匯流排包含一個或多個專用訊號以及一個或多個共用訊號,每一該一個或多個專用訊號係分別專用於其中一該周邊裝置,該一個或多個共用訊號係在該匯流排所服務之該周邊裝置之中共用,其中啟動該回應措施包括該處理器係藉由阻斷與該記憶體裝置相關的該專用訊號,以阻斷在該匯流排上的該數據處置。 A security device comprising: an interface connected to a bus serving one or more peripheral devices, at least one of which is a memory device; and a processor connected to to the bus and the one or more peripheral devices, the processor maintains definitions for distinguishing authorized and unauthorized data transactions with the memory device to identify a bus master on the bus attempting to access a data transaction of the memory device, and initiating a response in response to identifying that the data transaction is unauthorized according to the definition; wherein the bus comprises one or more dedicated signals and one or more shared signals , each of the one or more dedicated signals is dedicated to one of the peripheral devices respectively, the one or more common signals are shared among the peripheral devices served by the bus, wherein activating the response includes the processing The device blocks the data processing on the bus by blocking the dedicated signal associated with the memory device. 如請求項1所述之安全裝置,其中與該記憶體裝置相關的該專用訊號係為該記憶體裝置之一晶片選擇訊號,以及該處理器藉由將該晶片選擇訊號選擇該記憶體裝置之一持續時間延伸超出該數據處置之實際結束時間,以避免該記憶體裝置執行該數據處置,藉以阻斷該數據處置。 The security device as described in claim 1, wherein the dedicated signal related to the memory device is a chip selection signal of the memory device, and the processor selects the memory device by the chip selection signal A duration extends beyond the actual end time of the data transaction to prevent the memory device from performing the data transaction, thereby blocking the data transaction. 如請求項1所述之安全裝置,其中該定義係載明對該記憶體裝置進行的已經授權數據處置,以及其中回應當辨識出該數據處置未載明在該定義,則該處理器係啟動該回應措施。 The security device as recited in claim 1, wherein the definition specifies an authorized data disposal of the memory device, and wherein the response should identify that the data disposal is not specified in the definition, the processor is activated the response measures. 如請求項1所述之安全裝置,其中該處理器係從該匯流排主裝置接收該數據處置,以驗證是否該數據處置已經授權,以及 當決定該數據處置已經授權,該處理器在該記憶體裝置中執行該數據處置。 The security device as claimed in claim 1, wherein the processor receives the data disposal from the bus master to verify whether the data disposal has been authorized, and When determining that the data disposal is authorized, the processor executes the data disposal in the memory device. 如請求項4所述之安全裝置,其中該處理器係接收該數據處置作為多個數據處置之數列之一部分,該處理器驗證是否該數據處置已經授權,作為對該多個數據處置之數列進行共同驗證之一部分。 The security device of claim 4, wherein the processor receives the data processing as part of a sequence of data processing, the processor verifies whether the data processing has been authorized as part of the sequence of data processing Part of the common verification. 如請求項1所述之安全裝置,其中該數據處置係為一由該匯流排主裝置寫入一數據至該記憶體裝置的寫入數據處置,其中該處理器係對數據執行一加密操作,並於該加密操作成功時判斷該數據處置已經授權。 The security device as described in claim 1, wherein 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 encryption operation is successful, it is determined that the data processing has been authorized. 一種安全裝置,包含:一介面,用以連接一匯流排,該匯流排係服務一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置;以及一處理器,係連接至該匯流排以及該一個或多個周邊裝置,該處理器用以保存區分與該記憶體裝置進行之已經授權以及未經授權之數據處置之定義,以辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施;其中該處理器用以定義一個或多個數據處置群組,以保持一個或多個分別對應該一個或多個數據處置群組之計數器,以監控該匯流排,以及啟動該回應措施包括該處理器回應當辨識出在該匯流排上該匯流排主裝置以及該記憶體裝置之間的一既定數據處置時,增加該既定數據處置所屬之群組所對應的計數器之計數。 A security device comprising: an interface connected to a bus serving one or more peripheral devices, at least one of which is a memory device; and a processor connected to to the bus and the one or more peripheral devices, the processor maintains definitions for distinguishing authorized and unauthorized data transactions with the memory device to identify a bus master on the bus attempting to access the data handling of the memory device, and initiating a response in response to identifying the data handling as unauthorized according to the definition; wherein the processor is used to define one or more data handling groups to maintain a or a plurality of counters respectively corresponding to the one or more data handling groups to monitor the bus, and to initiate the response measures including the processor responding to identify the bus master and the memory on the bus When a predetermined data processing is performed between devices, the count of the counter corresponding to the group to which the predetermined data processing belongs is increased. 一種安全裝置,包含: 一介面,用以連接一匯流排,該匯流排係服務一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置;以及一處理器,係連接至該匯流排以及該一個或多個周邊裝置,該處理器用以保存區分與該記憶體裝置進行之已經授權以及未經授權之數據處置之定義,以辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施;其中啟動該回應措施包括該處理器係辨識在該匯流排上一個或多個指示該記憶體裝置進入一既定運作模式之模式進入數據處置以及一個或多個指示該記憶體裝置離開該既定運作模式之模式離開數據處置,以辨識是否該記憶體裝置操作在該既定運作模式。 A safety device comprising: an interface for connecting to a bus serving one or more peripheral devices, at least one of which is a memory device; and a processor connected to the bus and to the one or more peripheral devices, the processor maintains definitions for distinguishing between authorized and unauthorized data transactions with the memory device to identify a bus master attempting to access the memory on the bus Data handling of the device, and initiating a response measure upon identifying that the data handling is unauthorized according to the definition; wherein initiating the response measure includes the processor identifying one or more indicators on the bus indicating the memory Mode entry data processing for the device to enter a predetermined operating mode and one or more mode exit data processing instructing the memory device to leave the predetermined operating mode to identify whether the memory device is operating in the predetermined operating mode. 如請求項8所述之安全裝置,其中當該記憶體裝置操作在該既定運作模式時,該處理器對一個或多個數據處置給予一第一解釋,以及當該記憶體裝置不是操作在該既定運作模式時,該處理器對該一個或多個數據處置給予一不同的第二解釋。 The security device of claim 8, wherein the processor provides a first interpretation of 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. 如請求項8所述之安全裝置,其中當該記憶體裝置操作在該既定運作模式時,該處理器係中止啟動該回應措施。 The security device as claimed in claim 8, wherein when the memory device operates in the predetermined operation mode, the processor suspends activation of the response measure. 一種安全裝置,包含:一介面,用以連接一匯流排,該匯流排係服務一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置;以及一處理器,係連接至該匯流排以及該一個或多個周邊裝置,該處理器用以辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應對該數據處置之辨識,啟動一回應措施,以代替該記憶體裝置回應該匯流排主裝置,其中該數據處置係為對該記憶體裝置之能力之 查詢,其中啟動該回應措施包括該處理器係以一修改過的能力回應該匯流排主裝置,而修改過的能力係與該記憶體裝置之實際能力不同。 A security device comprising: an interface connected to a bus serving one or more peripheral devices, at least one of which is a memory device; and a processor connected to to the bus and the one or more peripheral devices, the processor for identifying a data transaction on the bus that a bus master device attempts to access the memory device, and responding to the identification of the data transaction, initiates a Response measures, instead of the memory device responding to the bus master device, wherein the data processing is a capability of the memory device The query wherein enabling the response action includes the processor responding to the bus master with a modified capability that is different from the actual capability of the memory device. 如請求項11之安全裝置,其中,根據對該數據處置之辨識,該處理器阻斷在該匯流排上的該數據處置。 The security device of claim 11, wherein, based on identifying the data transaction, the processor blocks the data transaction on the bus. 如請求項11之安全裝置,其中該處理器根據對該數據處置之辨識,用以發出一警訊。 The security device of claim 11, wherein the processor is configured to issue an alert based on identification of the data handling. 如請求項11之安全裝置,其中該查詢包含一串列式快閃記憶體可發現參數讀取指令,以及其中該處理器係以修改過的串列式快閃記憶體可發現參數回應該串列式快閃記憶體可發現參數讀取指令。 The security device of claim 11, wherein the query includes a serial flash discoverable parameter read command, and wherein the processor responds to the string with a modified serial flash discoverable parameter The column type flash memory can find the parameter read command. 如請求項11之安全裝置,其中在來自該匯流排主裝置之查詢之前,該處理器係從該記憶體裝置取得該記憶體裝置之該實際能力,且該處理器修改該實際能力以產生該修改過的能力以回應該匯流排主裝置。 The security device of claim 11, wherein 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 Modified capabilities to respond to the bus master. 如請求項11之安全裝置,其中該處理器係在該修改過的能力中增加一該記憶體裝置不支援的能力。 The security device as claimed in claim 11, wherein the processor adds a capability not supported by the memory device to the modified capability. 如請求項11之安全裝置,其中該處理器係省略一該記憶體裝置支援的能力,以產生該修改過的能力。 The security device of claim 11, wherein the processor omits a capability supported by the memory device to generate the modified capability. 一種安全方法,包含:使用一安全裝置在一匯流排上進行通訊,該安全裝置係連接至該匯流排以及一個或多個周邊裝置,至少其中之一該周邊裝置係為一記憶體裝置;保存一區分與該記憶體裝置進行之已經授權以及未經授權之數據處 置之定義;以及使用該安全裝置辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施;其中該匯流排包含一個或多個專用訊號以及一個或多個共用訊號,每一該一個或多個專用訊號係分別專用於其中一該周邊裝置,該一個或多個共用訊號係在該匯流排所服務之該周邊裝置之中共用,其中啟動該回應措施包含阻斷與該記憶體裝置相關的專用訊號,以阻斷在該匯流排上的該數據處置。 A security method comprising: communicating on a bus using a security device, the security device being connected to the bus and one or more peripheral devices, at least one of which is a memory device; storing A distinction between authorized and unauthorized data transactions with the memory device and a data transaction that uses the security device to identify a bus master attempting to access the memory device on the bus, and responds to a response that is initiated when the data transaction is identified as unauthorized according to the definition measures; wherein the bus includes one or more dedicated signals and one or more shared signals, each of the one or more dedicated signals is dedicated to one of the peripheral devices respectively, and the one or more shared signals are in the shared among the peripheral devices served by the bus, wherein activating the response includes blocking dedicated signals associated with the memory device to block the data processing on the bus. 如請求項18所述之安全方法,其中該一個或多個專用訊號係為該記憶體裝置之一晶片選擇(CS)訊號,以及阻斷該數據處置之步驟包含:藉由將該CS訊號選擇該記憶體裝置之一持續時間延伸超出該數據處置之一實際結束時間,以避免該記憶體裝置執行該數據處置。 The security method as described in claim 18, wherein the one or more dedicated signals are a chip select (CS) signal of the memory device, and the step of blocking the data processing comprises: by selecting the CS signal A duration of the memory device extends beyond an actual end time of the data processing to prevent the memory device from performing the data processing. 如請求項18所述之安全方法,其中該定義係載明對該記憶體裝置進行的已經授權數據處置,以及回應當辨識出該數據處置未載明在該定義,啟動該回應措施。 The security method as described in claim 18, wherein the definition specifies the authorized data processing on the memory device, and the response should recognize that the data processing is not specified in the definition, and activate the response measure. 如請求項18所述之安全方法,更包含:從該匯流排主裝置接收該數據處置,以驗證是否該數據處置已經授權;以及當決定該數據處置已經授權時,在該記憶體裝置中執行該數據處置。 The security method as described in claim 18, further comprising: receiving the data processing from the bus master device to verify whether the data processing has been authorized; and when it is determined that the data processing has been authorized, executing in the memory device The data processing. 如請求項21所述之安全方法,其中接收該數據處置之步驟包含:接收該數據處置作為多個數據處置之數列之一部分,並驗證是否該數據處置已經授權,以作為對該多個數據處置之數列進行共同驗證之一部分。 The security method as claimed in claim 21, wherein the step of receiving the data disposal comprises: receiving the data disposal as part of an array of a plurality of data disposals, and verifying whether the data disposal has been authorized as part of the plurality of data disposals The arrays are part of the common verification. 如請求項18所述之安全方法,其中該數據處置係為一由該匯流排主裝置寫入一數據至該記憶體裝置的寫入數據處置,其中驗證該數據處置是否已經授權之步驟包含:對數據執行一加密操作,並於該加密操作成功時決定該數據處置已經授權。 The security method as described in claim 18, wherein the data processing is a write data processing of writing a data to the memory device by the bus master device, wherein the step of verifying whether the data processing has been authorized includes: An encryption operation is performed on the data, and when the encryption operation is successful, it is determined that the data processing is authorized. 一種安全方法,包含:使用一安全裝置在一匯流排上進行通訊,該安全裝置係連接至該匯流排以及一個或多個周邊裝置,至少其中之一該周邊裝置係為一記憶體裝置;保存一區分與該記憶體裝置進行之已經授權以及未經授權之數據處置之定義;使用該安全裝置辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施;以及定義一個或多個數據處置群組,以保持一個或多個分別對應該一個或多個數據處置群組之計數器,以監控該匯流排,其中啟動該回應措施包括回應當辨識出在該匯流排上該匯流排主裝置以及該記憶體裝置之間的一既定數據處置時,增加該既定數據處置所屬之群組所對應的計數器之計數。 A security method comprising: communicating on a bus using a security device, the security device being connected to the bus and one or more peripheral devices, at least one of which is a memory device; storing A definition for distinguishing authorized and unauthorized data transactions by the memory device; using the security device to identify data transactions on the bus where a bus master device attempts to access the memory device, and responding to the Initiating a response measure when the data processing is identified as unauthorized according to the definition; and defining one or more data processing groups to maintain one or more counters respectively corresponding to the one or more data processing groups to monitoring the bus, wherein activating the response action includes responding when a predetermined data transaction between the bus master device and the memory device on the bus is identified, increasing the group corresponding to the predetermined data transaction The count of the counter. 一種安全方法,包含:使用一安全裝置在一匯流排上進行通訊,該安全裝置係連接至該匯流排以及一個或多個周邊裝置,至少其中之一該周邊裝置係為一記憶體裝置;保存一區分與該記憶體裝置進行之已經授權以及未經授權之數據處置之定義;以及使用該安全裝置辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應當根據該定義辨識出該數據處置係未經授權時啟動一回應措施;啟動該回應措施包括辨識在該匯流排上一個或多個指示該記憶體裝置進入一既定運作模式之模式進入數據處置以及一個或多個指示該記憶體裝置離開該既定運作模式之模式離開數據處置,以辨識是否該記憶體裝置操作在該既定運作模式。 A security method comprising: communicating on a bus using a security device, the security device being connected to the bus and one or more peripheral devices, at least one of which is a memory device; storing a definition for distinguishing authorized and unauthorized data transactions by the memory device; A response measure shall be initiated upon identification of the data processing as unauthorized according to the definition; activating the response measure includes identifying one or more mode-entry data processing on the bus that instructs the memory device to enter a predetermined mode of operation and One or more mode-exit data processing indicating that the memory device leaves the predetermined mode of operation is used to identify whether the memory device is operating in the predetermined mode of operation. 如請求項25所述之安全方法,其中當該記憶體裝置操作在該既定運作模式時,對一個或多個數據處置給予一第一解釋,以及當該記憶體裝置不是操作在該既定運作模式時,對該一個或多個數據處置給予一不同的第二解釋。 The security method of claim 25, wherein a first interpretation is given 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 predetermined mode of operation , a different second interpretation is given to the one or more data manipulations. 如請求項26所述之安全方法,其中當該記憶體裝置操作在該既定運作模式時,中止啟動該回應措施。 The security method as claimed in claim 26, wherein when the memory device operates in the predetermined operation mode, the activation of the response measure is suspended. 一種安全方法,包含:使用一安全裝置在一匯流排上進行通訊,該安全裝置係連接至該匯流排以及一個或多個周邊裝置,其中至少其中之一該周邊裝置係為一記憶體裝置; 使用該安全裝置辨識在該匯流排上一匯流排主裝置嘗試存取該記憶體裝置之數據處置,以及回應對該數據處置之辨識,啟動一回應措施,以代替該記憶體裝置回應該匯流排主裝置;其中該數據處置係為對該記憶體裝置之能力之查詢,其中啟動該回應措施包括該處理器係以一修改過的能力回應該匯流排主裝置,而修改過的能力係與該記憶體裝置之實際能力不同。 A security method comprising: using a security device to communicate on a bus, the security device being connected to the bus and one or more peripheral devices, wherein at least one of the peripheral devices is a memory device; Using the security device to identify a data transaction on the bus where a bus master device attempts to access the memory device, and in response to identification of the data transaction, initiate a response in place of the memory device responding to the bus master device; wherein the data processing is an inquiry of the capabilities of the memory device, wherein initiating the response includes the processor responding to the bus master with a modified capability, and the modified capability is related to the The actual capabilities of memory devices vary. 如請求項28所述之安全方法,其中啟動該回應措施之步驟包含以下步驟之至少一個:在該匯流排上阻斷該數據處置;以及發出一警訊。 The security method as claimed in claim 28, wherein the step of initiating the response measures includes at least one of the following steps: blocking the data processing on the bus; and issuing an alert.
TW109103275A 2019-09-12 2020-02-03 Security monitoring of serial peripheral interface flash TWI791138B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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