summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-11-06 14:54:06 +0000
committerrwatson <rwatson@FreeBSD.org>2006-11-06 14:54:06 +0000
commit572da55a432cfcabe19b41502ef867e59edea8f6 (patch)
tree24a5a8ca0f6495fc45fd07f1b990052667d646a6 /sys/netinet6
parent9da66947c437f843cbe63621743456ba7b4e4b05 (diff)
downloadFreeBSD-src-572da55a432cfcabe19b41502ef867e59edea8f6.zip
FreeBSD-src-572da55a432cfcabe19b41502ef867e59edea8f6.tar.gz
Convert three new suser(9) calls introduced between when the priv(9)
patch was prepared and committed to priv(9) calls. Add XXX comments as, in each case, the semantics appear to differ from the TCP/UDP versions of the calls with respect to jail, and because cr_canseecred() is not used to validate the query. Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/sctp6_usrreq.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index 39d531b..3483658 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/systm.h>
#include <sys/syslog.h>
+#include <sys/priv.h>
#include <sys/proc.h>
#include <net/if.h>
#include <net/route.h>
@@ -481,7 +482,13 @@ sctp6_getcred(SYSCTL_HANDLER_ARGS)
struct sctp_tcb *stcb;
int error, s;
- error = suser(req->td);
+ /*
+ * XXXRW: Other instances of getcred use SUSER_ALLOWJAIL, as socket
+ * visibility is scoped using cr_canseesocket(), which it is not
+ * here.
+ */
+ error = priv_check_cred(req->td->td_ucred, PRIV_NETINET_RESERVEDPORT,
+ 0);
if (error)
return (error);
OpenPOWER on IntegriCloud