Skip to content

net: wireless: use struct_size where appropriate

Jacob Keller linux-wireless 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] net: wireless: use struct_size where appropriate

This series fixes a few wireless drivers to use struct_size rather than open coding some equivalent checks. This ensures that these size calculations will not overflow but instead be bounded at SIZE_MAX.

In the first case, the code is first converted to a flexible array, which saves a few bytes of memory in addition to the fix with struct_size.

These were caught with a coccinelle patch I recently posted at [1].

[1]: https://lore.kernel.org/all/[email protected]/

Jacob Keller (3):
wifi: ipw2x00: convert ipw_fw_error->elem to flexible array[]
wifi: cfg80211: use struct_size and size_sub for payload length
wifi: nl80211: convert cfg80211_scan_request allocation to *_size
macros

 drivers/net/wireless/intel/ipw2x00/ipw2200.c  |  7 +++--
 drivers/net/wireless/intel/ipw2x00/ipw2200.h  |  3 +--
 .../net/wireless/quantenna/qtnfmac/commands.c |  7 ++---
 net/wireless/nl80211.c                        | 26 ++++++++++---------
 4 files changed, 22 insertions(+), 21 deletions(-)
Signature · 1 line
2.39.1.405.gd4c25cc71f83