Skip to content

Commit e129a67

Browse files
author
Mrunal Patel
authored
Merge pull request #223 from Mashimiao/validate-add-hard-soft-limit-check
validate: add hard and soft limit check for rlimit
2 parents 8f3fe77 + f175fae commit e129a67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/oci-runtime-tool/validate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ func checkProcess(spec rspec.Spec, rootfs string, hostCheck bool) (msgs []string
234234
if !rlimitValid(process.Rlimits[index].Type) {
235235
msgs = append(msgs, fmt.Sprintf("rlimit type %q is invalid.", process.Rlimits[index].Type))
236236
}
237+
if process.Rlimits[index].Hard < process.Rlimits[index].Soft {
238+
msgs = append(msgs, fmt.Sprintf("hard limit of rlimit %s should not be less than soft limit.", process.Rlimits[index].Type))
239+
}
237240
}
238241

239242
if len(process.ApparmorProfile) > 0 {

0 commit comments

Comments
 (0)