nsh: limit recursion in nsh_gso_segment()
Status from this message: This series was applied to netdev/net.git (main)
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | nsh: limit recursion in nsh_gso_segment()include/ net/ | +8 | 3 replies | Applied |
| 2/2 | selftests: net: add a test for NSH GSOtools/ tools/ tools/ +2 more | +201 | 0 replies | Applied |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Jiri Benc | Willem de Bruijn |
|---|---|---|
| 1/2 | R-b | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net 0/2] nsh: limit recursion in nsh_gso_segment()
Sashiko found that nsh_gso_segment() can call itself, through skb_mac_gso_segment(), once per stacked NSH header. Nothing limits the depth, and a 64KB GSO packet made of 8-byte NSH headers overflows the kernel stack. It was reported while reviewing an unrelated virtio series [1].
Such a packet can be sent with a packet socket using PACKET_VNET_HDR, when the nsh module is loaded.
Patch 1 uses the recursion counter added in commit 006c8b834aed ("net:
gso: limit recursive IP-in-IP segmentation"), with the same limit as IPv4 and IPv6.
Patch 2 adds a selftest: it panics an unfixed kernel, and passes with patch 1.
[1] https://lore.kernel.org/netdev/[email protected]/
Eric Dumazet (2):
nsh: limit recursion in nsh_gso_segment()
selftests: net: add a test for NSH GSO
include/net/gso.h | 2 +- net/nsh/nsh.c | 7 ++ tools/testing/selftests/net/.gitignore | 1 + tools/testing/selftests/net/Makefile | 2 + tools/testing/selftests/net/config | 1 + tools/testing/selftests/net/nsh_gso.c | 126 +++++++++++++++++++++++++ tools/testing/selftests/net/nsh_gso.sh | 71 ++++++++++++++ 7 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/net/nsh_gso.c create mode 100755 tools/testing/selftests/net/nsh_gso.sh
base-commit: 145480b28ca82e9fae789427cc4569e596515a32
Signature · 1 line
2.53.0