mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
net: tcp: block mixing readable and unreadable frags
Protect tcp_sendmsg_locked() from mistakenly mixing readable and
unreadable page fragments in the same SKB.
Check that the devmem binding matches the existing SKB's readability.
If a mismatch is detected, avoid collapsing and create a new segment.
Fixes: bd61848900 ("net: devmem: Implement TX path")
Suggested-by: Eric Dumazet <[email protected]>
Cc: Pavel Begunkov <[email protected]>
Cc: Stanislav Fomichev <[email protected]>
Cc: Bobby Eshleman <[email protected]>
Signed-off-by: Mina Almasry <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
1 parent
68d8c65326
commit
d9c56501c7
1 file changed
+2
-1
+2
-1
@@ -1240,7 +1240,8 @@ restart:
|
||||
|
||||
trace_tcp_sendmsg_locked(sk, msg, skb, size_goal);
|
||||
|
||||
if (copy <= 0 || !tcp_skb_can_collapse_to(skb)) {
|
||||
if (copy <= 0 || !tcp_skb_can_collapse_to(skb) ||
|
||||
unlikely(skb_frags_readable(skb) != !binding)) {
|
||||
bool first_skb;
|
||||
|
||||
new_segment:
|
||||
|
||||
Reference in new issue
Block a user