Check sopt_level in uipc_ctloutput() and return early if it is non-zero.
This prevents unintended consequnces when an application calls things like setsockopt(x, SOL_SOCKET, SO_REUSEADDR, ...) on a Unix domain socket.
This commit is contained in:
parent
a378bbabe6
commit
96a041b533
@ -617,6 +617,9 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt)
|
||||
struct xucred xu;
|
||||
int error, optval;
|
||||
|
||||
if (sopt->sopt_level != 0)
|
||||
return (EINVAL);
|
||||
|
||||
UNP_LOCK();
|
||||
unp = sotounpcb(so);
|
||||
if (unp == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user