mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-edac@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
	Kees Cook <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:KERNEL HARDENING (not covered by other
	areas):Keyword:b__counted_by(_le|_be)?b"
	<linux-hardening@vger.kernel.org>
Subject: Re: [PATCHv3] EDAC/mc: Use kzalloc_flex()
Date: Tue, 31 Mar 2026 00:32:22 +0200	[thread overview]
Message-ID: <20260330223222.GJacr59uiTZzPRYbWX@fat_crate.local> (raw)
In-Reply-To: <CAKxU2N__gE-bWBU6EkJmEK2gR7VE=Va+oN6EB2hpJoHbUiYVxg@mail.gmail.com>

On Mon, Mar 30, 2026 at 02:26:10PM -0700, Rosen Penev wrote:
> > Oh, hypothetical what-if. Yeah, pls drop all that gunk from commit messages
> > pls and simply concentrate on why the patch exists.
> Not sure what you mean.

I mean this: a commit message should simply state why a patch exists. Here's
what I did with yours:

    Convert struct mem_ctl_info to use flex array and use the new flex array
    helpers to enable runtime bounds checking, including annotating the array
    length member with __counted_by() for extra runtime analysis when requested.
    
    Move counter assignment immediately after allocation as required by
    __counted_by().
    
    Move memcpy() after the counter assignment so that it is initialized before
    the first reference to the flex array, as the new attribute requires.

The idea is that when one reads the commit message months, or even years from
now - something we all have to do on a daily basis - it should have all the
necessary information why the change was done.

And nothing else. The emphasis being on the latter part. In this case, what
this should have been and what some tools can do when lines are magically
ordered doesn't really matter. The change must be worth to exist for itself.
In this case, runtime bounds checking, which is something we all want.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2026-03-30 22:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  2:48 Rosen Penev
2026-03-30 15:15 ` Borislav Petkov
2026-03-30 20:49   ` Rosen Penev
2026-03-30 21:11     ` Borislav Petkov
2026-03-30 21:26       ` Rosen Penev
2026-03-30 22:32         ` Borislav Petkov [this message]
2026-03-30 23:25           ` Rosen Penev
2026-03-31 12:18             ` Borislav Petkov
2026-03-31 15:28               ` Gustavo A. R. Silva
2026-03-31 17:14                 ` Borislav Petkov

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=20260330223222.GJacr59uiTZzPRYbWX@fat_crate.local \
    --to=bp@alien8.de \
    --cc=gustavoars@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rosenp@gmail.com \
    --cc=tony.luck@intel.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

all inboxes | Powered by JetHome®