Validate & Copy?
Validate & Copy?
Posted Sep 4, 2025 6:57 UTC (Thu) by Wol (subscriber, #4433)Parent article: Tracking trust with Rust in the kernel
Cheers,
Wol
Posted Sep 6, 2025 8:04 UTC (Sat)
by lossin (subscriber, #177724)
[Link]
I think we definitely can add functions to Validate & Copy?
UserSliceReader
that copy and validate in the same step. But we'll have to do that for every single way you can read untrusted data. Having a generic API that you can just plug untrusted values into should still exist for APIs that don't provide such a function themselves.
There are also other use-cases for untrusted data, for example with UserSliceReader
you might also just want to copy some bytes from one place in userspace to another and you wouldn't want to validate anything in between. So if we only had the copy & validate function, you would have to write an empty validation function for [u8]
.