Skip to content

Commit

Permalink
Merge pull request from GHSA-5g49-rx9x-qfc6
Browse files Browse the repository at this point in the history
[1.1] libct/cgroups.OpenFile: clean "file" argument
  • Loading branch information
cyphar authored Oct 30, 2023
2 parents e1adc7f + b426e9b commit 7b469c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libcontainer/cgroups/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"
"sync"

"github.com/opencontainers/runc/libcontainer/utils"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
)
Expand Down Expand Up @@ -122,7 +123,7 @@ func openFile(dir, file string, flags int) (*os.File, error) {
flags |= os.O_TRUNC | os.O_CREATE
mode = 0o600
}
path := path.Join(dir, file)
path := path.Join(dir, utils.CleanPath(file))
if prepareOpenat2() != nil {
return openFallback(path, flags, mode)
}
Expand Down

0 comments on commit 7b469c9

Please sign in to comment.