Close PR #20963. Do not pass encryption keys back to the caller via
wi_ioctl() unless they're the superuser.
This commit is contained in:
parent
075c4a4a7c
commit
41a8897cd6
@ -1008,6 +1008,9 @@ static int wi_ioctl(ifp, command, data)
|
|||||||
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
|
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
|
||||||
if (error)
|
if (error)
|
||||||
break;
|
break;
|
||||||
|
/* Don't show WEP keys to non-root users. */
|
||||||
|
if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(p))
|
||||||
|
break;
|
||||||
if (wreq.wi_type == WI_RID_IFACE_STATS) {
|
if (wreq.wi_type == WI_RID_IFACE_STATS) {
|
||||||
bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
|
bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
|
||||||
sizeof(sc->wi_stats));
|
sizeof(sc->wi_stats));
|
||||||
|
@ -1008,6 +1008,9 @@ static int wi_ioctl(ifp, command, data)
|
|||||||
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
|
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
|
||||||
if (error)
|
if (error)
|
||||||
break;
|
break;
|
||||||
|
/* Don't show WEP keys to non-root users. */
|
||||||
|
if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(p))
|
||||||
|
break;
|
||||||
if (wreq.wi_type == WI_RID_IFACE_STATS) {
|
if (wreq.wi_type == WI_RID_IFACE_STATS) {
|
||||||
bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
|
bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
|
||||||
sizeof(sc->wi_stats));
|
sizeof(sc->wi_stats));
|
||||||
|
Loading…
Reference in New Issue
Block a user