summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_string.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2017-10-04 21:19:33 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2017-10-04 21:19:33 +0300
commitcb4dc2720acf49cb8870e5ff4ebd33ad08668e67 (patch)
treedd362d46154d82ea736131ec797810bb941bedcc /src/core/ngx_string.c
parent1f3dea250ced01ceb8cdfd384e97f19df54105cb (diff)
downloadnginx-cb4dc2720acf49cb8870e5ff4ebd33ad08668e67.tar.gz
nginx-cb4dc2720acf49cb8870e5ff4ebd33ad08668e67.tar.bz2
Fixed buffer overread with unix sockets after accept().
Some OSes (notably macOS, NetBSD, and Solaris) allow unix socket addresses larger than struct sockaddr_un. Moreover, some of them (macOS, Solaris) return socklen of the socket address before it was truncated to fit the buffer provided. As such, on these systems socklen must not be used without additional check that it is within the buffer provided. Appropriate checks added to ngx_event_accept() (after accept()), ngx_event_recvmsg() (after recvmsg()), and ngx_set_inherited_sockets() (after getsockname()). We also obtain socket addresses via getsockname() in ngx_connection_local_sockaddr(), but it does not need any checks as it is only used for INET and INET6 sockets (as there can be no wildcard unix sockets).
Diffstat (limited to 'src/core/ngx_string.c')
0 files changed, 0 insertions, 0 deletions