Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2024 19:33:30 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 846d702f234b - main - libnvmf: Reject invalid values of MAXH2CDATA for new associations
Message-ID:  <202407251933.46PJXU2u042747@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=846d702f234b80881dc6641057b623308917b66a

commit 846d702f234b80881dc6641057b623308917b66a
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-07-25 19:32:42 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-07-25 19:32:42 +0000

    libnvmf: Reject invalid values of MAXH2CDATA for new associations
    
    Sponsored by:   Chelsio Communications
---
 lib/libnvmf/nvmf_tcp.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c
index 89fc65bf6c43..93948b9b5fd0 100644
--- a/lib/libnvmf/nvmf_tcp.c
+++ b/lib/libnvmf/nvmf_tcp.c
@@ -924,11 +924,18 @@ nvmf_tcp_read_ic_resp(struct nvmf_association *na, struct nvmf_tcp_qpair *qp,
 }
 
 static struct nvmf_association *
-tcp_allocate_association(bool controller __unused,
-    const struct nvmf_association_params *params __unused)
+tcp_allocate_association(bool controller,
+    const struct nvmf_association_params *params)
 {
 	struct nvmf_tcp_association *ta;
 
+	if (controller) {
+		/* 7.4.10.3 */
+		if (params->tcp.maxh2cdata < 4096 ||
+		    params->tcp.maxh2cdata % 4 != 0)
+			return (NULL);
+	}
+
 	ta = calloc(1, sizeof(*ta));
 
 	return (&ta->na);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407251933.46PJXU2u042747>