As far as I can tell, it is currently the case that, using raw pointers, this is not actually undefined behavior (but I never entirely trust my conclusions on these matters).
"&mut T and &T follow LLVM’s scoped noalias model" [1][referring to 2 and 3] but I am fairly sure this does not currently apply to raw pointers, and "provenance is implicitly shared with all pointers transitively derived from the original pointer through operations like offset, borrowing, and pointer casts." [4]
[1] https://doc.rust-lang.org/reference/behavior-considered-unde...
[2] https://llvm.org/docs/LangRef.html#pointeraliasing
[3] "noalias" under https://llvm.org/docs/LangRef.html#parameter-attributes
[4] https://doc.rust-lang.org/core/ptr/index.html
Also excellent are
https://faultlore.com/blah/fix-rust-pointers
https://www.ralfj.de/blog/2018/07/24/pointers-and-bytes.html
https://www.ralfj.de/blog/2020/12/14/provenance.html
https://www.ralfj.de/blog/2022/04/11/provenance-exposed.html
It seems likely you'd already be familiar with these; I'm just putting them out there for anyone interested.