#include <linux/atomic.h>
#include <crypto/if_alg.h>
#include <linux/crypto.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched/signal.h>
#include <linux/security.h>
const struct af_alg_type *type;
static atomic_long_t alg_memory_allocated;
static struct proto alg_proto = {
.memory_allocated = &alg_memory_allocated,
.obj_size = sizeof(struct alg_sock),
static LIST_HEAD(alg_types);
static DECLARE_RWSEM(alg_types_sem);
static const struct af_alg_type *alg_get_type(const char *name)
const struct af_alg_type *type = ERR_PTR(-ENOENT);
struct alg_type_list *node;
down_read(&alg_types_sem);
list_for_each_entry(node, &alg_types, list) {
if (strcmp(node->type->name, name))
if (try_module_get(node->type->owner))
int af_alg_register_type(const struct af_alg_type *type)
struct alg_type_list *node;
down_write(&alg_types_sem);