linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] wifi: brcm80211: replace deprecated strncpy
@ 2023-10-17 20:11 Justin Stitt
  2023-10-17 20:11 ` [PATCH v3 1/2] wifi: brcm80211: replace deprecated strncpy with strscpy Justin Stitt
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Justin Stitt @ 2023-10-17 20:11 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin, Hante Meuleman, Kalle Valo
  Cc: linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	linux-kernel, linux-hardening, Justin Stitt

Hi,

This series used to be just one patch in [v2] but I've split it into two
separate patches.

The motivation behind this series is that strncpy() is deprecated for
use on NUL-terminated destination strings [1] and as such we should
prefer more robust and less ambiguous string interfaces.

In cases where we expect the destination buffer to be NUL-terminated
let's opt for strscpy() as this guarantees NUL-termination. Other cases
are just simple byte copies with pre-determined bounds; for these let's
use plain-ol' memcpy().

Each change is detailed in its accompanying patch message.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Signed-off-by: Justin Stitt <justinstitt@google.com>
---
Changes in v3:
- split up into two separate patches (thanks Franky)
- use better subject line (thanks Franky + Kalle)
- Link to v2: https://lore.kernel.org/r/20231016-strncpy-drivers-net-wireless-broadcom-brcm80211-brcmfmac-cfg80211-c-v2-1-6c7567e1d3b8@google.com

Changes in v2:
- add other strncpy replacements
- Link to v1: https://lore.kernel.org/r/20231016-strncpy-drivers-net-wireless-broadcom-brcm80211-brcmfmac-cfg80211-c-v1-1-4234807ca07e@google.com

---
Justin Stitt (2):
      wifi: brcm80211: replace deprecated strncpy with strscpy
      wifi: brcmsmac: replace deprecated strncpy with memcpy

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c      | 2 +-
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c  | 6 +++---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c      | 3 +--
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c     | 4 ++--
 5 files changed, 8 insertions(+), 9 deletions(-)
---
base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2
change-id: 20231016-strncpy-drivers-net-wireless-broadcom-brcm80211-brcmfmac-cfg80211-c-a20108421685

Best regards,
--
Justin Stitt <justinstitt@google.com>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-10-30 17:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 20:11 [PATCH v3 0/2] wifi: brcm80211: replace deprecated strncpy Justin Stitt
2023-10-17 20:11 ` [PATCH v3 1/2] wifi: brcm80211: replace deprecated strncpy with strscpy Justin Stitt
2023-10-26 17:20   ` Kees Cook
2023-10-30 17:20   ` Kalle Valo
2023-10-17 20:11 ` [PATCH v3 2/2] wifi: brcmsmac: replace deprecated strncpy with memcpy Justin Stitt
2023-10-19  0:03   ` Kees Cook
2023-10-19 17:37     ` Justin Stitt
2023-10-26 17:21     ` Kees Cook
2023-10-17 21:27 ` [PATCH v3 0/2] wifi: brcm80211: replace deprecated strncpy Franky Lin
2023-10-18  9:33   ` Arend van Spriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).