Skip to content

Commit 44c06eb

Browse files
minasmb49
authored andcommitted
net: netmem: fix skb_ensure_writable with unreadable skbs
BugLink: https://bugs.launchpad.net/bugs/2120812 [ Upstream commit 6f793a1d053775f8324b8dba1e7ed224f8b0166f ] 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: willemb@google.com Cc: asml.silence@gmail.com Fixes: 65249fe ("net: add support for skbs with unreadable frags") Signed-off-by: Mina Almasry <almasrymina@google.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20250615200733.520113-1-almasrymina@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 94c9994 commit 44c06eb

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
@@ -6103,9 +6103,6 @@ int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len)
61036103
if (!pskb_may_pull(skb, write_len))
61046104
return -ENOMEM;
61056105

6106-
if (!skb_frags_readable(skb))
6107-
return -EFAULT;
6108-
61096106
if (!skb_cloned(skb) || skb_clone_writable(skb, write_len))
61106107
return 0;
61116108

0 commit comments

Comments
 (0)