public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH 0/2] dhcp: Harden DNS search domain option handling
@ 2026-11-17 12:06 Anshu Kumari
  2026-11-17 12:06 ` [PATCH 1/2] dhcp: Use unsigned int for opts[].slen Anshu Kumari
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anshu Kumari @ 2026-11-17 12:06 UTC (permalink / raw)
  To: sbrivio, passt-dev, eonzylakshitha; +Cc: anskuma

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-17 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 12:06 [PATCH 0/2] dhcp: Harden DNS search domain option handling Anshu Kumari
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

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).