Skip to content

Commit 21cbf88

Browse files
edumazetjmberg-intel
authored andcommitted
wifi: avoid kernel-infoleak from struct iw_point
struct iw_point has a 32bit hole on 64bit arches. struct iw_point { void __user *pointer; /* Pointer to the data (in user space) */ __u16 length; /* number of fields or size in bytes */ __u16 flags; /* Optional params */ }; Make sure to zero the structure to avoid disclosing 32bits of kernel data to user space. Fixes: 87de87d ("wext: Dispatch and handle compat ioctls entirely in net/wireless/wext.c") Reported-by: syzbot+bfc7323743ca6dbcc3d3@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/695f83f3.050a0220.1c677c.0392.GAE@google.com/T/#u Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260108101927.857582-1-edumazet@google.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent dbf8fe8 commit 21cbf88

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

net/wireless/wext-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,10 @@ static int compat_standard_call(struct net_device *dev,
11011101
return ioctl_standard_call(dev, iwr, cmd, info, handler);
11021102

11031103
iwp_compat = (struct compat_iw_point *) &iwr->u.data;
1104+
1105+
/* struct iw_point has a 32bit hole on 64bit arches. */
1106+
memset(&iwp, 0, sizeof(iwp));
1107+
11041108
iwp.pointer = compat_ptr(iwp_compat->pointer);
11051109
iwp.length = iwp_compat->length;
11061110
iwp.flags = iwp_compat->flags;

net/wireless/wext-priv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ int compat_private_call(struct net_device *dev, struct iwreq *iwr,
228228
struct iw_point iwp;
229229

230230
iwp_compat = (struct compat_iw_point *) &iwr->u.data;
231+
232+
/* struct iw_point has a 32bit hole on 64bit arches. */
233+
memset(&iwp, 0, sizeof(iwp));
234+
231235
iwp.pointer = compat_ptr(iwp_compat->pointer);
232236
iwp.length = iwp_compat->length;
233237
iwp.flags = iwp_compat->flags;

0 commit comments

Comments
 (0)