KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
83 stars 5 forks source link

Fix "invalid application of ‘sizeof’ to incomplete type" error in drivers/net/wireless/rndis_wlan.c #45

Closed GustavoARSilva closed 4 years ago

GustavoARSilva commented 4 years ago

When replacing the zero-length array auth_encr_pair[0] with a flexible-array member in struct ndis_80211_capability:

image

the following error shows up:

image

This is due to the flexible-array member having incomplete type.

See flexible-array conversions issue.

GustavoARSilva commented 4 years ago

https://lore.kernel.org/lkml/20200505235205.GA18539@embeddedor/

kees commented 4 years ago

It looks like nothing is actually using the auth_encr_pair bytes, so I'd agree with your patch! :)

GustavoARSilva commented 4 years ago

Patch applied and waiting to be added to mainline: https://lore.kernel.org/lkml/20200512085336.B8DE4C433CB@smtp.codeaurora.org/

GustavoARSilva commented 4 years ago

The patch is already upstream: rndis_wlan: Remove logically dead code