Skip to content

xfrm: hold dev ref until after transport_finish NF_HOOK

Simon Liebold lkml netdev stable 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v21 patch 2 repliesApplied
  3. v11 patch 0 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2xfrm: hold device only for the asynchronous decryptionnet/xfrm/xfrm_input.c+9 -80 replies
2/2xfrm: hold dev ref until after transport_finish NF_HOOKnet/ipv4/xfrm4_input.c net/ipv6/xfrm6_input.c net/xfrm/xfrm_input.c+18 -40 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchCosmin Ratiu
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH 6.12.y v3 0/2] xfrm: hold dev ref until after transport_finish NF_HOOK

Thanks for the detailed analysis on v2, Sasha. Here's v3.

v3: Backport b05d42eefac7 ("xfrm: hold device only for the asynchronous decryption") as a prerequisite, making the tree structurally match mainline so the fix applies without the lifetime gap Sasha identified in v2, where the dev_put at resume: dropped the ref before the re-hold could cover it.

v2: Restore unconditional dev_put at resume: and instead take a fresh dev_hold immediately before transport_finish (when async && !xfrm_gro), avoiding the reference leak on nested transport-mode that v1's suppressed resume: dev_put caused. Prerequisite b05d42eefac7 ("xfrm: hold device only for the asynchronous decryption") was not backported as it restructures the lock ordering and resume:
label semantics of the decryption loop, requiring non-trivial adaptation beyond what a minimal stable fix warrants.

Jianbo Liu (1):
xfrm: hold device only for the asynchronous decryption

Qi Tang (1):
xfrm: hold dev ref until after transport_finish NF_HOOK

 net/ipv4/xfrm4_input.c |  5 ++++-
 net/ipv6/xfrm6_input.c |  5 ++++-
 net/xfrm/xfrm_input.c  | 25 +++++++++++++++++--------
 3 files changed, 25 insertions(+), 10 deletions(-)

base-commit: 1d3a00d3bacff25652c96e1527610c69e91f7c38

Signature · 12 lines
2.50.1




Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597