File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -420,11 +420,9 @@ func newProgramInfoFromFd(fd *sys.FD) (*ProgramInfo, error) {
420420 info2 .XlatedProgLen = info .XlatedProgLen
421421 info2 .XlatedProgInsns = sys .SlicePointer (pi .insns )
422422
423- // Linux kernel has a bug(?): if xlated_prog_len is specified and access is denied
424- // by kernel.kptr_restrict or net.core.bpf_jit_harden sysctls, the syscall doesn't only
425- // skip the xlated program's bytes, but other information as well.
426- // See handling of xlated_prog_insns in bpf_prog_get_info_by_fd in kernel/bpf/syscall.c.
427- // To avoid skipping other information, we specify xlated_prog_len in a separate syscall.
423+ // When kernel.kptr_restrict and net.core.bpf_jit_harden are both set, it causes the
424+ // syscall to abort when trying to readback xlated instructions, skipping other info
425+ // as well. So request xlated instructions seperately.
428426 if err := sys .ObjInfo (fd , & info2 ); err != nil {
429427 return nil , err
430428 }
You can’t perform that action at this time.
0 commit comments