It appears that a common exploit trick is to use stack overflow to overwrite the instruction pointer such that it points to a jmp esp
instruction somewhere in the code segment which then executes the arbitrary code of the attacker's choice.
However, I have a hard time understanding what use legitimate programs (which to my understanding are usually not self-modifying and have all of their executable code stored in the code segment) would have in including such jmp esp
instructions in the first place.