Commit d849a2f
xfrm: iptfs: only publish mode_data after clone setup
iptfs_clone_state() stores x->mode_data before allocating the reorder
window. If that allocation fails, the code frees the cloned state and
returns -ENOMEM, leaving x->mode_data pointing at freed memory.
The xfrm clone unwind later runs destroy_state() through x->mode_data,
so the failed clone path tears down IPTFS state that clone_state()
already freed.
Keep the cloned IPTFS state private until all allocations succeed so
failed clones leave x->mode_data unset. The destroy path already
handles a NULL mode_data pointer.
Fixes: 6be02e3 ("xfrm: iptfs: handle reordering of received packets")
Cc: [email protected]
Signed-off-by: Paul Moses <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>1 parent eb2d16a commit d849a2f
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2664 | 2664 | | |
2665 | 2665 | | |
2666 | 2666 | | |
2667 | | - | |
2668 | | - | |
2669 | | - | |
2670 | 2667 | | |
2671 | 2668 | | |
2672 | 2669 | | |
| |||
2677 | 2674 | | |
2678 | 2675 | | |
2679 | 2676 | | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
2680 | 2680 | | |
2681 | 2681 | | |
2682 | 2682 | | |
| |||
0 commit comments