Skip to content

Commit ac462a7

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 3890da7 commit ac462a7

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
@@ -6197,9 +6197,6 @@ int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len)
61976197
if (!pskb_may_pull(skb, write_len))
61986198
return -ENOMEM;
61996199

6200-
if (!skb_frags_readable(skb))
6201-
return -EFAULT;
6202-
62036200
if (!skb_cloned(skb) || skb_clone_writable(skb, write_len))
62046201
return 0;
62056202

0 commit comments

Comments
 (0)