[all-commits] [llvm/llvm-project] 522880: [compiler-rt][RISCV] Avoid using __init_riscv_feat...

Kito Cheng via All-commits all-commits at lists.llvm.org
Thu Nov 7 08:07:11 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 522880cb99b0573d8689eee083b28af18ff3f9c2
      https://github.com/llvm/llvm-project/commit/522880cb99b0573d8689eee083b28af18ff3f9c2
  Author: Kito Cheng <kito.cheng at sifive.com>
  Date:   2024-11-08 (Fri, 08 Nov 2024)

  Changed paths:
    M compiler-rt/lib/builtins/cpu_model/riscv.c

  Log Message:
  -----------
  [compiler-rt][RISCV] Avoid using __init_riscv_feature_bits as a direcโ€ฆ (#115316)

โ€ฆt constructor

`__init_riscv_feature_bits` takes an argument that can be
platform-specific, potentially pointing to the VDSO address of the
hwprobe system call for Linux. However, marking it as a constructor does
not guarantee that 0/NULL will always be passed to this argument, which
may result in treating an uninitialized or garbage value as a pointer to
hwprobe, leading to a crash.

The simplest solution is to introduce a small constructor function to
ensure that the platform-specific argument is set to 0/NULL.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list