Skip to content

Commit 6f793a1

Browse files
minakuba-moo
authored andcommitted
net: netmem: fix skb_ensure_writable with unreadable skbs
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]>
1 parent 60524f1 commit 6f793a1

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
@@ -6261,9 +6261,6 @@ int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len)
62616261
if (!pskb_may_pull(skb, write_len))
62626262
return -ENOMEM;
62636263

6264-
if (!skb_frags_readable(skb))
6265-
return -EFAULT;
6266-
62676264
if (!skb_cloned(skb) || skb_clone_writable(skb, write_len))
62686265
return 0;
62696266

0 commit comments

Comments
 (0)