mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-hardening@vger.kernel.org
Subject: Re: [next] wifi: hostap: Add __counted_by for struct prism2_download_data and use struct_size()
Date: Wed, 11 Oct 2023 09:20:30 +0000 (UTC)	[thread overview]
Message-ID: <169701602833.2760941.2948588134703156601.kvalo@kernel.org> (raw)
In-Reply-To: <ZSRXXvWMMkm7qqRW@work>

"Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:

> Prepare for the coming implementation by GCC and Clang of the __counted_by
> attribute. Flexible array members annotated with __counted_by can have
> their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
> array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
> functions).
> 
> While there, use struct_size() helper, instead of the open-coded
> version, to calculate the size for the allocation of the whole
> flexible structure, including of course, the flexible-array member.
> 
> This code was found with the help of Coccinelle, and audited and
> fixed manually.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> Reviewed-by: Kees Cook <keescook@chromium.org>

Patch applied to wireless-next.git, thanks.

5cf47dc14158 wifi: hostap: Add __counted_by for struct prism2_download_data and use struct_size()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/ZSRXXvWMMkm7qqRW@work/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


      parent reply	other threads:[~2023-10-11  9:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 19:41 [PATCH][next] " Gustavo A. R. Silva
2023-10-09 19:54 ` Kees Cook
2023-10-09 20:33   ` Gustavo A. R. Silva
2023-10-09 20:42     ` Kees Cook
2023-10-10  6:17       ` Kalle Valo
2023-10-10 12:44         ` Gustavo A. R. Silva
2023-10-10 22:50 ` Kees Cook
2023-10-10 23:24   ` Gustavo A. R. Silva
2023-10-11  9:20 ` 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=169701602833.2760941.2948588134703156601.kvalo@kernel.org \
    --to=kvalo@kernel.org \
    --cc=gustavoars@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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®