From: Anshu Kumari <anskuma@redhat.com>
To: sbrivio@redhat.com, passt-dev@passt.top, eonzylakshitha@gmail.com
Cc: anskuma@redhat.com
Subject: [PATCH 0/2] dhcp: Harden DNS search domain option handling
Date: Tue, 17 Nov 2026 17:36:15 +0530 [thread overview]
Message-ID: <20261117120617.663503-1-anskuma@redhat.com> (raw)
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 <eonzylakshitha@gmail.com>
*** 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
next reply other threads:[~2026-11-17 12:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 12:06 Anshu Kumari [this message]
2026-11-17 12:06 ` [PATCH 1/2] dhcp: Use unsigned int for opts[].slen Anshu Kumari
2026-11-17 12:06 ` [PATCH 2/2] dhcp: Add bounds check on DNS search domain option buffer Anshu Kumari
2026-11-17 12:22 ` [PATCH 0/2] dhcp: Harden DNS search domain option handling Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261117120617.663503-1-anskuma@redhat.com \
--to=anskuma@redhat.com \
--cc=eonzylakshitha@gmail.com \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).