Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stringop overflow warnings '__orig_snprintf' specified size ... exceeds maximum object size #68

Open
ncopa opened this issue Oct 3, 2024 · 1 comment
Labels

Comments

@ncopa
Copy link
Contributor

ncopa commented Oct 3, 2024

There are some string op overflow warnings (32 bit I think):

In file included from /home/buildozer/aports/community/libindi/src/indi-2.0.9/libs/dsp/dsp.h:41,
                 from /home/buildozer/aports/community/libindi/src/indi-2.0.9/libs/dsp/file.c:20:
In function 'sprintf',
    inlined from 'dsp_file_write_fits' at /home/buildozer/aports/community/libindi/src/indi-2.0.9/libs/dsp/file.c:225:13:
/usr/include/fortify/stdio.h:303:15: warning: '__orig_snprintf' specified size 4294967295 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
  303 |         __r = __orig_snprintf(__s, __b, __f, __builtin_va_arg_pack());
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When compiling kernel this end up as error (64 bit example):

  CALL    /home/ncopa/aports/main/linux-lts/src/linux-6.6/scripts/checksyscalls.sh
In file included from libbpf.c:17:
In function 'sprintf',
    inlined from 'bpf_object__init_user_btf_map' at libbpf.c:2603:3,
    inlined from 'bpf_object__init_user_btf_maps' at libbpf.c:2656:9,
    inlined from 'bpf_object__init_maps' at libbpf.c:2677:8:
/usr/include/fortify/stdio.h:303:15: error: '__orig_snprintf' specified size 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
  303 |         __r = __orig_snprintf(__s, __b, __f, __builtin_va_arg_pack());
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'bpf_object__init_user_btf_map',
    inlined from 'bpf_object__init_user_btf_maps' at libbpf.c:2656:9,
    inlined from 'bpf_object__init_maps' at libbpf.c:2677:8:
libbpf.c:2601:36: note: destination object allocated here
 2601 |                 if (!map->inner_map->name)
      |                      ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/fortify/stdlib.h:27,
                 from libbpf.c:16:
/usr/include/fortify/stdio.h: In function 'bpf_object__init_maps':
/usr/include/fortify/stdio.h:274:1: note: in a call to function '__orig_snprintf' declared with attribute 'access (read_only, 3)'
  274 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
      | ^~~~~~~~~~~
cc1: all warnings being treated as errors
@jvoisin
Copy link
Owner

jvoisin commented Oct 10, 2024

This has been mitigated in c3b48c6 by disabling snprintf hardening for now.

@jvoisin jvoisin added the bug label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants