Public bug reported:

In function ‘print_event_attr’,
    inlined from ‘main’ at ../../tests/perf_event_open.c:700:3:
../../tests/perf_event_open.c:173:25: error: array subscript ‘struct 
perf_event_attr[0]’ is partly outside array bounds of ‘unsigned char[136]’ 
[-Werror=array-bounds=]
  173 |         if (size != attr->size) {
      |                     ~~~~^~~~~~
../../tests/perf_event_open.c:158:16: note: object of size 136 allocated by 
‘calloc’
  158 |         attr = calloc(1, STRACE_PEA_SIZE);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../tests/perf_event_open.c:184:27: error: array subscript ‘struct 
perf_event_attr[0]’ is partly outside array bounds of ‘unsigned char[136]’ 
[-Werror=array-bounds=]
  184 |                attr->freq ? "sample_freq" : "sample_period",
      |                           ^
../../tests/perf_event_open.c:158:16: note: object of size 136 allocated by 
‘calloc’
  158 |         attr = calloc(1, STRACE_PEA_SIZE);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~

fixed upstream with
https://github.com/strace/strace/commit/5c1047a142d812c4c2eb397224d55c08cc595be9

** Affects: strace (Ubuntu)
     Importance: Undecided
     Assignee: Jonas Jelten (jj)
         Status: In Progress


** Tags: ftbfs

** Description changed:

  In function ‘print_event_attr’,
-     inlined from ‘main’ at ../../tests/perf_event_open.c:700:3:
+     inlined from ‘main’ at ../../tests/perf_event_open.c:700:3:
  ../../tests/perf_event_open.c:173:25: error: array subscript ‘struct 
perf_event_attr[0]’ is partly outside array bounds of ‘unsigned char[136]’ 
[-Werror=array-bounds=]
-   173 |         if (size != attr->size) {
-       |                     ~~~~^~~~~~
+   173 |         if (size != attr->size) {
+       |                     ~~~~^~~~~~
  ../../tests/perf_event_open.c:158:16: note: object of size 136 allocated by 
‘calloc’
-   158 |         attr = calloc(1, STRACE_PEA_SIZE);
-       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
+   158 |         attr = calloc(1, STRACE_PEA_SIZE);
+       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../tests/perf_event_open.c:184:27: error: array subscript ‘struct 
perf_event_attr[0]’ is partly outside array bounds of ‘unsigned char[136]’ 
[-Werror=array-bounds=]
-   184 |                attr->freq ? "sample_freq" : "sample_period",
-       |                           ^
+   184 |                attr->freq ? "sample_freq" : "sample_period",
+       |                           ^
  ../../tests/perf_event_open.c:158:16: note: object of size 136 allocated by 
‘calloc’
-   158 |         attr = calloc(1, STRACE_PEA_SIZE);
-       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
+   158 |         attr = calloc(1, STRACE_PEA_SIZE);
+       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ fixed upstream with
+ 
https://github.com/strace/strace/commit/5c1047a142d812c4c2eb397224d55c08cc595be9

** Changed in: strace (Ubuntu)
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2142855

Title:
  ftbfs: perf_event_attr size out of bounds

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/strace/+bug/2142855/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to