What is the difference between buffer overflows and out-of-bounds writes? Are buffer overflows a kind of out-of-bounds writes?
What is the difference between buffer overflows and out-of-bounds writes?
A buffer overflow usually refers to an exploit targeting a program written in a language like C that doesn't automatically do array bounds checking, where the point is to overwrite the portion of the stack frame that holds a return address, because by putting something special there the exploit can take control of the program to make the program do things it shouldn't.
Are buffer overflows a kind of out-of-bounds writes?
Yes, I think that is fair to say. A buffer is an array, and filling it past capacity is an array out of bounds access (or more than one such access).
A programming language that checks array bounds on array access will prevent buffer overflows.
There are other bad writes, such as with a store via an uninitialized pointer or reference; also bad conversions (casts) such as from integer to pointer.