Skip to contentSkip to conversation

Patch "bpf/verifier: reject BPF_ALU64|BPF_END" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Oct 19, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

bpf/verifier: reject BPF_ALU64|BPF_END

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
bpf-verifier-reject-bpf_alu64-bpf_end.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Oct 19 14:44:13 CEST 2017

From: Edward Cree <[email protected]>
Date: Fri, 15 Sep 2017 14:37:38 +0100
Subject: bpf/verifier: reject BPF_ALU64|BPF_END

From: Edward Cree <[email protected]>

[ Upstream commit e67b8a685c7c984e834e3181ef4619cd7025a136 ]

Neither ___bpf_prog_run nor the JITs accept it.
Also adds a new test case.

---
 kernel/bpf/verifier.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/bpf/verifier.c +2 -1
@@ -932,7 +932,8 @@ static int check_alu_op(struct reg_state
 			}
 		} else {
 			if (insn->src_reg != BPF_REG_0 || insn->off != 0 ||
-			    (insn->imm != 16 && insn->imm != 32 && insn->imm != 64)) {
+			    (insn->imm != 16 && insn->imm != 32 && insn->imm != 64) ||
+			    BPF_CLASS(insn->code) == BPF_ALU64) {
 				verbose("BPF_END uses reserved fields\n");
 				return -EINVAL;
 			}

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/bpf-verifier-reject-bpf_alu64-bpf_end.patch