CVE-2026-98725: nvmet-auth: fix out-of-bounds write in nvmet_auth_challenge()
In the Linux kernel, the following vulnerability has been resolved:
nvmet-auth: fix out-of-bounds write in nvmetauthchallenge()
nvmetauthchallenge() receives its output buffer as a void pointer. sizeof(d) therefore evaluates to one with GCC and undercounts the fixed challenge header by 15 bytes. A short AUTHRECEIVE buffer can pass the check before the challenge is copied past the end of its allocation.
Use the typed challenge pointer when calculating the response size.
BUG: KASAN: slab-out-of-bounds in nvmetexecuteauthreceive (drivers/nvme/target/fabrics-cmd-auth.c:442 drivers/nvme/target/fabrics-cmd-auth.c:569) Write of size 32 by task kworker/1:1H/64 Workqueue: nvmettcpwq nvmettcpiowork Call Trace: nvmetexecuteauthreceive (drivers/nvme/target/fabrics-cmd-auth.c:442 drivers/nvme/target/fabrics-cmd-auth.c:569) nvmettcptryrecvpdu (drivers/nvme/target/tcp.c:1119 drivers/nvme/target/tcp.c:1243) nvmettcpiowork (drivers/nvme/target/tcp.c:1350 drivers/nvme/target/tcp.c:1382 drivers/nvme/target/tcp.c:1445) processonework (kernel/workqueue.c:3322) workerthread (kernel/workqueue.c:3405 kernel/workqueue.c:3486) kthread (kernel/kthread.c:436) retfromfork (arch/x86/kernel/process.c:158) retfromforkasm (arch/x86/entry/entry64.S:245) The buggy address is located 16 bytes inside of allocated 33-byte region [ffff888000554e80, ffff888000554ea1) Kernel panic - not syncing: KASAN: paniconwarn set ...
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In nvmet_auth_challenge(), use the typed challenge pointer when calculating the response size and check the buffer size before copying the challenge past the end of its allocation.