History

Drivers: hv: vmbus: Track decrypted status in vmbus_gpadl

In CoCo VMs it is possible for the untrusted host to cause set_memory_encrypted() or set_memory_decrypted() to fail such that an error is returned and the resulting memory is shared. Callers need to take care to handle these errors to avoid returning decrypted (shared) memory to the page allocator, which could lead to functional or security issues. In order to make sure callers of vmbus_establish_gpadl() and vmbus_teardown_gpadl() don't return decrypted/shared pages to allocators, add a field in struct vmbus_gpadl to keep track of the decryption status of the buffers. This will allow the callers to know if they should free or leak the pages.

Rick Edgecombe committed 2 years ago

Commit 211f5141 parent 03f5a992 files · +22 −4Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/hyperv.h+1−0
@@ -832,6 +832,7 @@ struct vmbus_gpadl { · 831 unmodified lines
832 u32 gpadl_handle;832 u32 gpadl_handle;
833 u32 size;833 u32 size;
834 void *buffer;834 void *buffer;
835 bool decrypted;
835};836};
836 837
837struct vmbus_channel {838struct vmbus_channel {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t