File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/structures/paging/mapper Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,11 @@ impl<'a> RecursivePageTable<'a> {
5050 ///
5151 /// ## Safety
5252 ///
53- /// Creating a recursive page table with recursive index 511 is unsound
54- /// because calculating the end ptr of the structure causes an overflow.
53+ /// Note that creating a `PageTable` with recursive index 511 is unsound
54+ /// because allocating the last byte of the address space can lead to pointer
55+ /// overflows and undefined behavior. For more details, see the discussions
56+ /// [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/end-of-address-space)
57+ /// and [in the `unsafe-code-guidelines ` repo]https://github.com/rust-lang/unsafe-code-guidelines/issues/420).
5558 #[ inline]
5659 pub fn new ( table : & ' a mut PageTable ) -> Result < Self , InvalidPageTable > {
5760 let page = Page :: containing_address ( VirtAddr :: new ( table as * const _ as u64 ) ) ;
You can’t perform that action at this time.
0 commit comments