CVE-2022-50828

Source
https://cve.org/CVERecord?id=CVE-2022-50828
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50828.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-50828
Downstream
Related
Published
2025-12-30T12:10:50.757Z
Modified
2026-03-20T11:47:38.842136Z
Summary
clk: zynqmp: Fix stack-out-of-bounds in strncpy`
Details

In the Linux kernel, the following vulnerability has been resolved:

clk: zynqmp: Fix stack-out-of-bounds in strncpy`

"BUG: KASAN: stack-out-of-bounds in strncpy+0x30/0x68"

Linux-ATF interface is using 16 bytes of SMC payload. In case clock name is longer than 15 bytes, string terminated NULL character will not be received by Linux. Add explicit NULL character at last byte to fix issues when clock name is longer.

This fixes below bug reported by KASAN:

================================================================== BUG: KASAN: stack-out-of-bounds in strncpy+0x30/0x68 Read of size 1 at addr ffff0008c89a7410 by task swapper/0/1

CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.4.0-00396-g81ef9e7-dirty #3 Hardware name: Xilinx Versal vck190 Eval board revA (QSPI) (DT) Call trace: dumpbacktrace+0x0/0x1e8 showstack+0x14/0x20 dumpstack+0xd4/0x108 printaddress_description.isra.0+0xbc/0x37c __kasanreport+0x144/0x198 kasanreport+0xc/0x18 __asanload1+0x5c/0x68 strncpy+0x30/0x68 zynqmpclockprobe+0x238/0x7b8 platformdrvprobe+0x6c/0xc8 reallyprobe+0x14c/0x418 driverprobedevice+0x74/0x130 __deviceattachdriver+0xc4/0xe8 busforeach_drv+0xec/0x150 __deviceattach+0x160/0x1d8 deviceinitialprobe+0x10/0x18 busprobedevice+0xe0/0xf0 deviceadd+0x528/0x950 ofdeviceadd+0x5c/0x80 ofplatformdevicecreatepdata+0x120/0x168 ofplatformbuscreate+0x244/0x4e0 ofplatformpopulate+0x50/0xe8 zynqmpfirmwareprobe+0x370/0x3a8 platformdrvprobe+0x6c/0xc8 reallyprobe+0x14c/0x418 driverprobedevice+0x74/0x130 devicedriverattach+0x94/0xa0 __driverattach+0x70/0x108 busforeachdev+0xe4/0x158 driverattach+0x30/0x40 busadddriver+0x21c/0x2b8 driverregister+0xbc/0x1d0 __platformdriverregister+0x7c/0x88 zynqmpfirmwaredriverinit+0x1c/0x24 dooneinitcall+0xa4/0x234 kernelinitfreeable+0x1b0/0x24c kernelinit+0x10/0x110 retfromfork+0x10/0x18

The buggy address belongs to the page: page:ffff0008f9be1c88 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 raw: 0008d00000000000 ffff0008f9be1c90 ffff0008f9be1c90 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff page dumped because: kasan: bad access detected

addr ffff0008c89a7410 is located in stack of task swapper/0/1 at offset 112 in frame: zynqmpclockprobe+0x0/0x7b8

this frame has 3 objects: [32, 44) 'response' [64, 80) 'ret_payload' [96, 112) 'name'

Memory state around the buggy address: ffff0008c89a7300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0008c89a7380: 00 00 00 00 f1 f1 f1 f1 00 04 f2 f2 00 00 f2 f2

ffff0008c89a7400: 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff0008c89a7480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0008c89a7500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50828.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5852b1365df4414523210e444ac7df1dec09acb4
Fixed
5dbfcf7b080306b65d9f756fadf46c9495793750
Fixed
d9e2585c3bcecb1c83febad31b9f450e93d2509e
Fixed
0a07b13af04d0db7325018aaa83b5ffe864790c9
Fixed
d66fea97671fcb516bd6d34bcc033f650ac7ee91
Fixed
bce41e4ac6f5ca3b22a07e8cdadc12044bbf9d3b
Fixed
dd80fb2dbf1cd8751efbe4e53e54056f56a9b115

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50828.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.2.0
Fixed
5.4.220
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.150
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.75
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.19.17
Type
ECOSYSTEM
Events
Introduced
5.20.0
Fixed
6.0.3

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50828.json"