Re: [PATCH] fscrypt: Replace some variable-size memsets with fixed-size
Eric Biggers <[email protected]> Mon, 20 Jul 2026 10:47:06 -0700
| Newsgroups | org.kernel.vger.linux-fscrypt,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260720174706.GE1865@quark> |
On Sat, Jul 18, 2026 at 01:56:06PM -0700, Eric Biggers wrote: > For zeroing IVs and raw keys, remove the misguided optimization of > zeroing the actual size used (typically 16 and 64 bytes respectively) > instead of the max size (32 and 64 bytes respectively). Using a > compile-time constant size allows the compiler to specialize the memset > for that size (typically by inlining a few 'mov' instructions), which > is more important than zeroing a few extra bytes with these small sizes. > > Signed-off-by: Eric Biggers <[email protected]> > --- > fs/crypto/crypto.c | 2 +- > fs/crypto/keysetup.c | 4 ++-- > fs/crypto/keysetup_v1.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) Applied to https://git.kernel.org/pub/scm/fs/fscrypt/linux.git/log/?h=for-next - Eric