linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: kvalo@kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] wifi: rtw89: coex: add annotation __counted_by() to struct rtw89_btc_btf_set_mon_reg
Date: Wed, 11 Oct 2023 08:54:00 -0700	[thread overview]
Message-ID: <202310110853.681C3AB65C@keescook> (raw)
In-Reply-To: <20231011063725.25276-2-pkshih@realtek.com>

On Wed, Oct 11, 2023 at 02:37:25PM +0800, Ping-Ke Shih 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).
> 
> Use struct_size() and flex_array_size() helpers to calculate proper sizes
> for allocation and memcpy().
> 
> Don't change logic at all, and result is identical as before.
> 
> Cc: Kees Cook <keescook@chromium.org>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

Looks good too. Thanks!

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

  reply	other threads:[~2023-10-11 15:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11  6:37 [PATCH 1/2] wifi: rtw89: coex: add annotation __counted_by() for struct rtw89_btc_btf_set_slot_table Ping-Ke Shih
2023-10-11  6:37 ` [PATCH 2/2] wifi: rtw89: coex: add annotation __counted_by() to struct rtw89_btc_btf_set_mon_reg Ping-Ke Shih
2023-10-11 15:54   ` Kees Cook [this message]
2023-10-11 15:53 ` [PATCH 1/2] wifi: rtw89: coex: add annotation __counted_by() for struct rtw89_btc_btf_set_slot_table Kees Cook
2023-10-12 12:16 ` Kalle Valo

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=202310110853.681C3AB65C@keescook \
    --to=keescook@chromium.org \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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;
as well as URLs for NNTP newsgroup(s).