Replies: 3 comments 2 replies
-
Oh this should definitely be a Discussion sigh |
Beta Was this translation helpful? Give feedback.
-
@saethlin went ahead and converted it to a "Discussion". My personal take is I think it would be good to file informational advisories about usages of |
Beta Was this translation helpful? Give feedback.
-
I raised about itoa here - #1404 We could perhaps use the informational = notice here I would love to be able to flag std functions as unsound .. |
Beta Was this translation helpful? Give feedback.
-
The standard library has a stern warning against use of
mem::uninitialized
that it sort of walks back at the end:There has been a slow but very broad ecosystem move away from this function. For example,
itoa
published a 1.0 release 2 months ago which removes use of this function.bytes
used to use it too, as well ascrossbeam
. I've runcargo audit
on crates that depend on versions of these crates which callmem::uninitialized
and I don't come up with anything foritoa
,bytes
, orcrossbeam
. I've selected these crates specifically to call out, because I know they construct uninit instances ofu8
orusize
and I know that pre-patch versions of them are in use.I think it would be fair to indicate to users that they should upgrade, given how long it's been since a patch and that
itoa
changed basically not at all with 1.0. But does "constructs uninit integers" meet the bar for a RustSec advisory in light of the fact that it's definitely a bad idea, but unclear if it's UB? It's unclear to my mind if this is the same kind of thing as assuming the layout ofSocketAddr
.I made the mistake of mentioning
mem::uninitialized
too much above. There are also instances whereMaybeUninit::assume_init
is called on uninitialized integers, and I think those should be considered in the same category.Beta Was this translation helpful? Give feedback.
All reactions