Unverified Commit 811d7be1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5816 [sync] PR-5780: bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS

parents 0ee538fe 8786e17f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6091,6 +6091,10 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env,
	}

	switch (base_type(ptr_reg->type)) {
	case PTR_TO_FLOW_KEYS:
		if (known)
			break;
		fallthrough;
	case CONST_PTR_TO_MAP:
		/* smin_val represents the known value */
		if (known && smin_val == 0 && opcode == BPF_ADD)