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

Details

Provenance
takahiro.kurosawa_gmail.comAuthored on May 13 2022, 5:58 PM
kpCommitted on May 13 2022, 6:05 PM
Reviewer
markj
Differential Revision
D35188: rtsock: fix buffer overrun (sockaddr misuse)
Parents
rGd966efcc0807: fusefs tests: Remove an unused variable.
Branches
Unknown
Tags
Unknown