Skip to content

Commit

Permalink
Hold lock when updating DefaultMounts (#1367)
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim An <maksiman@microsoft.com>
  • Loading branch information
anmaxvl committed Apr 26, 2022
1 parent dbb347e commit a3a8aa1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/securitypolicy/securitypolicyenforcer.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ func (pe *StandardSecurityPolicyEnforcer) enforceDefaultMounts(specMount oci.Mou
}

func (pe *StandardSecurityPolicyEnforcer) ExtendDefaultMounts(defaultMounts []oci.Mount) error {
pe.mutex.Lock()
defer pe.mutex.Unlock()

for _, mnt := range defaultMounts {
pe.DefaultMounts = append(pe.DefaultMounts, newMountConstraint(
mnt.Source,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3a8aa1

Please sign in to comment.