Lines Matching defs:user_ctx
1308 struct bpf_flow_keys *user_ctx;
1331 user_ctx = bpf_ctx_init(kattr, sizeof(struct bpf_flow_keys));
1332 if (IS_ERR(user_ctx)) {
1334 return PTR_ERR(user_ctx);
1336 if (user_ctx) {
1337 ret = verify_user_bpf_flow_keys(user_ctx);
1340 flags = user_ctx->flags;
1360 ret = bpf_ctx_finish(kattr, uattr, user_ctx,
1364 kfree(user_ctx);
1376 struct bpf_sk_lookup *user_ctx;
1390 user_ctx = bpf_ctx_init(kattr, sizeof(*user_ctx));
1391 if (IS_ERR(user_ctx))
1392 return PTR_ERR(user_ctx);
1394 if (!user_ctx)
1397 if (user_ctx->sk)
1400 if (!range_is_zero(user_ctx, offsetofend(typeof(*user_ctx), local_port), sizeof(*user_ctx)))
1403 if (user_ctx->local_port > U16_MAX) {
1408 ctx.family = (u16)user_ctx->family;
1409 ctx.protocol = (u16)user_ctx->protocol;
1410 ctx.dport = (u16)user_ctx->local_port;
1411 ctx.sport = user_ctx->remote_port;
1415 ctx.v4.daddr = (__force __be32)user_ctx->local_ip4;
1416 ctx.v4.saddr = (__force __be32)user_ctx->remote_ip4;
1421 ctx.v6.daddr = (struct in6_addr *)user_ctx->local_ip6;
1422 ctx.v6.saddr = (struct in6_addr *)user_ctx->remote_ip6;
1449 user_ctx->cookie = 0;
1456 user_ctx->cookie = sock_gen_cookie(ctx.selected_sk);
1461 ret = bpf_ctx_finish(kattr, uattr, user_ctx, sizeof(*user_ctx));
1465 kfree(user_ctx);
1573 struct nf_hook_state *user_ctx, hook_state = {
1602 user_ctx = bpf_ctx_init(kattr, sizeof(struct nf_hook_state));
1603 if (IS_ERR(user_ctx)) {
1605 return PTR_ERR(user_ctx);
1608 if (user_ctx) {
1609 ret = verify_and_copy_hook_state(&hook_state, user_ctx, dev);
1662 kfree(user_ctx);