Skip to content

Conversation

@xairy
Copy link
Contributor

@xairy xairy commented Jun 11, 2018

No description provided.

@xairy xairy closed this Jun 11, 2018
fourkbomb pushed a commit to fourkbomb/linux that referenced this pull request Jul 1, 2018
When userspace unbinds gadget functions through configfs, the
.free_func() callback is always invoked. (in config_usb_cfg_unlink())
Implement it as a no-op to avoid the following crash:

[ 68.125679] configfs-gadget gadget: unbind function 'accessory'/ffffffc0720bf000
[ 68.133202] configfs-gadget gadget: unbind function 'audio_source'/ffffffc0012ca3c0
[ 68.142668] tegra-xudc 700d0000.usb-device: ep 0 disabled
[ 68.148186] Bad mode in Synchronous Abort handler detected, code 0x86000006
[ 68.155144] CPU: 2 PID: 1 Comm: init Tainted: G    U W 3.18.0-09419-g87296c3-dirty torvalds#561
[ 68.163743] Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
[ 68.169566] task: ffffffc0bc8d0000 ti: ffffffc0bc8bc000 task.ti: ffffffc0bc8bc000
[ 68.177039] PC is at 0x0
[ 68.179577] LR is at usb_put_function+0x14/0x1c
....

BUG=chrome-os-partner:49140
TEST="setprop sys.usb.config accessory,audio_source" on A44 and then
switch back to default: "setprop sys.usb.config mtp,adb", no crash will
be seen.

Change-Id: I5b6141964aab861e86e3afb139ded02d4d122dab
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/321013
Commit-Ready: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Insei pushed a commit to Insei/linux that referenced this pull request Jul 20, 2018
When userspace unbinds gadget functions through configfs, the
.free_func() callback is always invoked. (in config_usb_cfg_unlink())
Implement it as a no-op to avoid the following crash:

[ 68.125679] configfs-gadget gadget: unbind function 'accessory'/ffffffc0720bf000
[ 68.133202] configfs-gadget gadget: unbind function 'audio_source'/ffffffc0012ca3c0
[ 68.142668] tegra-xudc 700d0000.usb-device: ep 0 disabled
[ 68.148186] Bad mode in Synchronous Abort handler detected, code 0x86000006
[ 68.155144] CPU: 2 PID: 1 Comm: init Tainted: G    U W 3.18.0-09419-g87296c3-dirty torvalds#561
[ 68.163743] Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
[ 68.169566] task: ffffffc0bc8d0000 ti: ffffffc0bc8bc000 task.ti: ffffffc0bc8bc000
[ 68.177039] PC is at 0x0
[ 68.179577] LR is at usb_put_function+0x14/0x1c
....

BUG=chrome-os-partner:49140
TEST="setprop sys.usb.config accessory,audio_source" on A44 and then
switch back to default: "setprop sys.usb.config mtp,adb", no crash will
be seen.

Change-Id: I5b6141964aab861e86e3afb139ded02d4d122dab
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/321013
Commit-Ready: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Insei pushed a commit to Insei/linux that referenced this pull request Sep 28, 2018
When userspace unbinds gadget functions through configfs, the
.free_func() callback is always invoked. (in config_usb_cfg_unlink())
Implement it as a no-op to avoid the following crash:

[ 68.125679] configfs-gadget gadget: unbind function 'accessory'/ffffffc0720bf000
[ 68.133202] configfs-gadget gadget: unbind function 'audio_source'/ffffffc0012ca3c0
[ 68.142668] tegra-xudc 700d0000.usb-device: ep 0 disabled
[ 68.148186] Bad mode in Synchronous Abort handler detected, code 0x86000006
[ 68.155144] CPU: 2 PID: 1 Comm: init Tainted: G    U W 3.18.0-09419-g87296c3-dirty torvalds#561
[ 68.163743] Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
[ 68.169566] task: ffffffc0bc8d0000 ti: ffffffc0bc8bc000 task.ti: ffffffc0bc8bc000
[ 68.177039] PC is at 0x0
[ 68.179577] LR is at usb_put_function+0x14/0x1c
....

BUG=chrome-os-partner:49140
TEST="setprop sys.usb.config accessory,audio_source" on A44 and then
switch back to default: "setprop sys.usb.config mtp,adb", no crash will
be seen.

Change-Id: I5b6141964aab861e86e3afb139ded02d4d122dab
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/321013
Commit-Ready: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
vchong pushed a commit to linaro-swg/linux that referenced this pull request Oct 4, 2018
When userspace unbinds gadget functions through configfs, the
.free_func() callback is always invoked. (in config_usb_cfg_unlink())
Implement it as a no-op to avoid the following crash:

[ 68.125679] configfs-gadget gadget: unbind function 'accessory'/ffffffc0720bf000
[ 68.133202] configfs-gadget gadget: unbind function 'audio_source'/ffffffc0012ca3c0
[ 68.142668] tegra-xudc 700d0000.usb-device: ep 0 disabled
[ 68.148186] Bad mode in Synchronous Abort handler detected, code 0x86000006
[ 68.155144] CPU: 2 PID: 1 Comm: init Tainted: G    U W 3.18.0-09419-g87296c3-dirty torvalds#561
[ 68.163743] Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
[ 68.169566] task: ffffffc0bc8d0000 ti: ffffffc0bc8bc000 task.ti: ffffffc0bc8bc000
[ 68.177039] PC is at 0x0
[ 68.179577] LR is at usb_put_function+0x14/0x1c
....

BUG=chrome-os-partner:49140
TEST="setprop sys.usb.config accessory,audio_source" on A44 and then
switch back to default: "setprop sys.usb.config mtp,adb", no crash will
be seen.

Change-Id: I5b6141964aab861e86e3afb139ded02d4d122dab
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/321013
Commit-Ready: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
plbossart pushed a commit to plbossart/sound that referenced this pull request Nov 15, 2018
When userspace unbinds gadget functions through configfs, the
.free_func() callback is always invoked. (in config_usb_cfg_unlink())
Implement it as a no-op to avoid the following crash:

[ 68.125679] configfs-gadget gadget: unbind function 'accessory'/ffffffc0720bf000
[ 68.133202] configfs-gadget gadget: unbind function 'audio_source'/ffffffc0012ca3c0
[ 68.142668] tegra-xudc 700d0000.usb-device: ep 0 disabled
[ 68.148186] Bad mode in Synchronous Abort handler detected, code 0x86000006
[ 68.155144] CPU: 2 PID: 1 Comm: init Tainted: G    U W 3.18.0-09419-g87296c3-dirty torvalds#561
[ 68.163743] Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
[ 68.169566] task: ffffffc0bc8d0000 ti: ffffffc0bc8bc000 task.ti: ffffffc0bc8bc000
[ 68.177039] PC is at 0x0
[ 68.179577] LR is at usb_put_function+0x14/0x1c
....

BUG=chrome-os-partner:49140
TEST="setprop sys.usb.config accessory,audio_source" on A44 and then
switch back to default: "setprop sys.usb.config mtp,adb", no crash will
be seen.

Change-Id: I5b6141964aab861e86e3afb139ded02d4d122dab
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/321013
Commit-Ready: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
(cherry picked from commit e7264d37e1c568a25285493e3e2d6df7e5e8d731)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
saiprakash-ranjan pushed a commit to saiprakash-ranjan/linux that referenced this pull request Aug 19, 2019
When userspace unbinds gadget functions through configfs, the
.free_func() callback is always invoked. (in config_usb_cfg_unlink())
Implement it as a no-op to avoid the following crash:

[ 68.125679] configfs-gadget gadget: unbind function 'accessory'/ffffffc0720bf000
[ 68.133202] configfs-gadget gadget: unbind function 'audio_source'/ffffffc0012ca3c0
[ 68.142668] tegra-xudc 700d0000.usb-device: ep 0 disabled
[ 68.148186] Bad mode in Synchronous Abort handler detected, code 0x86000006
[ 68.155144] CPU: 2 PID: 1 Comm: init Tainted: G    U W 3.18.0-09419-g87296c3-dirty torvalds#561
[ 68.163743] Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
[ 68.169566] task: ffffffc0bc8d0000 ti: ffffffc0bc8bc000 task.ti: ffffffc0bc8bc000
[ 68.177039] PC is at 0x0
[ 68.179577] LR is at usb_put_function+0x14/0x1c
....

BUG=chrome-os-partner:49140
TEST="setprop sys.usb.config accessory,audio_source" on A44 and then
switch back to default: "setprop sys.usb.config mtp,adb", no crash will
be seen.

Change-Id: I5b6141964aab861e86e3afb139ded02d4d122dab
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/321013
Commit-Ready: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
(cherry picked from commit e7264d37e1c568a25285493e3e2d6df7e5e8d731)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
derkling pushed a commit to derkling/linux that referenced this pull request Sep 14, 2019
When userspace unbinds gadget functions through configfs, the
.free_func() callback is always invoked. (in config_usb_cfg_unlink())
Implement it as a no-op to avoid the following crash:

[ 68.125679] configfs-gadget gadget: unbind function 'accessory'/ffffffc0720bf000
[ 68.133202] configfs-gadget gadget: unbind function 'audio_source'/ffffffc0012ca3c0
[ 68.142668] tegra-xudc 700d0000.usb-device: ep 0 disabled
[ 68.148186] Bad mode in Synchronous Abort handler detected, code 0x86000006
[ 68.155144] CPU: 2 PID: 1 Comm: init Tainted: G    U W 3.18.0-09419-g87296c3-dirty torvalds#561
[ 68.163743] Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
[ 68.169566] task: ffffffc0bc8d0000 ti: ffffffc0bc8bc000 task.ti: ffffffc0bc8bc000
[ 68.177039] PC is at 0x0
[ 68.179577] LR is at usb_put_function+0x14/0x1c
....

BUG=chrome-os-partner:49140
TEST="setprop sys.usb.config accessory,audio_source" on A44 and then
switch back to default: "setprop sys.usb.config mtp,adb", no crash will
be seen.

Change-Id: I5b6141964aab861e86e3afb139ded02d4d122dab
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/321013
Commit-Ready: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
ojeda added a commit to ojeda/linux that referenced this pull request Nov 24, 2021
confdata: handle `S_HEX` case like the C printer
ddiss pushed a commit to ddiss/linux that referenced this pull request Feb 14, 2025
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Jul 26, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Jul 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Jul 30, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Jul 30, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Jul 30, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 5, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 9, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 13, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 14, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 17, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 19, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 21, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 23, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 28, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Aug 29, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Sep 2, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Sep 5, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Sep 8, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Sep 10, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Sep 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Sep 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 1, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 10, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 11, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 15, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 20, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 21, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 21, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 21, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 27, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 28, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Oct 30, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 3, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 5, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 5, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 7, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 15, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 16, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 20, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 22, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 23, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 23, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 23, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 25, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
guidosarducci added a commit to guidosarducci/linux that referenced this pull request Nov 26, 2025
This BPF assembly test accesses a struct field using a fixed offset based
on a 64-bit environment, without any debug info usable for relocation or
rewriting of accesses. This fails on 32-bit armhf:

  tester_init:PASS:tester_log_buf 0 nsec
  process_subtest:PASS:obj_open_mem 0 nsec
  process_subtest:PASS:specs_alloc 0 nsec
  run_subtest:PASS:obj_open_mem 0 nsec
  libbpf: prog 'resolve_typedef': BPF program load failed: -EACCES
  libbpf: prog 'resolve_typedef': failed to load: -EACCES
  libbpf: failed to load object 'verifier_typedef'
  run_subtest:FAIL:unexpected_load_failure unexpected error: -13 (errno 13)
  VERIFIER LOG:
  =============
  Global function resolve_typedef() doesn't return scalar. Only those are supported.
  0: R1=ctx() R10=fp0
  ; asm volatile ("                                       \ @ verifier_typedef.c:12
  0: (79) r1 = *(u64 *)(r1 +0)
  func 'bpf_fentry_test_sinfo' arg0 has btf_id 10943 type STRUCT 'skb_shared_info'
  1: R1_w=ptr_skb_shared_info()
  1: (79) r2 = *(u64 *)(r1 +56)
  access beyond the end of member netmem (mend:4) in struct skb_frag with off 0 size 8
  processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
  =============
  torvalds#561/1   verifier_typedef/typedef: resolve:FAIL
  torvalds#561     verifier_typedef:FAIL

Fix this by rewriting resolve_typedef() in C with explicit field references
which can be run-time patched, resulting in 32-bit appropriate code:

  int resolve_typedef(unsigned long long * ctx):
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     0: (b7) r2 = 44
  ; int BPF_PROG(resolve_typedef, struct skb_shared_info *si)
     1: (79) r1 = *(u64 *)(r1 +0)
     2: (0f) r1 += r2
  ; volatile netmem_ref tmp __attribute__((unused)) = si->frags->netmem;
     3: (61) r1 = *(u32 *)(r1 +0)

Fixes: 2597a25 ("selftests/bpf: Add test to exercise typedef walking")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant