Skip to content

Commit c13c9ca

Browse files
author
Mrunal Patel
authored
Merge pull request #241 from wking/validate-add-hard-soft-limit-check
[1.0.0.rc1] validate: add hard and soft limit check for rlimit
2 parents c74efae + e080908 commit c13c9ca

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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)