summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorMina Almasry <almasrymina@google.com>2025-06-15 20:07:33 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-27 11:11:43 +0100
commitac462a75fd38e5b4afee03292846b860c2d472fe (patch)
tree254424084577b40ea9be5880c2e12a81700826e0 /net/core
parent3890da762a66191c440b0bd6e3ee45501edbb0c1 (diff)
downloadlinux-ac462a75fd38e5b4afee03292846b860c2d472fe.tar.gz
linux-ac462a75fd38e5b4afee03292846b860c2d472fe.tar.bz2
linux-ac462a75fd38e5b4afee03292846b860c2d472fe.zip
net: netmem: fix skb_ensure_writable with unreadable skbs
[ 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: 65249feb6b3d ("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>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index fdb36165c58f..cf54593149cc 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6197,9 +6197,6 @@ int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len)
if (!pskb_may_pull(skb, write_len))
return -ENOMEM;
- if (!skb_frags_readable(skb))
- return -EFAULT;
-
if (!skb_cloned(skb) || skb_clone_writable(skb, write_len))
return 0;