Skip to content

Commit

Permalink
tpm: move createVTPMs to point after init of config.Namespaces
Browse files Browse the repository at this point in the history
Move the call to createVTPMs() to a point after the config.Namespaces
has been initialized.

Move the Cgroup creation after the createVTPMs() call, otherwise the
Cgroup entries for the /dev/tpm* devices will not be there.

Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Sep 8, 2017
1 parent df3d1e6 commit ca2dcb4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libcontainer/specconv/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,6 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
if err := setupUserNamespace(spec, config); err != nil {
return nil, err
}
if err := createVTPMs(spec, config); err != nil {
return nil, err
}
c, err := createCgroupConfig(opts)
if err != nil {
return nil, err
}
config.Cgroups = c
// set linux-specific config
if spec.Linux != nil {
if config.RootPropagation, exists = mountPropagationMapping[spec.Linux.RootfsPropagation]; !exists {
Expand Down Expand Up @@ -237,6 +229,14 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
config.Seccomp = seccomp
}
}
if err := createVTPMs(spec, config); err != nil {
return nil, err
}
c, err := createCgroupConfig(opts)
if err != nil {
return nil, err
}
config.Cgroups = c
if spec.Process.SelinuxLabel != "" {
config.ProcessLabel = spec.Process.SelinuxLabel
}
Expand Down

0 comments on commit ca2dcb4

Please sign in to comment.