diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-12-22 21:49:16 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-12-27 17:37:07 -0800 |
commit | a73bf9f2d969cbb04d5ca778f2a224060cda1027 (patch) | |
tree | 0ca09c6ab86d829b8b6a991419473dad92a45416 /certs/system_keyring.c | |
parent | e8f55fcf77794c9867a5edbcb84baf21609465a7 (diff) |
bpf: reorganize struct bpf_reg_state fields
Move id and ref_obj_id fields after scalar data section (var_off and
ranges). This is necessary to simplify next patch which will change
regsafe()'s logic to be safer, as it makes the contents that has to be
an exact match (type-specific parts, off, type, and var_off+ranges)
a single sequential block of memory, while id and ref_obj_id should
always be remapped and thus can't be memcp()'ed.
There are few places that assume that var_off is after id/ref_obj_id to
clear out id/ref_obj_id with the single memset(0). These are changed to
explicitly zero-out id/ref_obj_id fields. Other places are adjusted to
preserve exact byte-by-byte comparison behavior.
No functional changes.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20221223054921.958283-3-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'certs/system_keyring.c')
0 files changed, 0 insertions, 0 deletions