libsel4allocman: overflow guards for large UT
seL4 can and does produce Untypeds that reach the end of the address space. Using start + BIT(size) is not overflow safe for these.
Replace this pattern with MASK instead for inclusive-end reasoning, or explicitly use uint64_t where that is too inconvenient.
The latter does rely on the fact that we will not get Untypeds that reach 2^64. It does look like no architecture so far has a full 64-bit physical address space, so this should be impossible.
This is not a full overflow safety survey of all of libsel4allocman, just what I found by searching for “BIT(“ in the untyped allocation path. It at least does fix the errors I was getting for zcu102 which does now produce such an untyped cap.
Signed-off-by: Gerwin Klein gerwin.klein@proofcraft.systems
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
seL4 Libraries
A collection of libraries for working on seL4.