On Tue, Apr 30, 2024 at 07:53:31PM -0700, Eric Biggers wrote: > From: Eric Biggers <ebiggers@xxxxxxxxxx> > > Since the fsverity sysctl registration runs as a builtin initcall, there > is no corresponding sysctl deregistration and the resulting struct > ctl_table_header is not used. This can cause a kmemleak warning just > after the system boots up. (A pointer to the ctl_table_header is stored > in the fsverity_sysctl_header static variable, which kmemleak should > detect; however, the compiler can optimize out that variable.) Avoid > the kmemleak warning by using register_sysctl_init() which is intended > for use by builtin initcalls and uses kmemleak_not_leak(). > > Reported-by: Yi Zhang <yi.zhang@xxxxxxxxxx> > Closes: https://lore.kernel.org/r/CAHj4cs8DTSvR698UE040rs_pX1k-WVe7aR6N2OoXXuhXJPDC-w@xxxxxxxxxxxxxx > Cc: stable@xxxxxxxxxxxxxxx > Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx> Applied to https://git.kernel.org/pub/scm/fs/fsverity/linux.git/log/?h=for-next - Eric