Limiting a number of illegitimate interrupts from switching a central processing unit to a system management mode
Disclosed herein is a system for limiting the rate at which system management interrupts can suspend normal execution of a central processing unit (CPU) by switching the operating mode of the CPU from one of the real mode or the protected mode to the system management mode. The rate limits imposed by the system provides a protective layer against cyberattacks (e.g., a distributed denial-of-service (DDoS) attack) from malicious actors and ensures the CPU can be more efficient regarding the execution of workloads (e.g., processing threads).
1 . A method implemented by a baseboard management controller for limiting a number of illegitimate interrupts from switching an operating mode of a central processing unit from a real operating mode or a protected operating mode to a system management operating mode, the method comprising:
defining, for each of a plurality of different types of interrupts, a threshold number of interrupts that are allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode, wherein:
the baseboard management controller is configured to respectively manage the plurality of different types of interrupts via a plurality of different interfaces; and
the threshold number of interrupts defined for a first type of interrupt is different than the threshold number of interrupts defined for a second type of interrupt;
tracking, via a respective interface for the first type of interrupt, a number of interrupts that have been allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode;
determining, based on the tracking, that the number of interrupts has satisfied the threshold number of interrupts defined for the first type of interrupt; and
preventing, based on the determining, additional interrupts of the first type of interrupt from being allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode.
2 . The method of claim 1 , wherein the threshold number of interrupts defined for the first type of interrupt is further defined for a predetermined period of time and the tracking is implemented during the predetermined period of time.
3 . The method of claim 2 , wherein the threshold number of interrupts defined for the first type of interrupt is statically defined for the predetermined period of time.
4 . The method of claim 2 , wherein the threshold number of interrupts defined for the first type of interrupt is dynamically defined for the predetermined period of time.
5 . The method of claim 1 , wherein the baseboard management controller is configured to allow an interrupt to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode via toggling a General-Purpose Input-Output pin.
6 . The method of claim 1 , further comprising storing the threshold number of interrupts defined for the first type of interrupt in a table.
7 . The method of claim 1 , wherein the plurality of different types of interrupts are mapped to entries in a table storing the threshold number of interrupts defined for each of the plurality of different types of interrupts based on the plurality of different interfaces at which an interrupt invocation request is received.
8 . The method of claim 1 , wherein:
the first type of interrupt is invoked to manage or debug an error in system hardware;
the second type of interrupt is invoked to implement telemetry harvesting; and
a third type of interrupt is invoked to implement a power control function.
9 . A method implemented by a baseboard management controller for limiting a number of illegitimate interrupts from switching an operating mode of a central processing unit from a real operating mode or a protected operating mode to a system management operating mode, the method comprising:
defining, for each of a plurality of different types of interrupts, a threshold number of interrupts that are allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode, wherein:
the baseboard management controller is configured to respectively manage the plurality of different types of interrupts via a plurality of different interfaces; and
the threshold number of interrupts defined for a first type of interrupt is different than the threshold number of interrupts defined for a second type of interrupt;
receiving a first interrupt invocation request via a respective interface for the first type of interrupt;
determining that a current number of interrupts, for the first type of interrupt, that have been allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode does not satisfy the threshold number of interrupts defined for the first type of interrupt;
in response to determining that the current number of interrupts, for the first type of interrupt, that have been allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode does not satisfy the threshold number of interrupts defined for the first type of interrupt, invoking a first interrupt, based on the first interrupt invocation request, that switches the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode;
incrementing the current number of interrupts, for the first type of interrupt, by one;
receiving a second interrupt invocation request via a respective interface for the first type of interrupt;
determining that the current number of interrupts, for the first type of interrupt, that have been allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode satisfies the threshold number of interrupts defined for the first type of interrupt; and
in response to determining that the current number of interrupts, for the first type of interrupt, that have been allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode satisfies the threshold number of interrupts defined for the first type of interrupt, preventing a second interrupt from being invoked based on the second interrupt invocation request.
10 . The method of claim 9 , wherein the threshold number of interrupts defined for the first type of interrupt is further defined for a predetermined period of time and the current number of interrupts is reset to zero upon expiration of the predetermined period of time.
11 . The method of claim 10 , wherein the threshold number of interrupts defined for the first type of interrupt is statically defined for the predetermined period of time.
12 . The method of claim 10 , wherein the threshold number of interrupts defined for the first type of interrupt is dynamically defined for the predetermined period of time.
13 . The method of claim 9 , wherein the baseboard management controller is configured to invoke the first interrupt via toggling a General-Purpose Input-Output pin.
14 . The method of claim 9 , further comprising storing the threshold number of interrupts defined for the first type of interrupt in a table.
15 . The method of claim 9 , wherein the plurality of different types of interrupts are mapped to entries in a table storing the threshold number of interrupts defined for each of the plurality of different types of interrupts based on the plurality of different interfaces at which an interrupt invocation request is received.
16 . A baseboard management controller configured to perform operations comprising:
tracking, via a respective interface for each of a plurality of different types of interrupts, a number of interrupts that have been allowed to switch an operating mode of a central processing unit from a real operating mode or a protected operating mode to a system management operating mode;
determining, based on the tracking, that the number of interrupts for a first type of interrupt has satisfied a threshold number of interrupts defined for the first type of interrupt, wherein the threshold number of interrupts defined for the first type of interrupt is different than a threshold number of interrupts defined for a second type of interrupt; and
preventing, based on the determining, additional interrupts for the first type of interrupt from being allowed to switch the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode.
17 . The baseboard management controller of claim 16 , wherein the threshold number of interrupts defined for the first type of interrupt is further defined for a predetermined period of time and the tracking is implemented during the predetermined period of time.
18 . The baseboard management controller of claim 16 , wherein the operations further comprise storing the threshold number of interrupts defined for the first type of interrupt in a table.
19 . The baseboard management controller of claim 16 , wherein each of the plurality of different types of interrupts has a dedicated General-Purpose Input-Output pin for switching the operating mode of the central processing unit from the real operating mode or the protected operating mode to the system management operating mode.
20 . The baseboard management controller of claim 16 , wherein the plurality of different types of interrupts are mapped to entries in a table storing the threshold number of interrupts defined for each of the plurality of different types of interrupts based on a plurality of different interfaces at which an interrupt invocation request is received.