Mitigate Baron SameEdit (CVE-2021-3156) vulnerability

centos 7
integer weakness #7


Weakness Breakdown


An integer overflow occurs when the answer to an arithmetic operation exceeds the maximum size of the integer type used to store it. The resulting value will appear to have wrapped around the maximum value and started again at the minimum value. This would look like a clock that represents 13:00 by pointing at 1:00. An attacker can use an integer overflow during a buffer length calculation, which results in the allocated buffer being too small to hold the data copied into it, thus causing a buffer overflow.

Warning code(s):

Unless checked, the resulting number can exceed the expected range.

File Name:



The highlighted line of code below is the trigger point of this particular Centos 7 integer weakness.



  return handle_get_next_errno(errno);

void usage(void)
  printf("BPF Program Snapshot (bps):\n"
         "List of all BPF programs loaded into the system.\n\n");
  printf("Usage: bps [bpf-prog-id]\n");
  printf("    [bpf-prog-id] If specified, it shows the details info of the bpf-prog\n");

int main(int argc, char **argv)
  if (argc > 1) {
    if (!isdigit(*argv[1])) {
      return EX_USAGE;
    return print_one_prog((uint32_t)atoi(argv[1]));

  return print_all_progs();

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.