• Eric Biggers's avatar
    fsverity: move sysctl registration out of signature.c · 456ae5fe
    Eric Biggers authored
    Currently the registration of the fsverity sysctls happens in
    signature.c, which couples it to CONFIG_FS_VERITY_BUILTIN_SIGNATURES.
    
    This makes it hard to add new sysctls unrelated to builtin signatures.
    
    Also, some users have started checking whether the directory
    /proc/sys/fs/verity exists as a way to tell whether fsverity is
    supported.  This isn't the intended method; instead, the existence of
    /sys/fs/$fstype/features/verity should be checked, or users should just
    try to use the fsverity ioctls.  Regardless, it should be made to work
    as expected without a dependency on CONFIG_FS_VERITY_BUILTIN_SIGNATURES.
    
    Therefore, move the sysctl registration into init.c.  With
    CONFIG_FS_VERITY_BUILTIN_SIGNATURES, nothing changes.  Without it, but
    with CONFIG_FS_VERITY, an empty list of sysctls is now registered.
    
    Link: https://lore.kernel.org/r/20230705212743.42180-3-ebiggers@kernel.org
    
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    456ae5fe
init.c 1.64 KB