[PATCH v5 01/11] eal: introduce new secure memory fill

Morten Brørup mb at smartsharesystems.com
Wed Feb 12 10:09:27 CET 2025


> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Tuesday, 11 February 2025 18.35
> 
> When memset() is used before a release function such as free,
> the compiler if allowed to optimize the memset away under
> the as-if rules. This is normally ok, but in certain cases such
> as passwords or security keys it is problematic.
> 
> Introduce a DPDK wrapper which is equivalent to the C++ memset_s
> function.  Naming chosen to be similar to kernel.

It's not like C11 memset_s, which takes one more parameter, and is an optional part of the C11 standard.
It's like C23 memset_explicit.

Wouldn't it be better to name it after the C standard function, i.e. rte_memset_explicit?

Or maybe backport memset_explicit from C23, i.e. omit the rte_ prefix, if not using a C23 compiler?



More information about the dev mailing list