From: Kalle Valo <kvalo@kernel.org>
To: Justin Stitt <justinstitt@google.com>
Cc: Jeff Johnson <quic_jjohnson@quicinc.com>,
ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
Justin Stitt <justinstitt@google.com>
Subject: Re: [PATCH v2] wifi: ath10k: replace deprecated strncpy with memcpy
Date: Tue, 31 Oct 2023 07:46:30 +0000 (UTC) [thread overview]
Message-ID: <169873838825.2137176.1962660661621825377.kvalo@kernel.org> (raw)
In-Reply-To: <20231024-strncpy-drivers-net-wireless-ath-ath10k-mac-c-v2-1-4c1f4cd4b4df@google.com>
Justin Stitt <justinstitt@google.com> wrote:
> strncpy() is deprecated [1] and we should prefer less ambiguous
> interfaces.
>
> In this case, arvif->u.ap.ssid has its length maintained by
> arvif->u.ap.ssid_len which indicates it may not need to be
> NUL-terminated. Make this explicit with __nonstring and use a plain old
> memcpy.
>
> This is also consistent with future copies into arvif->u.ap.ssid:
>
> if (changed & BSS_CHANGED_SSID &&
> vif->type == NL80211_IFTYPE_AP) {
> arvif->u.ap.ssid_len = vif->cfg.ssid_len;
> if (vif->cfg.ssid_len)
> memcpy(arvif->u.ap.ssid, vif->cfg.ssid,
> vif->cfg.ssid_len);
> arvif->u.ap.hidden_ssid = info->hidden_ssid;
> }
>
> Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
> Link: https://github.com/KSPP/linux/issues/90
> Cc: linux-hardening@vger.kernel.org
> Signed-off-by: Justin Stitt <justinstitt@google.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Patch applied to ath-next branch of ath.git, thanks.
ac2f43d3d34e wifi: ath10k: replace deprecated strncpy with memcpy
--
https://patchwork.kernel.org/project/linux-wireless/patch/20231024-strncpy-drivers-net-wireless-ath-ath10k-mac-c-v2-1-4c1f4cd4b4df@google.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2023-10-31 7:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 17:42 Justin Stitt
2023-10-24 18:14 ` Jeff Johnson
2023-10-24 21:34 ` Kees Cook
2023-10-24 23:19 ` Jeff Johnson
2023-10-31 7:46 ` Kalle Valo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=169873838825.2137176.1962660661621825377.kvalo@kernel.org \
--to=kvalo@kernel.org \
--cc=ath10k@lists.infradead.org \
--cc=justinstitt@google.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_jjohnson@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®