History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

David S. Miller committed 5 years ago

Commit d489ded2 parents 86dd986 3af409c56 files · +724 −336Browse files

Showing the changes to kernel (1 of 56 files). Show all

Unified · Split

kernel/bpf/verifier.c+6−4
@@ -11563,7 +11563,7 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) · 11562 unmodified lines
1156311563 bool isdiv = BPF_OP(insn->code) == BPF_DIV;
1156411564 struct bpf_insn *patchlet;
1156511565 struct bpf_insn chk_and_div[] = {
11566− /* Rx div 0 -> 0 */
11566+ /* [R,W]x div 0 -> 0 */
1156711567 BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) |
1156811568 BPF_JNE | BPF_K, insn->src_reg,
1156911569 0, 2, 0),
@@ -11572,16 +11572,18 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) · 2 unmodified lines
1157211572 *insn,
1157311573 };
1157411574 struct bpf_insn chk_and_mod[] = {
11575− /* Rx mod 0 -> Rx */
11575+ /* [R,W]x mod 0 -> [R,W]x */
1157611576 BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) |
1157711577 BPF_JEQ | BPF_K, insn->src_reg,
11578− 0, 1, 0),
11578+ 0, 1 + (is64 ? 0 : 1), 0),
1157911579 *insn,
11580+ BPF_JMP_IMM(BPF_JA, 0, 0, 1),
11581+ BPF_MOV32_REG(insn->dst_reg, insn->dst_reg),
1158011582 };
1158111583
1158211584 patchlet = isdiv ? chk_and_div : chk_and_mod;
1158311585 cnt = isdiv ? ARRAY_SIZE(chk_and_div) :
11584− ARRAY_SIZE(chk_and_mod);
11586+ ARRAY_SIZE(chk_and_mod) - (is64 ? 2 : 0);
1158511587
1158611588 new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt);
1158711589 if (!new_prog)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t