Skip to content

Commit 32955a4

Browse files
minagregkh
authored andcommitted
net: netmem: fix skb_ensure_writable with unreadable skbs
[ Upstream commit 6f793a1 ] skb_ensure_writable should succeed when it's trying to write to the header of the unreadable skbs, so it doesn't need an unconditional skb_frags_readable check. The preceding pskb_may_pull() call will succeed if write_len is within the head and fail if we're trying to write to the unreadable payload, so we don't need an additional check. Removing this check restores DSCP functionality with unreadable skbs as it's called from dscp_tg. Cc: [email protected] Cc: [email protected] Fixes: 65249fe ("net: add support for skbs with unreadable frags") Signed-off-by: Mina Almasry <[email protected]> Acked-by: Stanislav Fomichev <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent ed42b8d commit 32955a4

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

net/core/skbuff.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6220,9 +6220,6 @@ int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len)
62206220
if (!pskb_may_pull(skb, write_len))
62216221
return -ENOMEM;
62226222

6223-
if (!skb_frags_readable(skb))
6224-
return -EFAULT;
6225-
62266223
if (!skb_cloned(skb) || skb_clone_writable(skb, write_len))
62276224
return 0;
62286225

0 commit comments

Comments
 (0)