mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Kees Cook <keescook@chromium.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-hardening@vger.kernel.org
Subject: Re: struct_size() using sizeof() vs offsetof()
Date: Thu, 17 Aug 2023 20:37:43 +0200	[thread overview]
Message-ID: <df8fdd4a-490f-6b2a-03b6-0333e3302dce@kernel.org> (raw)
In-Reply-To: <f12c6f14-66c4-6afb-e768-fa7abcfd1bbc@embeddedor.com>


[-- Attachment #1.1: Type: text/plain, Size: 618 bytes --]

Hi Gustavo,

On 2023-08-17 18:05, Gustavo A. R. Silva wrote:
> 
>> -               tp_c = kzalloc(sizeof(*tp_c), GFP_KERNEL);
>> +               tp_c = kzalloc(struct_size(tp_c, hlist->ht, 1), GFP_KERNEL);
> 
> I just sent a fix[1].
> 
> Thanks for reporting this! :)

:-)

> --
> Gustavo
> 
> [1] https://lore.kernel.org/linux-hardening/ZN5DvRyq6JNz20l1@work/

Please CC me in that thread.  I want to know when the patch is installed, to
prepare my own against that tree.

Cheers,
Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-08-17 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  0:23 Alejandro Colomar
2023-08-17  3:05 ` Kees Cook
2023-08-17 12:39   ` Alejandro Colomar
2023-08-17 16:05     ` Gustavo A. R. Silva
2023-08-17 18:37       ` Alejandro Colomar [this message]
2023-08-21  8:38         ` David Laight
2023-08-21 13:51           ` Alejandro Colomar
2023-08-21  8:16 ` David Laight
2023-08-21 13:45   ` Alejandro Colomar

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=df8fdd4a-490f-6b2a-03b6-0333e3302dce@kernel.org \
    --to=alx@kernel.org \
    --cc=gustavo@embeddedor.com \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@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®