A Lesson in Memory Safety

Some bugs survive in production for years because the code reads exactly like careful engineering. FreeBSD recently resolved a deep issue that fits in that category: a bounds check in the kernel, correct on its face, that fails against a single negative number. The video below breaks it down step by step and is worth watching before reading on. The function copies a bounded region of kernel memory…