CVE-2023-53513
kernel: nbd: fix incomplete validation of ioctl arg
Overview
Description
In the Linux kernel, the following vulnerability has been resolved:
nbd: fix incomplete validation of ioctl arg
We tested and found an alarm caused by nbd_ioctl arg without verification.
The UBSAN warning calltrace like below:
UBSAN: Undefined behaviour in fs/buffer.c:1709:35
signed integer overflow:
-9223372036854775808 - 1 cannot be represented in type 'long long int'
CPU: 3 PID: 2523 Comm: syz-executor.0 Not tainted 4.19.90 #1
Hardware name: linux,dummy-virt (DT)
Call trace:
dump_backtrace+0x0/0x3f0 arch/arm64/kernel/time.c:78
show_stack+0x28/0x38 arch/arm64/kernel/traps.c:158
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x170/0x1dc lib/dump_stack.c:118
ubsan_epilogue+0x18/0xb4 lib/ubsan.c:161
handle_overflow+0x188/0x1dc lib/ubsan.c:192
__ubsan_handle_sub_overflow+0x34/0x44 lib/ubsan.c:206
__block_write_full_page+0x94c/0xa20 fs/buffer.c:1709
block_write_full_page+0x1f0/0x280 fs/buffer.c:2934
blkdev_writepage+0x34/0x40 fs/block_dev.c:607
__writepage+0x68/0xe8 mm/page-writeback.c:2305
write_cache_pages+0x44c/0xc70 mm/page-writeback.c:2240
generic_writepages+0xdc/0x148 mm/page-writeback.c:2329
blkdev_writepages+0x2c/0x38 fs/block_dev.c:2114
do_writepages+0xd4/0x250 mm/page-writeback.c:2344
The reason for triggering this warning is __block_write_full_page()
-> i_size_read(inode) - 1 overflow.
inode->i_size is assigned in __nbd_ioctl() -> nbd_set_size() -> bytesize.
We think it is necessary to limit the size of arg to prevent errors.
Moreover, __nbd_ioctl() -> nbd_add_socket(), arg will be cast to int.
Assuming the value of arg is 0x80000000000000001) (on a 64-bit machine),
it will become 1 after the coercion, which will return unexpected results.
Fix it by adding checks to prevent passing in too large numbers.
Source: OX vulnerability database
Severity
5.5 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weakness: CWE-674
Affected packages · 0
No registry package. This ID affects operating system packages only.
Operating systems · 70 fixes
Oracle Linux 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 8 | bpftool +19 | 4.18.0-553.87.1.el8_10 |
Red Hat 2 releases · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 8 | bpftool +16 | 0:4.18.0-193.187.1.el8_2 | RHSA-2026:3388 |
| 8 | bpftool +16 | 0:4.18.0-305.183.1.el8_4 | RHSA-2026:0533 |
| 8 | bpftool +21 | 0:4.18.0-372.175.1.el8_6 | RHSA-2026:0536 |
| 8 | bpftool +16 | 0:4.18.0-477.124.1.el8_8 | RHSA-2026:0532 |
| 8 | bpftool +22 | 0:4.18.0-553.87.1.el8_10 | RHSA-2025:22388 |
| 8 | kernel-rt +11 | 0:4.18.0-553.87.1.rt7.428.el8_10 | RHSA-2025:22387 |
8 more rows
SUSE Linux Enterprise 1 release · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | kernel-livepatch-5-14-21-150400-24-179-default | 1-150400.9.3.1 | SUSE-SU-2025:03628-1 |
| 15.4 | cluster-md-kmp-default +17 | 5.14.21-150400.24.179.1 | SUSE-SU-2025:03628-1 |
| 15.4 | kernel-default-base | 5.14.21-150400.24.179.1.150400.24.92.1 | SUSE-SU-2025:03628-1 |
SUSE Linux Enterprise Micro 2 releases · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.3 | kernel-rt +1 | 5.14.21-150400.15.133.1 | SUSE-SU-2025:3716-1 |
| 5.3 | kernel-default | 5.14.21-150400.24.179.1 | SUSE-SU-2025:03628-1 |
| 5.3 | kernel-default-base | 5.14.21-150400.24.179.1.150400.24.92.1 | SUSE-SU-2025:03628-1 |
| 5.4 | kernel-rt +1 | 5.14.21-150400.15.133.1 | SUSE-SU-2025:3716-1 |
| 5.4 | kernel-default | 5.14.21-150400.24.179.1 | SUSE-SU-2025:03628-1 |
| 5.4 | kernel-default-base | 5.14.21-150400.24.179.1.150400.24.92.1 | SUSE-SU-2025:03628-1 |
alma 1 release · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 8 | bpftool +19 | 4.18.0-553.87.1.el8_10 |
| 8 | kernel-rt +9 | 4.18.0-553.87.1.rt7.428.el8_10 |
amazon linux 1 release · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 2023 | kernel-livepatch-6-1-34-56-100 | 1.0-0.amzn2023 |
| 2023 | bpftool +17 | 6.1.34-56.100.amzn2023 |
debian 4 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux | affected |
| 12 | linux | 6.1.37-1 |
| 13 | linux | 6.3.7-1 |
| 14 | linux | 6.3.7-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| linux | 6.3.7-1 |
rocky 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 8 | bpftool +17 | 4.18.0-553.87.1.el8_10 |
root.io debian 3 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux +1 | 5.10.251-5.root.io.85 |
| 12 | rootio-linux | 6.1.37-1 |
| 13 | rootio-linux | 6.3.7-1 |
root.io ubuntu 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 22.04 | rootio-linux | 5.15.0-83.92 |
ubuntu 3 releases · 23 packages
| Release | Package | Fixed in |
|---|---|---|
| 20.04 | linux-nvidia-tegra-5-15 | 5.15.0-1017.17~20.04.1 |
| 20.04 | linux-ibm-5-15 | 5.15.0-1037.40~20.04.1 |
| 20.04 | linux-riscv-5-15 | 5.15.0-1040.44~20.04.3 |
| 20.04 | linux-intel-iotg-5-15 | 5.15.0-1040.46~20.04.1 |
| 20.04 | linux-gcp-5-15 | 5.15.0-1041.49~20.04.1 |
| 20.04 | linux-oracle-5-15 | 5.15.0-1042.48~20.04.1 |
26 more rows
References
- access.redhat.com https://access.redhat.com/errata/RHSA-2025:22388
- access.redhat.com https://access.redhat.com/security/cve/CVE-2023-53513
- bugzilla.redhat.com https://bugzilla.redhat.com/2393172
- bugzilla.redhat.com https://bugzilla.redhat.com/2395792
- bugzilla.redhat.com https://bugzilla.redhat.com/2397553
- bugzilla.redhat.com https://bugzilla.redhat.com/2400598
- bugzilla.redhat.com https://bugzilla.redhat.com/2400795
- bugzilla.redhat.com https://bugzilla.redhat.com/2402699
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2393172
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2395792
Show all 33 references
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2397553
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2400598
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2400795
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2402699
- creativecommons.org https://creativecommons.org/licenses/by/4.0/
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-53513
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-38724
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-39825
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-39883
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-39898
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-39955
- errata.almalinux.org https://errata.almalinux.org/8/ALSA-2025-22388.html
- errata.rockylinux.org https://errata.rockylinux.org/RLSA-2025:22388
- git.kernel.org https://git.kernel.org/linus/55793ea54d77719a071b1ccc05a05056e3b5e009 (6.4-rc1)
- git.kernel.org https://git.kernel.org/stable/c/52851d0c3354b397c11d31dfeb8b2a2fc85a0002
- git.kernel.org https://git.kernel.org/stable/c/55793ea54d77719a071b1ccc05a05056e3b5e009
- git.kernel.org https://git.kernel.org/stable/c/fab766c8a1aff715bce7075aab40e780266f8e1a
- git.kernel.org https://git.kernel.org/stable/c/ffb75ffaa68723276365d0f9d00b03362b750657
- linux.oracle.com https://linux.oracle.com/cve/CVE-2023-53513.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2025-22388.html
- lore.kernel.org https://lore.kernel.org/linux-cve-announce/2025100130-CVE-2023-53513-4667@gregkh/T
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2023-53513
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2023-53513
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.