public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: GUO Zihua <guozihua@huawei.com>
Cc: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
	davem@davemloft.net, dhowells@redhat.com,
	herbert@gondor.apana.org.au, gustavoars@kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3] crypto: Use struct_size() helper in kmalloc()
Date: Wed, 18 May 2022 15:03:37 -0700	[thread overview]
Message-ID: <202205181503.AA72D88E15@keescook> (raw)
In-Reply-To: <20220518062518.236965-1-guozihua@huawei.com>

On Wed, May 18, 2022 at 02:25:18PM +0800, GUO Zihua wrote:
> Make use of struct_size() helper for structures containing flexible array
> member instead of sizeof() which prevents potential issues, as well as
> increase readability.
> 
> Reference: https://lore.kernel.org/all/CAHk-=wiGWjxs7EVUpccZEi6esvjpHJdgHQ=vtUeJ5crL62hx9A@mail.gmail.com/
> 
> Signed-off-by: GUO Zihua <guozihua@huawei.com>

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

-- 
Kees Cook

      reply	other threads:[~2022-05-18 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  6:25 [PATCH v3] crypto: Use struct_size() helper in kmalloc() GUO Zihua
2022-05-18 22:03 ` Kees Cook [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=202205181503.AA72D88E15@keescook \
    --to=keescook@chromium.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=guozihua@huawei.com \
    --cc=gustavoars@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-hardening@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