From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 623ED5A061A for ; Tue, 17 Nov 2026 13:06:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794917185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fEYLFJAaguEbU2CL2eJEyN4/ZE3W8WDx5AZcixCaQAo=; b=TmbNhMqIqMti1C8Fa0usGRtKgspKAVV61Uc7mUwpms4iu8cOOOdoHFE7OY5cuxwvYzogFD B3GpzSDHAxbb0UmcJNxKeBPsbUYiVapPRawUc2NvSybkT3X0fblPjZYrLGjTA2XVhXsd2P MUKzLDLAdUNzBfQJ3qYuRK1QvWQtZ40= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-BvyKzHFpPqS5vEcS6gl6Lw-1; Tue, 17 Nov 2026 07:06:24 -0500 X-MC-Unique: BvyKzHFpPqS5vEcS6gl6Lw-1 X-Mimecast-MFC-AGG-ID: BvyKzHFpPqS5vEcS6gl6Lw_1794917183 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C90219560A2; Tue, 17 Nov 2026 12:06:23 +0000 (UTC) Received: from anskuma-thinkpadp1gen7.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C4B9B30000E3; Tue, 17 Nov 2026 12:06:19 +0000 (UTC) From: Anshu Kumari To: sbrivio@redhat.com, passt-dev@passt.top, eonzylakshitha@gmail.com Subject: [PATCH 0/2] dhcp: Harden DNS search domain option handling Date: Tue, 17 Nov 2026 17:36:15 +0530 Message-ID: <20261117120617.663503-1-anskuma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: moRHHcUNVGQMNlw1jbSxypK6RnlRE4Ocam5KxviJyvs_1794917183 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-ID-Hash: OSKJNWKXE2RB5NLPJFHHFYSGSM7Z3HXV X-Message-ID-Hash: OSKJNWKXE2RB5NLPJFHHFYSGSM7Z3HXV X-MailFrom: anskuma@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: anskuma@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Lakshitha Perera reported a potential out-of-bounds write in opt_set_dns_search() at revision f8df3f1, where an excessively long DNS search domain list configured via --dhcp-search could overflow the opts[119].s buffer. The original root cause (slen initialised to -1 inflating the max_len counter) was already eliminated by commit 64e69136ecbc ("dhcp: Add option configuration tracking with enum opt_conf"). These two patches address the remaining robustness concerns: 1/2: Change opts[].slen from int to unsigned int, now that negative value is no longer used. 2/2: Add an explicit bounds check against sizeof(opts[119].s) before the memcpy() in opt_set_dns_search(). Reported-by: Lakshitha Perera *** BLURB HERE *** Anshu Kumari (2): dhcp: Use unsigned int for opts[].slen dhcp: Add bounds check on DNS search domain option buffer dhcp.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) -- 2.55.0