Commit 395e942d authored by Simon Wang's avatar Simon Wang Committed by Daniel Borkmann
Browse files

bpf: Replace hard-coded 0 with BPF_K in check_alu_op

parent 6dc7a0ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9096,7 +9096,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)

	if (opcode == BPF_END || opcode == BPF_NEG) {
		if (opcode == BPF_NEG) {
			if (BPF_SRC(insn->code) != 0 ||
			if (BPF_SRC(insn->code) != BPF_K ||
			    insn->src_reg != BPF_REG_0 ||
			    insn->off != 0 || insn->imm != 0) {
				verbose(env, "BPF_NEG uses reserved fields\n");