github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/socket_netlink_crypto.txt (about)

     1  # Copyright 2017 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  # AF_NETLINK/NETLINK_CRYPTO support.
     5  
     6  include <linux/net.h>
     7  include <linux/crypto.h>
     8  include <uapi/linux/netlink.h>
     9  include <uapi/linux/cryptouser.h>
    10  
    11  resource sock_nl_crypto[sock_netlink]
    12  
    13  socket$nl_crypto(domain const[AF_NETLINK], type const[SOCK_RAW], proto const[NETLINK_CRYPTO]) sock_nl_crypto
    14  
    15  sendmsg$nl_crypto(fd sock_nl_crypto, msg ptr[in, msghdr_nl_crypto], f flags[send_flags])
    16  
    17  type msghdr_nl_crypto msghdr_netlink[netlink_msg_crypto]
    18  
    19  netlink_msg_crypto [
    20  	alg	netlink_msg[CRYPTO_MSG_NEWALG, crypto_user_alg, netlink_crypto_attrs]
    21  	del	netlink_msg[CRYPTO_MSG_DELALG, crypto_user_alg, netlink_crypto_attrs]
    22  	upd	netlink_msg[CRYPTO_MSG_UPDATEALG, crypto_user_alg, netlink_crypto_attrs]
    23  	get	netlink_msg[CRYPTO_MSG_GETALG, crypto_user_alg, netlink_crypto_attrs]
    24  	delrng	netlink_msg[CRYPTO_MSG_DELRNG, void, void]
    25  	getstat	netlink_msg[CRYPTO_MSG_GETSTAT, crypto_user_alg, void]
    26  ] [varlen]
    27  
    28  type netlink_crypto_attrs nlattr[CRYPTOCFGA_PRIORITY_VAL, int32]
    29  
    30  crypto_user_alg {
    31  	cru_name	alg_name
    32  # TODO: generate driver names.
    33  	cru_driver_name	array[const[0, int8], CRYPTO_MAX_NAME]
    34  	cru_module_name	array[const[0, int8], CRYPTO_MAX_NAME]
    35  	cru_type	flags[crypto_user_alg_flags, int32]
    36  	cru_mask	flags[crypto_user_alg_flags, int32]
    37  	cru_refcnt	const[0, int32]
    38  	cru_flags	const[0, int32]
    39  }
    40  
    41  crypto_user_alg_flags = CRYPTO_ALG_TESTED, CRYPTO_ALG_INTERNAL