Re: [PATCH] rust: io: require proper alignment in the safety contracts of `IoCapable`
From: Alexandre Courbot
Date: Tue Jun 09 2026 - 07:31:02 EST
On Mon Jun 8, 2026 at 7:33 PM JST, Gary Guo wrote:
> On Mon Jun 8, 2026 at 9:14 AM BST, Alexandre Courbot wrote:
>> The addresses passed to `io_read` and `io_write` must be properly
>> aligned, but the safety contract only mentions a valid range as a
>> requirement.
>>
>> Add alignment to the requirements. The existing call sites already
>> obtain the address through `io_addr()` or `io_addr_assert(),` which
>> both check alignment, so no code changes are needed to them.
>>
>> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
>
> There is
> https://lore.kernel.org/rust-for-linux/20260421-io_projection-v2-4-4c251c692ef4@xxxxxxxxxxx/.
>
> Although this patch will be gone from v3, as `IoCapable` is not going to be
> unsafe anymore.
Ah, perfect! Dropping this patch then.