Skip to content

Commit

Permalink
Hold lock when updating DefaultMounts
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 22, 2022
1 parent db5e1b1 commit 537905b
Showing 1 changed file with 3 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

0 comments on commit 537905b

Please sign in to comment.