[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210622110026.1157847-1-ravi.bangoria@linux.ibm.com>
Date: Tue, 22 Jun 2021 16:30:26 +0530
From: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
To: ast@...nel.org
Cc: ravi.bangoria@...ux.ibm.com, davem@...emloft.net,
yoshfuji@...ux-ipv6.org, dsahern@...nel.org, daniel@...earbox.net,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, x86@...nel.org,
hpa@...or.com, andrii@...nel.org, kafai@...com,
songliubraving@...com, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, naveen.n.rao@...ux.vnet.ibm.com
Subject: [PATCH] x86 bpf: Fix extable offset calculation
commit 4c5de127598e1 ("bpf: Emit explicit NULL pointer checks
for PROBE_LDX instructions.") is emitting couple of instructions
before actual load. Consider those additional instructions while
calculating extable offset.
Fixes: 4c5de127598e1 ("bpf: Emit explicit NULL pointer checks for PROBE_LDX instructions.")
Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
---
arch/x86/net/bpf_jit_comp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 2a2e290fa5d8..231a8178cc11 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -1297,7 +1297,7 @@ st: if (is_imm8(insn->off))
emit_ldx(&prog, BPF_SIZE(insn->code), dst_reg, src_reg, insn->off);
if (BPF_MODE(insn->code) == BPF_PROBE_MEM) {
struct exception_table_entry *ex;
- u8 *_insn = image + proglen;
+ u8 *_insn = image + proglen + (u8)(start_of_ldx - temp);
s64 delta;
/* populate jmp_offset for JMP above */
--
2.30.2
Powered by blists - more mailing lists