Skip to content

Commit

Permalink
Merge pull request #2168 from AkihiroSuda/ebpf-fix-rlimit
Browse files Browse the repository at this point in the history
cgroup2: ebpf: increase RLIM_MEMLOCK to avoid BPF_PROG_LOAD error
  • Loading branch information
hqhq authored Nov 16, 2019
2 parents 46def4c + faf1e44 commit 2186cfa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libcontainer/cgroups/ebpf/ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ func LoadAttachCgroupDeviceFilter(insts asm.Instructions, license string, dirFD
nilCloser := func() error {
return nil
}
// Increase `ulimit -l` limit to avoid BPF_PROG_LOAD error (#2167).
// This limit is not inherited into the container.
memlockLimit := &unix.Rlimit{
Cur: unix.RLIM_INFINITY,
Max: unix.RLIM_INFINITY,
}
_ = unix.Setrlimit(unix.RLIMIT_MEMLOCK, memlockLimit)
spec := &ebpf.ProgramSpec{
Type: ebpf.CGroupDevice,
Instructions: insts,
Expand Down

0 comments on commit 2186cfa

Please sign in to comment.