This is a note to let you know that I've just added the patch titled tg3: Use slab_build_skb() when needed to the 6.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tg3-use-slab_build_skb-when-needed.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 83f12c89fa5f2c51a3e822ee193efc620087f225 Author: Kees Cook <keescook@xxxxxxxxxxxx> Date: Fri Aug 18 10:54:21 2023 -0700 tg3: Use slab_build_skb() when needed [ Upstream commit 99b415fe8986803ba0eaf6b8897b16edc8fe7ec2 ] The tg3 driver will use kmalloc() under some conditions. Check the frag_size and use slab_build_skb() when frag_size is 0. Silences the warning introduced by commit ce098da1497c ("skbuff: Introduce slab_build_skb()"): Use slab_build_skb() instead ... tg3_poll_work+0x638/0xf90 [tg3] Fixes: ce098da1497c ("skbuff: Introduce slab_build_skb()") Reported-by: Fiona Ebner <f.ebner@xxxxxxxxxxx> Closes: https://lore.kernel.org/all/1bd4cb9c-4eb8-3bdb-3e05-8689817242d1@xxxxxxxxxxx Cc: Siva Reddy Kallam <siva.kallam@xxxxxxxxxxxx> Cc: Prashant Sreedharan <prashant@xxxxxxxxxxxx> Cc: Michael Chan <mchan@xxxxxxxxxxxx> Cc: Bagas Sanjaya <bagasdotme@xxxxxxxxx> Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Reviewed-by: Pavan Chebbi <pavan.chebbi@xxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230818175417.never.273-kees@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 5ef073a79ce94..cb2810f175ccd 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -6881,7 +6881,10 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) ri->data = NULL; - skb = build_skb(data, frag_size); + if (frag_size) + skb = build_skb(data, frag_size); + else + skb = slab_build_skb(data); if (!skb) { tg3_frag_free(frag_size != 0, data); goto drop_it_no_recycle;