-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmm: Explicitly set NetConfig FDs as invalid for (de)serialization #6332
Merged
likebreath
merged 1 commit into
cloud-hypervisor:main
from
likebreath:0325/invalid_net_fds
Mar 26, 2024
Merged
vmm: Explicitly set NetConfig FDs as invalid for (de)serialization #6332
likebreath
merged 1 commit into
cloud-hypervisor:main
from
likebreath:0325/invalid_net_fds
Mar 26, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rbradford
reviewed
Mar 26, 2024
likebreath
force-pushed
the
0325/invalid_net_fds
branch
from
March 26, 2024 16:15
0a0ed77
to
71573d0
Compare
rbradford
approved these changes
Mar 26, 2024
rbradford
reviewed
Mar 26, 2024
The 'NetConfig' may contain FDs which can't be serialized correctly, as FDs can only be donated from another process via a Unix domain socket with `SCM_RIGHTS`. To avoid false use of the serialized FDs, this patch explicitly set 'NetConfig' FDs as invalid for (de)serialization. See: cloud-hypervisor#6286 Signed-off-by: Bo Chen <chen.bo@intel.com>
likebreath
force-pushed
the
0325/invalid_net_fds
branch
from
March 26, 2024 18:07
71573d0
to
8d866d8
Compare
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 21, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot operation. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. Hence, added 2 new parameters 1. net_ids 2. net_fds to 'RestoreConfig'. Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 21, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot operation. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. Hence, added 2 new parameters 1. net_ids 2. net_fds to 'RestoreConfig'. Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 21, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 21, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 21, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 22, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 22, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 22, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 22, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 23, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 23, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Implement exclusive HTTP PutHandler for VmRestore. Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 23, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Use vm_action_put_handler_body_with_fds for VmRestore http handler Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
Apr 24, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds two new fields to 'RestoreConfig' - 1.net_ids 2.net_fds. 'net_ids' is a list of NetConfig id. 'net_fds' is a list of FDs for required NetConfigs. These fds are replaced into the fds field of NetConfig appropriately. Implement 'validate' for RestoreConfig Use vm_action_put_handler_body_with_fds for VmRestore http handler Allow net FDs to be sent along with 'restore' in ch-remote Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 2, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. Also, implement 'validate' fn for RestoreConfig Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 2, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. Also, implement 'validate' fn for RestoreConfig Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 2, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. Also, implement 'validate' fn for RestoreConfig Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 3, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 3, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 3, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 3, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 7, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: #6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes: #6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 8, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes: cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 9, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: #6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes: #6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
pupacha
added a commit
to pupacha/cloud-hypervisor
that referenced
this pull request
May 9, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: cloud-hypervisor#6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes cloud-hypervisor#6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 14, 2024
'NetConfig' FDs, when explicitly passed via SCM_RIGHTS during VM creation, are marked as invalid during snapshot. See: #6332. So, Restore should support input for the new net FDs. This patch adds new field 'net_fds' to 'RestoreConfig'. The FDs passed using this new field are replaced into the 'fds' field of NetConfig appropriately. The 'validate()' function ensures all net devices from 'VmConfig' backed by FDs have a corresponding 'RestoreNetConfig' with a matched 'id' and expected number of FDs. The unit tests provide different inputs to parse and validate functions to make sure parsing and error handling is as per expectation. Fixes #6286 Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com> Co-authored-by: Bo Chen <chen.bo@intel.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The 'NetConfig' may contain FDs which can't be serialized correctly, as FDs can only be donated from another process via a Unix domain socket with
SCM_RIGHTS
. To avoid false use of the serialized FDs, this patch explicitly set 'NetConfig' FDs as invalid for (de)serialization.See: #6286