Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel/vtpm: fix potential UB when accessing guest buffer
Creating a mutable reference to the guest buffer, could have been an UB because the guest could potentially modify it. So, let's revoke buffer access to the guest before creating the mutable reference with `from_raw_parts_mut()`. Restore buffer access to the guest, after the reference to the buffer is dropped (internal block in the match). Suggested-by: Claudio Carvalho <cclaudio@linux.ibm.com> Suggested-by: Carlos López <carlos.lopezr4096@gmail.com> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
- Loading branch information