Skip to content

lib/ubsan: Fix typo in integer-divide-by-zero config symbol - #1947

Open
Anand-240 wants to merge 1 commit into
unikraft:stagingfrom
Anand-240:lib-ubsan-fix-div-by-zero
Open

Anand-240 wants to merge 1 commit into
unikraft:stagingfrom
Anand-240:lib-ubsan-fix-div-by-zero

Conversation

@Anand-240

Copy link
Copy Markdown

Description of Changes

Fixes #1946.

The config symbol for the integer division by zero check is misspelled in lib/ubsan/Makefile.uk (ZEOR instead of ZERO), so the flag is never added in custom mode. This changes it to the name defined in Config.uk.

Tested on QEMU (kvm) for x86_64 and arm64 with a small app that divides by a volatile zero:

  • custom mode, option enabled: integer-divide-by-zero is now in the -fsanitize flags and UBSan reports "division by zero" (before this change there was no report)
  • custom mode, option disabled: the flag is not added
  • default mode (LIBUBSAN_GLOBAL_ON): same as before, still uses -fsanitize=undefined

Related Work

N/A

PR Checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation. (N/A, one line build fix)

Makefile.uk checks CONFIG_LIBUBSAN_SAN_DIV_BY_ZEOR, but Config.uk
defines LIBUBSAN_SAN_DIV_BY_ZERO. Because of the typo,
-fsanitize=integer-divide-by-zero is never added in custom mode,
even when the option is enabled.

Use the symbol name defined in Config.uk.

Signed-off-by: Anand Prakash Srivastava <srivastavaanandprakash16@gmail.com>
@github-actions github-actions Bot added area/lib Internal Unikraft Microlibrary lib/ubsan ubsan: Undefined Behavior Sanitization labels Oct 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/lib Internal Unikraft Microlibrary lib/ubsan ubsan: Undefined Behavior Sanitization

Projects

Status: 🧊 Icebox

Development

Successfully merging this pull request may close these issues.

lib/ubsan: integer-divide-by-zero sanitizer is never enabled in custom mode

1 participant