Commit 97550f6
net: compound page support in skb_seq_read
skb_seq_read iterates over an skb, returning pointer and length of
the next data range with each call.
It relies on kmap_atomic to access highmem pages when needed.
An skb frag may be backed by a compound page, but kmap_atomic maps
only a single page. There are not enough kmap slots to always map all
pages concurrently.
Instead, if kmap_atomic is needed, iterate over each page.
As this increases the number of calls, avoid this unless needed.
The necessary condition is captured in skb_frag_must_loop.
I tried to make the change as obvious as possible. It should be easy
to verify that nothing changes if skb_frag_must_loop returns false.
Tested:
On an x86 platform with
CONFIG_HIGHMEM=y
CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP=y
CONFIG_NETFILTER_XT_MATCH_STRING=y
Run
ip link set dev lo mtu 1500
iptables -A OUTPUT -m string --string 'badstring' -algo bm -j ACCEPT
dd if=/dev/urandom of=in bs=1M count=20
nc -l -p 8000 > /dev/null &
nc -w 1 -q 0 localhost 8000 < in
Signed-off-by: Willem de Bruijn <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>1 parent 29766bc commit 97550f6
2 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
| 1206 | + | |
1206 | 1207 | | |
1207 | 1208 | | |
1208 | 1209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3442 | 3442 | | |
3443 | 3443 | | |
3444 | 3444 | | |
| 3445 | + | |
3445 | 3446 | | |
3446 | 3447 | | |
3447 | 3448 | | |
| |||
3496 | 3497 | | |
3497 | 3498 | | |
3498 | 3499 | | |
| 3500 | + | |
| 3501 | + | |
3499 | 3502 | | |
3500 | | - | |
3501 | 3503 | | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
3502 | 3516 | | |
3503 | 3517 | | |
3504 | | - | |
| 3518 | + | |
3505 | 3519 | | |
3506 | | - | |
| 3520 | + | |
3507 | 3521 | | |
3508 | 3522 | | |
3509 | 3523 | | |
| |||
3514 | 3528 | | |
3515 | 3529 | | |
3516 | 3530 | | |
3517 | | - | |
3518 | | - | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
3519 | 3537 | | |
3520 | 3538 | | |
3521 | 3539 | | |
| |||
0 commit comments