|
@@ -207,3 +207,18 @@ static void build_prologue(struct jit_ctx *ctx)
|
|
emit(ARM_SUB_R(r_skb_hl, r_skb_hl, r_scratch), ctx);
|
|
emit(ARM_SUB_R(r_skb_hl, r_skb_hl, r_scratch), ctx);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (ctx->flags & FLAG_NEED_X_RESET)
|
|
|
|
+ emit(ARM_MOV_I(r_X, 0), ctx);
|
|
|
|
+
|
|
|
|
+ /* do not leak kernel data to userspace */
|
|
|
|
+ if ((first_inst != BPF_S_RET_K) && !(is_load_to_a(first_inst)))
|
|
|
|
+ emit(ARM_MOV_I(r_A, 0), ctx);
|
|
|
|
+
|
|
|
|
+ /* stack space for the BPF_MEM words */
|
|
|
|
+ if (ctx->seen & SEEN_MEM)
|
|
|
|
+ emit(ARM_SUB_I(ARM_SP, ARM_SP, mem_words_used(ctx) * 4), ctx);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void build_epilogue(struct jit_ctx *ctx)
|
|
|
|
+{
|
|
|
|
+ u16 reg_set = saved_regs(ctx);
|