Skip to content

Commit fbba761

Browse files
shiloongmaqiao-mq
authored andcommitted
Revert "bpf: Reject indirect var_off stack access in unpriv mode"
ANBZ: torvalds#342 This reverts commit e232808. Signed-off-by: Qiao Ma <[email protected]> Acked-by: Mao Wenan <[email protected]> Acked-by: Tony Lu <[email protected]>
1 parent 6647be9 commit fbba761

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

kernel/bpf/verifier.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,19 +1812,6 @@ static int check_stack_boundary(struct bpf_verifier_env *env, int regno,
18121812
if (err)
18131813
return err;
18141814
} else {
1815-
/* Variable offset is prohibited for unprivileged mode for
1816-
* simplicity since it requires corresponding support in
1817-
* Spectre masking for stack ALU.
1818-
* See also retrieve_ptr_limit().
1819-
*/
1820-
if (!env->allow_ptr_leaks) {
1821-
char tn_buf[48];
1822-
1823-
tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off);
1824-
verbose(env, "R%d indirect variable offset stack access prohibited for !root, var_off=%s\n",
1825-
regno, tn_buf);
1826-
return -EACCES;
1827-
}
18281815
/* Only initialized buffer on stack is allowed to be accessed
18291816
* with variable offset. With uninitialized buffer it's hard to
18301817
* guarantee that whole memory is marked as initialized on

0 commit comments

Comments
 (0)