Methods and apparatuses for detecting and recovering from a buffer
overflow attack are provided. A method of recovering an operation state
of a processor from a buffer overflow attach includes: detecting whether
a buffer overflow attack is made on any write operation while storing
write operations that are potential targets of buffer overflow attacks in
a predetermined location instead of an original destination to store
write operations; storing the contents stored in the predetermined
location at a predetermined interval in the original destination for
storing write operations if no buffer overflow attack is detected and
discarding unsafe write operations subsequent to a buffer overflow attack
if a buffer overflow attack is detected; and ignoring the unsafe write
operations subsequent to the buffer overflow attack if a buffer overflow
attack is detected. Therefore, a buffer overflow attack occurring in a
computer can be effectively detected, and damage of a system which is
attacked can be minimized and the system can be recovered or return to
the original state before the attack. A system can be effectively
protected while minimizing reduction in performance of the computer
system according to a method used to implement the present invention,
thereby greatly improving the environments under which the computer and
the Internet are used.