The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Johannes Berg <johannes.berg@intel.com>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH v1 1/2] overflow: Allow to sum a few arguments at once
Date: Fri, 19 Jun 2026 20:27:33 -0700	[thread overview]
Message-ID: <202606192025.CF68F2E@keescook> (raw)
In-Reply-To: <ajTlfuOFHXlA7xdu@ashevche-desk.local>

On Fri, Jun 19, 2026 at 09:45:18AM +0300, Andy Shevchenko wrote:
> On Thu, Jun 18, 2026 at 08:47:34PM -0700, Kees Cook wrote:
> > On Wed, Jun 17, 2026 at 01:12:36PM +0200, Andy Shevchenko wrote:
> > > Convert size_add() to take variadic argument, so we can simplify users
> > > with using a macro only once.
> > 
> > Oh, this is fun. I like it. :)
> 
> He-he :-)
> 
> ...
> 
> > > +#define __size_add4(addend1, addend2, addend3, addend4, addend5, ...)		\
> > > +	__size_add(__size_add3(addend1,  addend2, addend3, addend4), addend5)
> > 
> > Is 4 the max seen in practice?
> 
> In patch 2 there are 5! In cover letter I also mentioned a new user
> (there are actually three). And I remember seeing 3 somewhere else.

I feel like we should allow size_mul() to work this way too, though I
don't find any users that would need it, so I guess just size_add()?

I'm fine for this to go via whatever tree is first to use it:

Acked-by: Kees Cook <kees@kernel.org>


-- 
Kees Cook

  reply	other threads:[~2026-06-20  3:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 11:12 [rfc, PATCH v1 0/2] overflow: Convert size_add() to take variadic arguments Andy Shevchenko
2026-06-17 11:12 ` [PATCH v1 1/2] overflow: Allow to sum a few arguments at once Andy Shevchenko
2026-06-17 12:56   ` Johannes Berg
2026-06-17 21:30     ` David Laight
2026-06-18  6:39       ` Andy Shevchenko
2026-06-18 18:53         ` Johannes Berg
2026-06-18 21:36           ` David Laight
2026-06-19  3:47   ` Kees Cook
2026-06-19  6:45     ` Andy Shevchenko
2026-06-20  3:27       ` Kees Cook [this message]
2026-06-20  6:56         ` Andy Shevchenko
2026-06-17 11:12 ` [PATCH v1 2/2] wifi: nl80211: Call size_add() only once Andy Shevchenko

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=202606192025.CF68F2E@keescook \
    --to=kees@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gustavoars@kernel.org \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --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