In CHERI, for example, pointers have permissions. The pointer to the COW memory would not have the "write" permission.
I could be misunderstanding the bug, of course.
I could be misunderstanding the bug, of course.
I thought the bug was a missing check for the COW flag, but looking at it again it seems it was missing both setting and checking the flag.