Commit 1391ecf
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 d4c4bd2 commit 1391ecf
1 file changed
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5095 | 5095 | | |
5096 | 5096 | | |
5097 | 5097 | | |
| 5098 | + | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
| 5102 | + | |
| 5103 | + | |
| 5104 | + | |
| 5105 | + | |
| 5106 | + | |
| 5107 | + | |
| 5108 | + | |
| 5109 | + | |
5098 | 5110 | | |
5099 | 5111 | | |
5100 | 5112 | | |
| |||
5192 | 5204 | | |
5193 | 5205 | | |
5194 | 5206 | | |
5195 | | - | |
5196 | | - | |
5197 | | - | |
5198 | | - | |
5199 | | - | |
5200 | | - | |
| 5207 | + | |
5201 | 5208 | | |
5202 | 5209 | | |
5203 | 5210 | | |
| |||
5321 | 5328 | | |
5322 | 5329 | | |
5323 | 5330 | | |
5324 | | - | |
5325 | | - | |
| 5331 | + | |
| 5332 | + | |
| 5333 | + | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
5326 | 5338 | | |
5327 | 5339 | | |
5328 | 5340 | | |
| |||
0 commit comments