Commit 02bddee
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 7027e70 commit 02bddee
1 file changed
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5241 | 5241 | | |
5242 | 5242 | | |
5243 | 5243 | | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
| 5255 | + | |
5244 | 5256 | | |
5245 | 5257 | | |
5246 | 5258 | | |
| |||
5338 | 5350 | | |
5339 | 5351 | | |
5340 | 5352 | | |
5341 | | - | |
5342 | | - | |
5343 | | - | |
5344 | | - | |
5345 | | - | |
5346 | | - | |
| 5353 | + | |
5347 | 5354 | | |
5348 | 5355 | | |
5349 | 5356 | | |
| |||
5467 | 5474 | | |
5468 | 5475 | | |
5469 | 5476 | | |
5470 | | - | |
5471 | | - | |
| 5477 | + | |
| 5478 | + | |
| 5479 | + | |
| 5480 | + | |
| 5481 | + | |
| 5482 | + | |
| 5483 | + | |
5472 | 5484 | | |
5473 | 5485 | | |
5474 | 5486 | | |
| |||
0 commit comments