Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Dec 2019 16:56:42 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r356089 - stable/12/sys/dev/oce
Message-ID:  <201912261656.xBQGugda058285@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Thu Dec 26 16:56:42 2019
New Revision: 356089
URL: https://svnweb.freebsd.org/changeset/base/356089

Log:
  MFC r356047:
  oce: Disallow the passthrough ioctl for unprivileged users.

Modified:
  stable/12/sys/dev/oce/oce_if.c
  stable/12/sys/dev/oce/oce_if.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/oce/oce_if.c
==============================================================================
--- stable/12/sys/dev/oce/oce_if.c	Thu Dec 26 15:47:19 2019	(r356088)
+++ stable/12/sys/dev/oce/oce_if.c	Thu Dec 26 16:56:42 2019	(r356089)
@@ -620,6 +620,9 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d
 		break;
 
 	case SIOCGPRIVATE_0:
+		rc = priv_check(curthread, PRIV_DRIVER);
+		if (rc != 0)
+			break;
 		rc = oce_handle_passthrough(ifp, data);
 		break;
 	default:

Modified: stable/12/sys/dev/oce/oce_if.h
==============================================================================
--- stable/12/sys/dev/oce/oce_if.h	Thu Dec 26 15:47:19 2019	(r356088)
+++ stable/12/sys/dev/oce/oce_if.h	Thu Dec 26 16:56:42 2019	(r356089)
@@ -48,6 +48,7 @@
 #include <sys/kernel.h>
 #include <sys/bus.h>
 #include <sys/mbuf.h>
+#include <sys/priv.h>
 #include <sys/rman.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912261656.xBQGugda058285>