SPI `TransferInPlace` operation is unsound.
Closed this issue · 2 comments
reitermarkus commented
The implementation for the TransferInPlace operation violates the aliasing rule by creating an immutable reference from a mutable one, but keeping both.
Lines 216 to 222 in 1ffb268
There needs to be a corresponding method for SpidevTransfer, e.g. read_write_in_place.
jamesmunns commented
I definitely concur with this being UB! Would be great to have this fixed, we've notified @sirhcel, who will be taking a peak when possible :)
jannic commented
This could be fixed with #123, but needs a release of spidev first, to implement the required read_write_in_place function.
(with rust-embedded/rust-spidev#49)