idpf: fix potential use-after-free in idpf_tso()
Subsystems (3)
PATCH 1/1 idpf: fix potential use-after-free in idpf_tso()
skb_cow_head() can change skb->head (and thus skb_shinfo(skb))
We must not cache skb_shinfo(skb) before skb_cow_head().
Fixes 6818c4d5b3c2 ("idpf: add splitq start_xmit")
Signed-off-by Eric Dumazet <[email protected]>
Cc Joshua Hay <[email protected]>
Cc Alan Brady <[email protected]>
Cc Madhu Chittim <[email protected]>
Cc Phani Burra <[email protected]>
Cc Sridhar Samudrala <[email protected]>
Cc Willem de Bruijn <[email protected]>
Cc Pavan Kumar Linga <[email protected]>
Cc Tony Nguyen <[email protected]>
Cc Bailey Forrest <[email protected]>
--- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_txrx.c +4 -2
@@ -2365,7 +2365,7 @@ static void idpf_tx_splitq_map(struct idpf_queue *tx_q,*/ int idpf_tso (struct sk_buff *skb,struct idpf_tx_offload_params *off) { -const struct skb_shared_info *shinfo =skb_shinfo (skb); +const struct skb_shared_info *shinfo;union {struct iphdr *v4;struct ipv6hdr *v6;
@@ -2379,13 +2379,15 @@ int idpf_tso(struct sk_buff *skb, struct idpf_tx_offload_params *off)u32 paylen, l4_start;int err; -if (!shinfo->gso_size) +if (!skb_is_gso (skb))return 0 ; err =skb_cow_head (skb,0 );if (err <0 )return err; + shinfo =skb_shinfo (skb); + ip.hdr =skb_network_header (skb); l4.hdr =skb_transport_header (skb);
Signature · 1 line
2.42.0.869.gea05f2083d-goog
Quoted 15 lines · Eric Dumazet
skb_cow_head()can changeskb->head(and thusskb_shinfo(skb))We must not cache
skb_shinfo(skb)beforeskb_cow_head().Fixes 6818c4d5b3c2 ("idpf: add splitq start_xmit")Signed-off-by Eric Dumazet <[email protected]>Cc Joshua Hay <[email protected]>Cc Alan Brady <[email protected]>Cc Madhu Chittim <[email protected]>Cc Phani Burra <[email protected]>Cc Sridhar Samudrala <[email protected]>Cc Willem de Bruijn <[email protected]>Cc Pavan Kumar Linga <[email protected]>Cc Tony Nguyen <[email protected]>Cc Bailey Forrest <[email protected]>
Quoted 1 line
---
Reviewed-by Jacob Keller <[email protected]>
Quoted 33 lines
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/idpf/idpf_txrx.c +4
-2@@ -2365,7 +2365,7 @@ static void idpf_tx_splitq_map(struct idpf_queue *tx_q,*/ int idpf_tso (struct sk_buff *skb,struct idpf_tx_offload_params *off) { -const struct skb_shared_info *shinfo =skb_shinfo (skb); +const struct skb_shared_info *shinfo;union {struct iphdr *v4;struct ipv6hdr *v6;@@ -2379,13 +2379,15 @@ int idpf_tso(struct sk_buff *skb, struct idpf_tx_offload_params *off)u32 paylen, l4_start;int err; -if (!shinfo->gso_size) +if (!skb_is_gso (skb))return 0 ; err =skb_cow_head (skb,0 );if (err <0 )return err; + shinfo =skb_shinfo (skb); + ip.hdr =skb_network_header (skb); l4.hdr =skb_transport_header (skb);
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 16 lines · On Fri, 3 Nov 2023 20:04:51 +0000 you wrote:
skb_cow_head()can changeskb->head(and thusskb_shinfo(skb))We must not cache
skb_shinfo(skb)beforeskb_cow_head().Fixes 6818c4d5b3c2 ("idpf: add splitq start_xmit")Signed-off-by Eric Dumazet <[email protected]>Cc Joshua Hay <[email protected]>Cc Alan Brady <[email protected]>Cc Madhu Chittim <[email protected]>Cc Phani Burra <[email protected]>Cc Sridhar Samudrala <[email protected]>Cc Willem de Bruijn <[email protected]>Cc Pavan Kumar Linga <[email protected]>Cc Tony Nguyen <[email protected]>Cc Bailey Forrest <[email protected]>
Quoted 1 line
[...]
Here is the summary with links:
- [net] idpf: fix potential use-after-free in idpf_tso()
https://git.kernel.org/netdev/net/c/115c0f4d5857
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html