Index: head/sys/dev/ixl/if_ixl.c =================================================================== --- head/sys/dev/ixl/if_ixl.c +++ head/sys/dev/ixl/if_ixl.c @@ -1624,11 +1624,29 @@ struct ifdrv *ifd = (struct ifdrv *)data; int error = 0; - /* NVM update command */ - if (ifd->ifd_cmd == I40E_NVM_ACCESS) - error = ixl_handle_nvmupd_cmd(pf, ifd); - else - error = EINVAL; + /* + * The iflib_if_ioctl forwards SIOCxDRVSPEC and SIOGPRIVATE_0 without + * performing privilege checks. It is important that this function + * perform the necessary checks for commands which should only be + * executed by privileged threads. + */ + + switch(command) { + case SIOCGDRVSPEC: + case SIOCSDRVSPEC: + /* NVM update command */ + if (ifd->ifd_cmd == I40E_NVM_ACCESS) { + error = priv_check(curthread, PRIV_DRIVER); + if (error) + break; + error = ixl_handle_nvmupd_cmd(pf, ifd); + } else { + error = EINVAL; + } + break; + default: + error = EOPNOTSUPP; + } return (error); } Index: head/sys/dev/ixl/ixl.h =================================================================== --- head/sys/dev/ixl/ixl.h +++ head/sys/dev/ixl/ixl.h @@ -52,6 +52,7 @@ #include #include #include +#include #include #include