Skip to content

Commit

Permalink
bpf: lxc: add drop notifications for missed tail calls in to-container
Browse files Browse the repository at this point in the history
cil_to_container() has some paths that don't raise a drop notification for
DROP_MISSED_TAIL_CALL. Fix them.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann committed Jul 21, 2023
1 parent 375b345 commit db3def4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bpf/bpf_lxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,9 @@ int cil_to_container(struct __ctx_buff *ctx)
#if defined(ENABLE_L7_LB)
else if (magic == MARK_MAGIC_PROXY_EGRESS_EPID) {
tail_call_dynamic(ctx, &POLICY_EGRESSCALL_MAP, identity);
return DROP_MISSED_TAIL_CALL;
return send_drop_notify(ctx, identity, SECLABEL, LXC_ID,
DROP_MISSED_TAIL_CALL, CTX_ACT_DROP,
METRIC_INGRESS);
}
#endif

Expand All @@ -2194,7 +2196,9 @@ int cil_to_container(struct __ctx_buff *ctx)
ctx_store_meta(ctx, CB_FROM_HOST, 1);
ctx_store_meta(ctx, CB_DST_ENDPOINT_ID, LXC_ID);
tail_call_static(ctx, &POLICY_CALL_MAP, HOST_EP_ID);
return DROP_MISSED_TAIL_CALL;
return send_drop_notify(ctx, identity, SECLABEL, LXC_ID,
DROP_MISSED_TAIL_CALL, CTX_ACT_DROP,
METRIC_INGRESS);
}
#endif /* ENABLE_HOST_FIREWALL && !ENABLE_ROUTING */

Expand Down

0 comments on commit db3def4

Please sign in to comment.