Repository navigation
Commit cf549ed
committed
Walk VM: keep precise scalars out of the loop state so the callbacks converge
From 7.2.7 the verifier simulates every one of the VM's nested bpf_loop
iterations in full, 8 x 16 x 8 of them at ~830 instructions each, and
hits the 1M limit. A callback loop converges only when its entry state
matches an earlier one, and a precise scalar in that state blocks it.
Two leaks: `step` stored the probe-read size into st->wrote, and a size
argument is always marked precise; and walk_node's `wrote == 0` test is
predictable on a range the verifier knows excludes zero, which marks the
operand precise back through the step loop's entry.
Keep the count as a separate opaque copy of arg, never the register that
went to the helper, and test it after a round trip through the event,
where a load from ring buffer memory is an unknown the verifier cannot
predict a branch on.1 parent 9a69758 commit cf549ed
1 file changed
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
246 | 255 | | |
247 | 256 | | |
248 | 257 | | |
249 | | - | |
| 258 | + | |
250 | 259 | | |
251 | 260 | | |
252 | 261 | | |
| |||
294 | 303 | | |
295 | 304 | | |
296 | 305 | | |
297 | | - | |
| 306 | + | |
298 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
299 | 313 | | |
| 314 | + | |
| 315 | + | |
300 | 316 | | |
301 | 317 | | |
302 | 318 | | |
| |||
0 commit comments