LiveActive security incident?Get immediate response
CVE Record

CVE-2022-50778: fortify: Fix __compiletime_strlen() under UBSAN_BOUNDS_LOCAL

In the Linux kernel, the following vulnerability has been resolved: fortify: Fix __compiletime_strlen() under UBSAN_BOUNDS_LOCAL With CONFIG_FORTIFY=y and CONFIG_UBSAN_LOCAL_BOUNDS=y enabled, we observe a runtime panic while running Android's Compatibility Test Suite's (CTS) android.hardware.input.cts.tests. This is stemming from a strlen() call in hidinput_allocate(). __compiletime_strlen() is implemented in terms of __builtin_object_size(), then does an array access to check for NUL-termination. A quirk of __builtin_object_size() is that for strings whose values are runtime dependent, __builtin_object_size(str, 1 or 0) returns the maximum size of possible values when those sizes are determinable at compile time. Example: static const char *v = "FOO BAR"; static const char *y = "FOO BA"; unsigned long x (int z) { // Returns 8, which is: // max(__builtin_object_size(v, 1), __builtin_object_size(y, 1)) return __builtin_object_size(z ? v : y, 1); } So when FORTIFY_SOURCE is enabled, the current implementation of __compiletime_strlen() will try to access beyond the end of y at runtime using the size of v. Mixed with UBSAN_LOCAL_BOUNDS we get a fault. hidinput_allocate() has a local C string whose value is control flow dependent on a switch statement, so __builtin_object_size(str, 1) evaluates to the maximum string length, making all other cases fault on the last character check. hidinput_allocate() could be cleaned up to avoid runtime calls to strlen() since the local variable can only have literal values, so there's no benefit to trying to fortify the strlen call site there. Perform a __builtin_constant_p() check against index 0 earlier in the macro to filter out the control-flow-dependant case. Add a KUnit test for checking the expected behavioral characteristics of FORTIFY_SOURCE internals.

UnknownCVSS not scoredNot KEV-listedUpdated
Glexia's TakeAutomated analysisunknown

Security readout for executives and security teams

Plain-English summary

This Linux kernel issue can cause a runtime panic when specific hardening and sanitizer options are enabled. The public record describes a crash seen during Android CTS input tests, not data theft or remote compromise. Business urgency depends on whether your kernels use these build options and affected versions.

Executive priority

Treat as targeted kernel stability risk, not a confirmed breach-enabling vulnerability. Prioritize validation for Android, test, or hardened kernel environments using UBSAN local bounds. Patch through normal kernel maintenance unless affected systems show crashes or support critical workloads.

Technical view

With CONFIG_FORTIFY=y and CONFIG_UBSAN_LOCAL_BOUNDS=y, __compiletime_strlen() can use a maximum compile-time object size for control-flow-dependent strings, then read past a shorter literal during a NUL check. UBSAN local bounds turns this into a fault. The cited fix changes the macro logic and adds KUnit coverage.

Likely exposure

Exposure appears limited to Linux kernels in the affected record, especially builds enabling both CONFIG_FORTIFY and CONFIG_UBSAN_LOCAL_BOUNDS. Android-related testing triggered the issue in hidinput_allocate(). The record lists Linux 5.16, 5.19.17, 6.0.3, and 6.1 as affected, but version range details are incomplete.

Exploitation context

No cited source states active exploitation, and this CVE is not marked KEV in the provided data. The documented trigger is a runtime panic during Android Compatibility Test Suite input tests. Public evidence does not establish remote exploitability or attacker-controlled triggering conditions.

Researcher notes

The record describes a fortify macro correctness bug involving __builtin_object_size() and control-flow-dependent string literals. Evidence supports a bounds sanitizer panic, but not a confidentiality or privilege impact. Affected-version metadata is sparse, so validate against kernel commits and downstream backports.

Mitigation direction

  • Check vendor or distribution advisories for patched kernel packages.
  • Prioritize kernels built with both FORTIFY and UBSAN local bounds enabled.
  • Apply kernel updates containing the referenced stable fixes when available.
  • If vendor-approved, avoid unpatched production builds with the triggering configuration.

Validation and detection

  • Inventory deployed Linux kernel versions against the CVE affected record.
  • Check kernel configuration for CONFIG_FORTIFY and CONFIG_UBSAN_LOCAL_BOUNDS.
  • Confirm whether referenced stable commits are present in your kernel tree.
  • Review crash logs for UBSAN bounds faults around fortified strlen paths.
Prepared
Confidence
medium
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cve · low confidence lookup

CVE-2022-50778 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Unknown
CVSS
Not scored
Known Exploited
No
Published
Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

0CVSS vectors
0Timeline events
0ADP providers
4Source links

CVSS and timeline data

No CVSS vectors or timeline events were available in the normalized CVE source material.

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
LinuxLinux3009f891bb9f328945ebd5b71e12df7e2467f3dd, 3009f891bb9f328945ebd5b71e12df7e2467f3dd, 3009f891bb9f328945ebd5b71e12df7e2467f3ddunaffected
LinuxLinux5.16, 0, 5.19.17, 6.0.3, 6.1affected
Weakness

CWE details

No CWE listed

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.