[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202402270852.E46A5268@keescook>
Date: Tue, 27 Feb 2024 09:00:44 -0800
From: Kees Cook <keescook@...omium.org>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Nathan Chancellor <nathan@...nel.org>, rui.zhang@...el.com,
lukasz.luba@....com, gustavoars@...nel.org, morbo@...gle.com,
justinstitt@...gle.com, stanislaw.gruszka@...ux.intel.com,
linux-pm@...r.kernel.org, linux-hardening@...r.kernel.org,
llvm@...ts.linux.dev, patches@...ts.linux.dev
Subject: Re: [PATCH] thermal: core: Move initial num_trips assignment before
memcpy()
On Tue, Feb 27, 2024 at 05:47:44PM +0100, Daniel Lezcano wrote:
> Ok my misunderstanding was I thought sizeof() was calling _bdos under the
> hood, so when calling sizeof(flex_array), it was returning the computed size
> inferring from the __counted_by field.
Yeah, sizeof() has a very limited scope. __builtin_object_size() has
more flexibility (via the 2nd argument, "type"), but it was still
compile-time only. __builtin_dynamic_object_size() was added to bring
runtime evaluations into the mix (initially to support the alloc_size
attribute, and now includes the counted_by attribute too).
--
Kees Cook
Powered by blists - more mailing lists