• Eric Biggers's avatar
    fscrypt: make "#define fscrypt_policy" user-only · c7f0207b
    Eric Biggers authored
    The fscrypt UAPI header defines fscrypt_policy to fscrypt_policy_v1,
    for source compatibility with old userspace programs.
    
    Internally, the kernel doesn't want that compatibility definition.
    Instead, fscrypt_private.h #undefs it and re-defines it to a union.
    
    That works for now.  However, in order to add
    fscrypt_operations::get_dummy_policy(), we'll need to forward declare
    'union fscrypt_policy' in include/linux/fscrypt.h.  That would cause
    build errors because "fscrypt_policy" is used in ioctl numbers.
    
    To avoid this, modify the UAPI header to make the fscrypt_policy
    compatibility definition conditional on !__KERNEL__, and make the ioctls
    use fscrypt_policy_v1 instead of fscrypt_policy.
    
    Note that this doesn't change the actual ioctl numbers.
    Acked-by: default avatarJeff Layton <jlayton@kernel.org>
    Link: https://lore.kernel.org/r/20200917041136.178600-11-ebiggers@kernel.orgSigned-off-by: default avatarEric Biggers <ebiggers@google.com>
    c7f0207b
fscrypt_private.h 17.5 KB