• Kees Cook's avatar
    big_keys: Use struct for internal payload · c1298a3a
    Kees Cook authored
    The randstruct GCC plugin gets upset when it sees struct path (which is
    randomized) being assigned from a "void *" (which it cannot type-check).
    
    There's no need for these casts, as the entire internal payload use is
    following a normal struct layout. Convert the enum-based void * offset
    dereferencing to the new big_key_payload struct. No meaningful machine
    code changes result after this change, and source readability is improved.
    
    Drop the randstruct exception now that there is no "confusing" cross-type
    assignment.
    
    Cc: David Howells <dhowells@redhat.com>
    Cc: Eric Biggers <ebiggers@kernel.org>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Jarkko Sakkinen <jarkko@kernel.org>
    Cc: James Morris <jmorris@namei.org>
    Cc: "Serge E. Hallyn" <serge@hallyn.com>
    Cc: linux-hardening@vger.kernel.org
    Cc: keyrings@vger.kernel.org
    Cc: linux-security-module@vger.kernel.org
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    c1298a3a
big_key.c 6.54 KB