diff options
| -rw-r--r-- | kernel/bpf/verifier.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 25baa3c8cdd2..870c8f19ce80 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c | |||
| @@ -6834,17 +6834,18 @@ next: | |||
| 6834 | * the state of the call instruction (with WRITTEN set), and r0 comes | 6834 | * the state of the call instruction (with WRITTEN set), and r0 comes |
| 6835 | * from callee with its full parentage chain, anyway. | 6835 | * from callee with its full parentage chain, anyway. |
| 6836 | */ | 6836 | */ |
| 6837 | for (j = 0; j <= cur->curframe; j++) | ||
| 6838 | for (i = j < cur->curframe ? BPF_REG_6 : 0; i < BPF_REG_FP; i++) | ||
| 6839 | cur->frame[j]->regs[i].parent = &new->frame[j]->regs[i]; | ||
| 6840 | /* clear write marks in current state: the writes we did are not writes | 6837 | /* clear write marks in current state: the writes we did are not writes |
| 6841 | * our child did, so they don't screen off its reads from us. | 6838 | * our child did, so they don't screen off its reads from us. |
| 6842 | * (There are no read marks in current state, because reads always mark | 6839 | * (There are no read marks in current state, because reads always mark |
| 6843 | * their parent and current state never has children yet. Only | 6840 | * their parent and current state never has children yet. Only |
| 6844 | * explored_states can get read marks.) | 6841 | * explored_states can get read marks.) |
| 6845 | */ | 6842 | */ |
| 6846 | for (i = 0; i < BPF_REG_FP; i++) | 6843 | for (j = 0; j <= cur->curframe; j++) { |
| 6847 | cur->frame[cur->curframe]->regs[i].live = REG_LIVE_NONE; | 6844 | for (i = j < cur->curframe ? BPF_REG_6 : 0; i < BPF_REG_FP; i++) |
| 6845 | cur->frame[j]->regs[i].parent = &new->frame[j]->regs[i]; | ||
| 6846 | for (i = 0; i < BPF_REG_FP; i++) | ||
| 6847 | cur->frame[j]->regs[i].live = REG_LIVE_NONE; | ||
| 6848 | } | ||
| 6848 | 6849 | ||
| 6849 | /* all stack frames are accessible from callee, clear them all */ | 6850 | /* all stack frames are accessible from callee, clear them all */ |
| 6850 | for (j = 0; j <= cur->curframe; j++) { | 6851 | for (j = 0; j <= cur->curframe; j++) { |
