* [PATCH] nvmet-auth: reject undersized AUTH_SEND payloads
@ 2026-10-08 18:38 tjdqudcks0424
2026-10-13 14:24 ` Christoph Hellwig
2026-10-13 15:44 ` Keith Busch
0 siblings, 2 replies; 3+ messages in thread
From: tjdqudcks0424 @ 2026-10-08 18:38 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, linux-nvme,
Sung Byeongchan
From: Sung Byeongchan <tjdqudcks0424@naver.com>
nvmet_execute_auth_send() allocates and copies the initiator-supplied
transfer length, then reads auth_type and auth_id through a common DHCHAP
message pointer. The existing zero and transfer-length checks do not
ensure that both common-header bytes are present.
An unauthenticated NVMe/TCP initiator can complete ICReq and admin CONNECT,
then send AUTH_SEND with tl equal to one. KASAN reports a one-byte slab
out-of-bounds read when auth_id is loaded.
Reject payloads that do not cover the common auth_type/auth_id header
before allocating or parsing them. The one-byte trigger and
header-minus-one boundary were cleanly rejected in three fixed fresh-boot
runs. Exact-header, valid DHCHAP, wrong-type, mismatch, and zero-length
controls remained clean, and a following valid AUTH_SEND on the same
connection received a response. The touched source is unchanged at
0c2669a9f4a1d607e7591ae50ccf3c432a0aff08, where the patch applies and
builds cleanly.
The demonstrated impact is unauthenticated pre-authentication target-kernel
denial of service. No disclosure, controlled write, RCE, or LPE was
demonstrated. The source reproducer and complete logs are available on
request and are not included in this public report.
OpenAI Codex assisted source inspection, test design, patch drafting, and
evidence organization.
Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication")
Assisted-by: LLM
Signed-off-by: Sung Byeongchan <tjdqudcks0424@naver.com>
---
drivers/nvme/target/fabrics-cmd-auth.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index dccdb55a367c5..1cdebd580722a 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -285,6 +285,12 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
pr_debug("%s: transfer length mismatch (%u)\n", __func__, tl);
return;
}
+ if (tl < offsetof(struct nvmf_auth_dhchap_success2_data, rsvd1)) {
+ status = NVME_SC_INVALID_FIELD | NVME_STATUS_DNR;
+ req->error_loc =
+ offsetof(struct nvmf_auth_send_command, tl);
+ goto done;
+ }
d = kmalloc(tl, GFP_KERNEL);
if (!d) {
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvmet-auth: reject undersized AUTH_SEND payloads
2026-10-08 18:38 [PATCH] nvmet-auth: reject undersized AUTH_SEND payloads tjdqudcks0424
@ 2026-10-13 14:24 ` Christoph Hellwig
2026-10-13 15:44 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-10-13 14:24 UTC (permalink / raw)
To: tjdqudcks0424
Cc: Hannes Reinecke, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, linux-nvme
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvmet-auth: reject undersized AUTH_SEND payloads
2026-10-08 18:38 [PATCH] nvmet-auth: reject undersized AUTH_SEND payloads tjdqudcks0424
2026-10-13 14:24 ` Christoph Hellwig
@ 2026-10-13 15:44 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2026-10-13 15:44 UTC (permalink / raw)
To: tjdqudcks0424
Cc: Hannes Reinecke, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, linux-nvme
On Fri, Oct 09, 2026 at 03:38:10AM +0900, tjdqudcks0424@naver.com wrote:
> From: Sung Byeongchan <tjdqudcks0424@naver.com>
>
> nvmet_execute_auth_send() allocates and copies the initiator-supplied
> transfer length, then reads auth_type and auth_id through a common DHCHAP
> message pointer. The existing zero and transfer-length checks do not
> ensure that both common-header bytes are present.
>
> An unauthenticated NVMe/TCP initiator can complete ICReq and admin CONNECT,
> then send AUTH_SEND with tl equal to one. KASAN reports a one-byte slab
> out-of-bounds read when auth_id is loaded.
Thanks, applied to nvme-7.4.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-13 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08 18:38 [PATCH] nvmet-auth: reject undersized AUTH_SEND payloads tjdqudcks0424
2026-10-13 14:24 ` Christoph Hellwig
2026-10-13 15:44 ` Keith Busch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.