Skip to content

Commit 2339ee8

Browse files
jrtc27brooksdavis
authored andcommitted
net80211: Fix subobject bounds issue in IEEE80211_IOC_CHANINFO
We fault on the kernel access into the array after ic_nchans here which manifests as EFAULT returned back to userspace.
1 parent c86c8c6 commit 2339ee8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: sys/net80211/ieee80211_ioctl.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ ieee80211_ioctl_getchaninfo(struct ieee80211vap *vap, struct ieee80211req *ireq)
147147
if (space > ireq->i_len)
148148
space = ireq->i_len;
149149
/* XXX assumes compatible layout */
150-
return copyout(&ic->ic_nchans, ireq->i_data, space);
150+
return copyout((char *)ic + __offsetof(struct ieee80211com, ic_nchans),
151+
ireq->i_data, space);
151152
}
152153

153154
static int

0 commit comments

Comments
 (0)