File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -576,6 +576,25 @@ func validateMaskedPaths(spec *rspec.Spec) error {
576576 return nil
577577}
578578
579+ func validateSeccomp (spec * rspec.Spec ) error {
580+ if spec .Linux == nil || spec .Linux .Seccomp == nil {
581+ return nil
582+ }
583+ for _ , sys := range spec .Linux .Seccomp .Syscalls {
584+ if sys .Action == "SCMP_ACT_ERRON" {
585+ for _ , name := range sys .Names {
586+ if name == "getcwd" {
587+ _ , err := os .Getwd ()
588+ if err == nil {
589+ logrus .Warnf ("Syscall action %v can not be properly applied in the runtime" , sys .Action )
590+ }
591+ }
592+ }
593+ }
594+ }
595+ return nil
596+ }
597+
579598func validateROPaths (spec * rspec.Spec ) error {
580599 if spec .Linux == nil {
581600 return nil
@@ -864,6 +883,10 @@ func run(context *cli.Context) error {
864883 test : validateOOMScoreAdj ,
865884 description : "oom score adj" ,
866885 },
886+ {
887+ test : validateSeccomp ,
888+ description : "seccomp" ,
889+ },
867890 {
868891 test : validateROPaths ,
869892 description : "read only paths" ,
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "fmt"
5+
6+ "github.com/opencontainers/runtime-tools/generate/seccomp"
7+ "github.com/opencontainers/runtime-tools/validation/util"
8+ )
9+
10+ func main () {
11+ g := getDefaultGenerator ()
12+ syscallArgs := seccomp.SyscallOpts {
13+ Action : "errno" ,
14+ Syscall : "getcwd" ,
15+ }
16+ g .SetDefaultSeccompAction ("allow" )
17+ g .SetSyscallAction (syscallArgs )
18+ err := util .RuntimeInsideValidate (g , nil )
19+ if err != nil {
20+ until .Fatal (err )
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments