lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <331e54f8-f678-41ee-8788-9e91e3f5ff24@embeddedor.com>
Date: Mon, 21 Jul 2025 12:54:59 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Kees Cook <kees@...nel.org>, Johannes Berg <johannes@...solutions.net>
Cc: linux-wireless@...r.kernel.org,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>,
 Jeff Johnson <jeff.johnson@....qualcomm.com>, linux-kernel@...r.kernel.org,
 linux-hardening@...r.kernel.org
Subject: Re: [PATCH] wifi: mac80211: Write cnt before copying in
 ieee80211_copy_rnr_beacon()



On 21/07/25 12:25, Kees Cook wrote:
> While I caught the need for setting cnt early in nl80211_parse_rnr_elems()
> in the original annotation of struct cfg80211_rnr_elems with __counted_by,
> I missed a similar pattern in ieee80211_copy_rnr_beacon(). Fix this by
> moving the cnt assignment to before the loop.
> 
> Fixes: 7b6d7087031b ("wifi: cfg80211: Annotate struct cfg80211_rnr_elems with __counted_by")
> Signed-off-by: Kees Cook <kees@...nel.org>

Reviewed-by: Gustavo A. R. Silva <gustavoars@...nel.org>

Thanks!
-Gustavo

> ---
> Cc: Johannes Berg <johannes@...solutions.net>
> Cc: <linux-wireless@...r.kernel.org>
> ---
>   net/mac80211/cfg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 4f20d57ab913..2ed07fa121ab 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -1176,13 +1176,13 @@ ieee80211_copy_rnr_beacon(u8 *pos, struct cfg80211_rnr_elems *dst,
>   {
>   	int i, offset = 0;
>   
> +	dst->cnt = src->cnt;
>   	for (i = 0; i < src->cnt; i++) {
>   		memcpy(pos + offset, src->elem[i].data, src->elem[i].len);
>   		dst->elem[i].len = src->elem[i].len;
>   		dst->elem[i].data = pos + offset;
>   		offset += dst->elem[i].len;
>   	}
> -	dst->cnt = src->cnt;
>   
>   	return offset;
>   }


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ