diff options
author | mdodd <mdodd@FreeBSD.org> | 2005-04-20 02:57:56 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2005-04-20 02:57:56 +0000 |
commit | 7826c585d53383e69bf719e71e50c50bbc96ed19 (patch) | |
tree | 3035d3e2e658dde83ed62dd21612dd2d41eb57da /sys | |
parent | 708e4e1098efcd683e87c7bb56cbfb45e69ec88a (diff) | |
download | FreeBSD-src-7826c585d53383e69bf719e71e50c50bbc96ed19.zip FreeBSD-src-7826c585d53383e69bf719e71e50c50bbc96ed19.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index e3ebf9b..327026d 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -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) { |