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

!1337 [sync] PR-1335: bpf: Fix incorrect verifier pruning due to missing register precision taints

parents 10c9fe8d a1b310b4
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1922,6 +1922,21 @@ static int backtrack_insn(struct bpf_verifier_env *env, int idx,
			}
		} else if (opcode == BPF_EXIT) {
			return -ENOTSUPP;
		} else if (BPF_SRC(insn->code) == BPF_X) {
			if (!(*reg_mask & (dreg | sreg)))
				return 0;
			/* dreg <cond> sreg
			 * Both dreg and sreg need precision before
			 * this insn. If only sreg was marked precise
			 * before it would be equally necessary to
			 * propagate it to dreg.
			 */
			*reg_mask |= (sreg | dreg);
			 /* else dreg <cond> K
			  * Only dreg still needs precision before
			  * this insn, so for the K-based conditional
			  * there is nothing new to be marked.
			  */
		}
	} else if (class == BPF_LD) {
		if (!(*reg_mask & dreg))