Ensure integer arithmetic is overflow-tolerant
Created by: philmiller-charmworks
My pull request #680 fixed one instance of potential integer overflow in checking ranges of user virtual addresses against memory mappings, in ContextZone::permission. A scan through the file shows the same issue is repeated in ContextZone::translate and Context::{permission,translate}.
This seems to suggest factoring out such sensitive code to a common range-containment testing function that the various sites can call upon.
While most integer arithmetic in the kernel is not likely to cause overflow-based bugs, this needs to be reviewed. Once complete, we can enable #![deny(clippy::integer_arithmetic)]
.