Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

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

EPSS 0.21% · P11

Possible ATT&CK Techniques 1AI

T1203 · Exploitation for Client Execution

Affected Version Matrix 8

VendorProductVersion RangeStatus
LinuxLinux3009f891bb9f328945ebd5b71e12df7e2467f3dd< ed42391164e6839a48aaf4c53eefda516835e799affected
3009f891bb9f328945ebd5b71e12df7e2467f3dd< 5d59ad2bfb35fccfe2ad5e8bb8801f6224d3f7d4affected
3009f891bb9f328945ebd5b71e12df7e2467f3dd< d07c0acb4f41cc42a0d97530946965b3e4fa68c1affected
5.16affected
< 5.16unaffected
5.19.17≤ 5.19.*unaffected
6.0.3≤ 6.0.*unaffected
6.1≤ *unaffected
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2022-50778

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
fortify: Fix __compiletime_strlen() under UBSAN_BOUNDS_LOCAL
Source: CVE Program / CVE List V5
Vulnerability Description
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.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于__compiletime_strlen在UBSAN_BOUNDS_LOCAL下可能返回最大可能大小,可能导致越界读取。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
LinuxLinux 3009f891bb9f328945ebd5b71e12df7e2467f3dd ~ ed42391164e6839a48aaf4c53eefda516835e799 -
LinuxLinux 5.16 -

II. Public POCs for CVE-2022-50778

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2022-50778

登录查看更多情报信息。

Other References for CVE-2022-50778 (2)

Same Patch Batch · Linux · 2025-12-24 · 322 CVEs total

CVE-2025-687459.8 CRITICALscsi: qla2xxx: Clear cmds after chip reset
CVE-2025-683599.8 CRITICALbtrfs: fix double free of qgroup record after failure to add delayed ref head
CVE-2025-687419.8 CRITICALscsi: qla2xxx: Fix improper freeing of purex item
CVE-2025-687269.8 CRITICALcrypto: aead - Fix reqsize handling
CVE-2025-687368.8 HIGHlandlock: Fix handling of disconnected directories
CVE-2025-683608.2 HIGHwifi: mt76: wed: use proper wed reference in mt76 wed driver callabacks
CVE-2025-683658.2 HIGHfs/ntfs3: Initialize allocated memory before use
CVE-2025-687357.8 HIGHdrm/panthor: Prevent potential UAF in group creation
CVE-2025-687307.8 HIGHaccel/ivpu: Fix page fault in ivpu_bo_unbind_all_bos_from_context()
CVE-2025-683707.8 HIGHcoresight: tmc: add the handle of the event to the path
CVE-2025-683797.8 HIGHRDMA/rxe: Fix null deref on srq->rq.queue after resize failure
CVE-2025-687247.8 HIGHcrypto: asymmetric_keys - prevent overflow in asymmetric_key_generate_id
CVE-2025-683527.8 HIGHspi: ch341: fix out-of-bounds memory access in ch341_transfer_one
CVE-2025-687487.8 HIGHdrm/panthor: Fix UAF race between device unplug and FW event processing
CVE-2025-687477.8 HIGHdrm/panthor: Fix UAF on kernel BO VA nodes
CVE-2025-687497.8 HIGHaccel/ivpu: Fix race condition when unbinding BOs
CVE-2025-683477.8 HIGHALSA: firewire-motu: fix buffer overflow in hwdep read for DSP events
CVE-2025-687467.8 HIGHspi: tegra210-quad: Fix timeout handling
CVE-2025-683497.5 HIGHNFSv4/pNFS: Clear NFS_INO_LAYOUTCOMMIT in pnfs_mark_layout_stateid_invalid
CVE-2025-683697.5 HIGHntfs3: init run lock for extend inode

Showing top 20 of 322 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2022-50778

No comments yet


Leave a comment