perf bpf augmented_raw_syscalls: Add an assert to make sure sizeof(augmented_arg...
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 21 Aug 2023 13:40:09 +0000 (10:40 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 21 Aug 2023 13:49:31 +0000 (10:49 -0300)
commit7d9642311b6d9d319a6948581244561d2a0890a1
tree09e7bbf99f86f01ec312a9defa668c8148ba0f99
parent262b54b6c9396823ab06df46a1be475c44b28b5f
perf bpf augmented_raw_syscalls: Add an assert to make sure sizeof(augmented_arg->value) is a power of two.

Similar to what was done in the previous cset for sizeof(saddr), we need
to make sure sizeof(augmented_arg->value) is a power of two to do bounds
checking using &=:

  augmented_len &= sizeof(augmented_arg->value) - 1;

Suggested-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZONrPo0NSqdbXiGx@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c