projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46d1816
)
netmem: fix skb_frag_address_safe with unreadable skbs
author
Mina Almasry
<almasrymina@google.com>
Thu, 19 Jun 2025 17:52:38 +0000
(17:52 +0000)
committer
Jakub Kicinski
<kuba@kernel.org>
Sat, 21 Jun 2025 14:35:01 +0000
(07:35 -0700)
skb_frag_address_safe() needs a check that the
skb_frag_page exists check similar to skb_frag_address().
Cc: ap420073@gmail.com
Signed-off-by: Mina Almasry <almasrymina@google.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link:
https://patch.msgid.link/20250619175239.3039329-1-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/skbuff.h
patch
|
blob
|
history
diff --git
a/include/linux/skbuff.h
b/include/linux/skbuff.h
index
9508968
..
4f6dcb3
100644
(file)
--- a/
include/linux/skbuff.h
+++ b/
include/linux/skbuff.h
@@
-3665,7
+3665,13
@@
static inline void *skb_frag_address(const skb_frag_t *frag)
*/
static inline void *skb_frag_address_safe(const skb_frag_t *frag)
{
- void *ptr = page_address(skb_frag_page(frag));
+ struct page *page = skb_frag_page(frag);
+ void *ptr;
+
+ if (!page)
+ return NULL;
+
+ ptr = page_address(page);
if (unlikely(!ptr))
return NULL;