Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: change firecracker socket permissions
Browse files Browse the repository at this point in the history
For security reasons, let's make sure 'others' don't have access to the
firecracker hybrid vsock

fixes #2101

Signed-off-by: Julio Montes <[email protected]>
  • Loading branch information
Julio Montes committed Oct 3, 2019
1 parent 46d1957 commit 8f6b0a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions virtcontainers/fc.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,11 @@ func (fc *firecracker) fcStartVM() error {
return err
}

// make sure 'others' don't have access to this socket
if err := os.Chmod(filepath.Join(fc.jailerRoot, defaultHybridVSocketName), 0640); err != nil {
return fmt.Errorf("Could not change socket permissions: %v", err)
}

fc.state.set(vmReady)
return nil
}
Expand Down

0 comments on commit 8f6b0a6

Please sign in to comment.