bisect between -83 and -85 suggests that:
17e95e1a51d798696a62769c26a12fb16c9ac881 is the first bad commit
commit 17e95e1a51d798696a62769c26a12fb16c9ac881
Author: Andrii Nakryiko <email address hidden>
Date: Mon May 8 23:55:02 2023 -0700
libbpf: fix offsetof() and container_of() to work with CO-RE
It seems like __builtin_offset() doesn't preserve CO-RE field
relocations properly. So if offsetof() macro is defined through
__builtin_offset(), CO-RE-enabled BPF code using container_of() will be
subtly and silently broken.
To avoid this problem, redefine offsetof() and container_of() in the
form that works with CO-RE relocations more reliably.
$ git bisect log
git bisect start
# bad: [bcea2f888a5b1ffaa03951efa43840e10f1bda66] UBUNTU: Ubuntu-5.15.0-85.95
git bisect bad bcea2f888a5b1ffaa03951efa43840e10f1bda66
# good: [294374341c622e5c2ffd15712cadabe0dd9865f1] UBUNTU: Ubuntu-5.15.0-83.92
git bisect good 294374341c622e5c2ffd15712cadabe0dd9865f1
# bad: [c57a826d3343214967f1b09cac263004d6bbc240] arm64: dts: qcom: Drop unneeded extra device-specific includes
git bisect bad c57a826d3343214967f1b09cac263004d6bbc240
# good: [2ba31156e2f29be421a3d38c49efb071af327810] cgroup: Do not corrupt task iteration when rebinding subsystem
git bisect good 2ba31156e2f29be421a3d38c49efb071af327810
# good: [1d4a282191f29ae9d50b936902a88829cd8b0169] rcutorture: Correct name of use_softirq module parameter
git bisect good 1d4a282191f29ae9d50b936902a88829cd8b0169
# bad: [eced7b1344d4d34b2012095f21a8433c326ba80d] bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings
git bisect bad eced7b1344d4d34b2012095f21a8433c326ba80d
# bad: [9f49a01dcfe9610da203312a25136dd6ec390cc1] regulator: core: Streamline debugfs operations
git bisect bad 9f49a01dcfe9610da203312a25136dd6ec390cc1
# good: [3e348272984fc81fa850326aa722e5b63520d40b] wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation
git bisect good 3e348272984fc81fa850326aa722e5b63520d40b
# good: [3f64b9b253e3200c56d725676b110c47b8e2c52d] sctp: add bpf_bypass_getsockopt proto callback
git bisect good 3f64b9b253e3200c56d725676b110c47b8e2c52d
# bad: [cc12b4a5c0bb03dc94e113e2be6d01d1d57c22cc] spi: dw: Round of n_bytes to power of 2
git bisect bad cc12b4a5c0bb03dc94e113e2be6d01d1d57c22cc
# bad: [e340c66481d14e4534ef03f543e1188d31c0f617] bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen
git bisect bad e340c66481d14e4534ef03f543e1188d31c0f617
# bad: [17e95e1a51d798696a62769c26a12fb16c9ac881] libbpf: fix offsetof() and container_of() to work with CO-RE
git bisect bad 17e95e1a51d798696a62769c26a12fb16c9ac881
# first bad commit: [17e95e1a51d798696a62769c26a12fb16c9ac881] libbpf: fix offsetof() and container_of() to work with CO-RE
Reverting 17e95e1a51d798696a62769c26a12fb16c9ac881 can make this work again.
bisect between -83 and -85 suggests that: 96a62769c26a12f b16c9ac881 is the first bad commit 96a62769c26a12f b16c9ac881
17e95e1a51d7986
commit 17e95e1a51d7986
Author: Andrii Nakryiko <email address hidden>
Date: Mon May 8 23:55:02 2023 -0700
libbpf: fix offsetof() and container_of() to work with CO-RE
BugLink: https:/ /bugs.launchpad .net/bugs/ 2032689
[ Upstream commit bdeeed3498c7871 c17465bb4f11d1b c67f9098af ]
It seems like __builtin_offset() doesn't preserve CO-RE field offset( ), CO-RE-enabled BPF code using container_of() will be
relocations properly. So if offsetof() macro is defined through
__builtin_
subtly and silently broken.
To avoid this problem, redefine offsetof() and container_of() in the
form that works with CO-RE relocations more reliably.
Fixes: 5fbc220862fc ("tools/libpf: Add offsetof/ container_ of macro in bpf_helpers.h")
Reported-by: Lennart Poettering <email address hidden>
Signed-off-by: Andrii Nakryiko <email address hidden>
Acked-by: Yonghong Song <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Alexei Starovoitov <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Stefan Bader <email address hidden>
tools/ lib/bpf/ bpf_helpers. h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
$ git bisect log faa03951efa4384 0e10f1bda66] UBUNTU: Ubuntu-5.15.0-85.95 aa03951efa43840 e10f1bda66 5c2ffd15712cada be0dd9865f1] UBUNTU: Ubuntu-5.15.0-83.92 c2ffd15712cadab e0dd9865f1 4967f1b09cac263 004d6bbc240] arm64: dts: qcom: Drop unneeded extra device-specific includes 967f1b09cac2630 04d6bbc240 e421a3d38c49efb 071af327810] cgroup: Do not corrupt task iteration when rebinding subsystem 421a3d38c49efb0 71af327810 e9d50b936902a88 829cd8b0169] rcutorture: Correct name of use_softirq module parameter 9d50b936902a888 29cd8b0169 4b2012095f21a84 33c326ba80d] bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings b2012095f21a843 3c326ba80d 0da203312a25136 dd6ec390cc1] regulator: core: Streamline debugfs operations da203312a25136d d6ec390cc1 1fa850326aa722e 5b63520d40b] wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation fa850326aa722e5 b63520d40b 0c56d725676b110 c47b8e2c52d] sctp: add bpf_bypass_ getsockopt proto callback c56d725676b110c 47b8e2c52d dc94e113e2be6d0 1d1d57c22cc] spi: dw: Round of n_bytes to power of 2 c94e113e2be6d01 d1d57c22cc 4534ef03f543e11 88d31c0f617] bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen 534ef03f543e118 8d31c0f617 696a62769c26a12 fb16c9ac881] libbpf: fix offsetof() and container_of() to work with CO-RE 96a62769c26a12f b16c9ac881 696a62769c26a12 fb16c9ac881] libbpf: fix offsetof() and container_of() to work with CO-RE
git bisect start
# bad: [bcea2f888a5b1f
git bisect bad bcea2f888a5b1ff
# good: [294374341c622e
git bisect good 294374341c622e5
# bad: [c57a826d334321
git bisect bad c57a826d3343214
# good: [2ba31156e2f29b
git bisect good 2ba31156e2f29be
# good: [1d4a282191f29a
git bisect good 1d4a282191f29ae
# bad: [eced7b1344d4d3
git bisect bad eced7b1344d4d34
# bad: [9f49a01dcfe961
git bisect bad 9f49a01dcfe9610
# good: [3e348272984fc8
git bisect good 3e348272984fc81
# good: [3f64b9b253e320
git bisect good 3f64b9b253e3200
# bad: [cc12b4a5c0bb03
git bisect bad cc12b4a5c0bb03d
# bad: [e340c66481d14e
git bisect bad e340c66481d14e4
# bad: [17e95e1a51d798
git bisect bad 17e95e1a51d7986
# first bad commit: [17e95e1a51d798
Reverting 17e95e1a51d7986 96a62769c26a12f b16c9ac881 can make this work again.