We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5131a05 commit 0b34d68Copy full SHA for 0b34d68
net/core/skbuff.c
@@ -4690,10 +4690,16 @@ void __init skb_init(void)
4690
SLAB_HWCACHE_ALIGN|SLAB_PANIC,
4691
NULL);
4692
#ifdef HAVE_SKB_SMALL_HEAD_CACHE
4693
- skb_small_head_cache = kmem_cache_create("skbuff_small_head",
+ /* usercopy should only access first SKB_SMALL_HEAD_HEADROOM bytes.
4694
+ * struct skb_shared_info is located at the end of skb->head,
4695
+ * and should not be copied to/from user.
4696
+ */
4697
+ skb_small_head_cache = kmem_cache_create_usercopy("skbuff_small_head",
4698
SKB_SMALL_HEAD_CACHE_SIZE,
4699
0,
4700
SLAB_HWCACHE_ALIGN | SLAB_PANIC,
4701
+ 0,
4702
+ SKB_SMALL_HEAD_HEADROOM,
4703
4704
#endif
4705
skb_extensions_init();
0 commit comments