HomeFreeBSD

rtsock: fix a stack overflow

Description

rtsock: fix a stack overflow

struct sockaddr is not sufficient for buffer that can hold any
sockaddr_* structure. struct sockaddr_storage should be used.

Test:
ifconfig epair create
ifconfig epair0a inet6 add 2001:db8::1 up
ndp -s 2001:db8::2 02:86:98:2e:96:0b proxy # this triggers kernel stack overflow

Reviewed by: markj, kp
Differential Revision: https://reviews.freebsd.org/D35188

(cherry picked from commit 9573cc35555eb0da35da5712462de9f6107fb974)

Details

Provenance
takahiro.kurosawa_gmail.comAuthored on May 13 2022, 5:58 PM
kpCommitted on May 25 2022, 8:13 AM
Reviewer
markj
Differential Revision
D35188: rtsock: fix buffer overrun (sockaddr misuse)
Parents
rGbee87a73813d: makefs: Fix warnings and reset WARNS to the default
Branches
Unknown
Tags
Unknown