This invention relates to a method for triggering transient execution vulnerabilities in processors based on a loop exit prediction mechanism, belonging to the field of
computer science. First, it detects whether a loop exit predictor exists in the target processor. Then, it trains the loop exit predictor by constructing and repeatedly executing a loop of a specific length, fixing its total iteration count field to a specific
value set by the attacker. Next, it triggers the victim to execute long loop code containing boundary checks. When the victim's loop reaches the specified length, the loop exit predictor preemptively predicts a loop exit, forming a transient execution window. Within this window, it bypasses boundary checks, generating out-of-bounds memory access and loading sensitive kernel data into the cache. Finally, it uses cache side-channel technology to recover the data. This invention provides a novel approach to constructing transient execution vulnerabilities, expanding the
attack surface of transient execution vulnerabilities in kernel code and significantly improving kernel code security.