Anomaly detection method, anomaly detection recording medium, anomaly detection device, rewriting method, and rewriting device
View Patent ↗An anomaly detection method includes: reading a branch target address corresponding to a branch instruction, twice or more; determining whether the branch target addresses read are identical; and executing the branch instruction when the branch target addresses read are identical, and executing anomaly detection processing when the branch target addresses read are not identical.
1. An anomaly detection method comprising:
reading a branch target address corresponding to a branch instruction, twice or more;
determining whether branch target addresses read are identical; and
executing the branch instruction when the branch target addresses read are identical, and executing anomaly detection processing when the branch target addresses read are not identical.
2. The anomaly detection method according to claim 1 , wherein
the branch target addresses are retained in a single memory area, and
the reading includes reading the branch target addresses from the single memory area, twice or more.
3. The anomaly detection method according to claim 1 , wherein
the branch target addresses are respectively retained in different memory areas, and
the reading includes reading the branch target addresses respectively from the different memory areas, twice or more.
4. The anomaly detection method according to claim 1 , wherein
the reading is performed when a specified condition is satisfied, and the reading is not performed when the specified condition is not satisfied.
5. A non-transitory computer-readable recording medium having recorded thereon an anomaly detection program for causing a computer to execute the anomaly detection method according to claim 1 .
6. An anomaly detection device comprising:
a detector that detects a branch instruction in a program;
a reader that reads a branch target address corresponding to the branch instruction, twice or more;
a determiner that determines whether branch target addresses read are identical; and
an executer that executes the branch instruction when the branch target addresses read are identical, and executes anomaly detection processing when the branch target addresses read are not identical.
7. A method of rewriting a program, comprising:
detecting a branch instruction in the program; and
rewriting the branch instruction detected into an anomaly detection instruction, wherein
the anomaly detection instruction includes instructions for:
reading a branch target address corresponding to the branch instruction, twice or more;
determining whether branch target addresses read are identical; and
executing the branch instruction when the branch target addresses read are identical, and executing anomaly detection processing when the branch target addresses read are not identical.
8. The method according to claim 7 , wherein
the rewriting is performed when a specified condition is satisfied, and the rewriting is not performed when the specified condition is not satisfied.
9. A non-transitory computer-readable recording medium having recorded thereon a rewriting program for causing a computer to execute the method according to claim 7 .
10. A device which rewrites a program, the device comprising:
a detector that detects a branch instruction in the program; and
a rewriter that rewrites the branch instruction detected into an anomaly detection instruction, wherein
the anomaly detection instruction includes instructions for:
reading a branch target address corresponding to the branch instruction, twice or more;
determining whether branch target addresses read are identical; and
executing the branch instruction when the branch target addresses read are identical, and executing anomaly detection processing when the branch target addresses read are not identical.