lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAej5Na29DMoQmiXn1VThLH2e3hqvBWqXB8Ah5sPv0Cm-csarQ@mail.gmail.com>
Date:   Sat, 19 Oct 2019 15:10:25 +0000
From:   Fejes Ferenc <fejes@....elte.hu>
To:     Andrii Nakryiko <andrii.nakryiko@...il.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: Error when loading BPF_CGROUP_INET_EGRESS program with bpftool

Sorry for the late reply. I have some time to try it again.
I downloaded a fresh Ubuntu 19.10 image, which have bpftool included
from the linux-tools-generic package. Then tried to load a program
with 0 or 1 return code: both works.
After that I tried to load the original program, with return code 2 or
3 and got the same error message.

> What was the error message you got after you provided correct program
> attach type?

sudo bpftool prog loadall hbm.o /sys/fs/bpf/hbm2 type cgroup_skb/egress

libbpf: load bpf program failed: Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
; return ALLOW_PKT | REDUCE_CW;
0: (b7) r0 = 3
1: (95) exit
At program exit the register R0 has value (0x3; 0x0) should have been
in (0x0; 0x1)
processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0
peak_states 0 mark_read 0

libbpf: -- END LOG --
libbpf: failed to load program 'cgroup_skb/egress'
libbpf: failed to load object 'hbm.o'
Error: failed to load object file

Same command with strace:
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_CGROUP_SKB, insn_cnt=2,
insns=0x558889b59ba0, license="GPL", log_level=0, log_size=0,
log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0,
prog_name="hbm", prog_ifindex=0,
expected_attach_type=BPF_CGROUP_INET_INGRESS, ...}, 112) = -1 EINVAL
(Invalid argument)
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_CGROUP_SKB, insn_cnt=2,
insns=0x558889b59ba0, license="GPL", log_level=1, log_size=16777215,
log_buf="", kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0,
prog_name="hbm", prog_ifindex=0,
expected_attach_type=BPF_CGROUP_INET_INGRESS, ...}, 112) = -1 EINVAL
(Invalid argument)

Strace error is the same, even if I manually set the type to cgroup_skb/egress:
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_CGROUP_SKB, insn_cnt=2,
insns=0x55ae46296ba0, license="GPL", log_level=0, log_size=0,
log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0,
prog_name="hbm", prog_ifindex=0,
expected_attach_type=BPF_CGROUP_INET_INGRESS, ...}, 112) = -1 EINVAL
(Invalid argument)
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_CGROUP_SKB, insn_cnt=2,
insns=0x55ae46296ba0, license="GPL", log_level=1, log_size=16777215,
log_buf="", kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0,
prog_name="hbm", prog_ifindex=0,
expected_attach_type=BPF_CGROUP_INET_INGRESS, ...}, 112) = -1 EINVAL
(Invalid argument)

I noticed you did a major restructuring in libbpf, I will try out
whether my problem still exist with the new version.

Ferenc

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ