Commit d45781c
bpf: Fix variable length stack write over spilled pointers
[ Upstream commit 4639eb9 ]
Scrub slots if variable-offset stack write goes over spilled pointers.
Otherwise is_spilled_reg() may == true && spilled_ptr.type == NOT_INIT
and valid program is rejected by check_stack_read_fixed_off()
with obscure "invalid size of register fill" message.
Fixes: 01f810a ("bpf: Allow variable-offset stack access")
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260324215938.81733-1-alexei.starovoitov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent cb2c1f3 commit d45781c
1 file changed
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4724 | 4724 | | |
4725 | 4725 | | |
4726 | 4726 | | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
| 4738 | + | |
4727 | 4739 | | |
4728 | 4740 | | |
4729 | 4741 | | |
| |||
4809 | 4821 | | |
4810 | 4822 | | |
4811 | 4823 | | |
4812 | | - | |
4813 | | - | |
4814 | | - | |
4815 | | - | |
4816 | | - | |
4817 | | - | |
| 4824 | + | |
4818 | 4825 | | |
4819 | 4826 | | |
4820 | 4827 | | |
| |||
4949 | 4956 | | |
4950 | 4957 | | |
4951 | 4958 | | |
4952 | | - | |
4953 | | - | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
| 4964 | + | |
| 4965 | + | |
4954 | 4966 | | |
4955 | 4967 | | |
4956 | 4968 | | |
| |||
0 commit comments