1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */
5 #include <bpf/bpf_helpers.h>
6 #include <bpf/bpf_tracing.h>
8 #include "bpf_kfuncs.h"
9 #include "crypto_common.h"
13 int crypto_release(void *ctx)
15 struct bpf_crypto_params params = {
21 struct bpf_crypto_ctx *cctx;
26 cctx = bpf_crypto_ctx_create(¶ms, sizeof(params), &err);
33 bpf_crypto_ctx_release(cctx);
39 __failure __msg("Unreleased reference")
40 int crypto_acquire(void *ctx)
42 struct bpf_crypto_params params = {
47 struct bpf_crypto_ctx *cctx;
52 cctx = bpf_crypto_ctx_create(¶ms, sizeof(params), &err);
59 cctx = bpf_crypto_ctx_acquire(cctx);
63 bpf_crypto_ctx_release(cctx);
68 char __license[] SEC("license") = "GPL";