Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8f27cc2 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan Committed by Gerrit - the friendly Code Review server
Browse files

net: qualcomm: rmnet: Add headroom for all skbs queued to stack



Packets in some path may have some header insertion required which
is not supported if there is not enough headroom.

Fixes the following splat-

[ 254.966133] skbuff: skb_under_panic: text:ffffff9a73ed5e58 len:103
put:14 head:ffffffef13451a00 data:ffffffef134519fa tail:0x61 end:0x80
dev:wlan0
[ 254.967224] kernel BUG at net/core/skbuff.c:104!
[ 254.967429] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[ 254.967858] pc : skb_panic+0x48/0x50
[ 254.967883] lr : skb_panic+0x48/0x50
[ 254.968885] Call trace:
[ 254.968901] skb_panic+0x48/0x50
[ 254.968913] skb_under_panic+0x14/0x18
[ 254.968924] skb_under_panic+0x0/0x18
[ 254.968941] eth_header+0x30/0xc8
[ 254.968959] neigh_resolve_output+0x134/0x188
[ 254.968978] ip6_finish_output2+0x464/0x658
[ 254.968989] ip6_finish_output+0x190/0x210
[ 254.968999] ip6_output+0xc0/0x1a8
[ 254.969018] ip6_local_out+0xe8/0x128
[ 254.969031] nf_dup_ipv6+0x220/0x230
[ 254.969049] tee_tg6+0x38/0x48
[ 254.969062] ip6t_do_table+0x2e4/0x648
[ 254.969077] ip6table_mangle_hook+0x148/0x180
[ 254.969091] nf_hook_slow+0x48/0xd8
[ 254.969101] ipv6_rcv+0x384/0x548
[ 254.969117] __netif_receive_skb_core+0x9c0/0xb80
[ 254.969129] process_backlog+0x14c/0x278
[ 254.969140] net_rx_action+0x114/0x470
[ 254.969159] __do_softirq+0x1f8/0x3ac
[ 254.969176] irq_exit+0xd0/0xe0
[ 254.969191] handle_IPI+0x188/0x2a0
[ 254.969201] gic_handle_irq+0x130/0x1c0
[ 254.969213] el1_irq+0xb0/0x124
[ 254.969231] lpm_cpuidle_enter+0x4b0/0x4f8
[ 254.969243] cpuidle_enter_state+0x1cc/0x350
[ 254.969253] cpuidle_enter+0x18/0x20
[ 254.969268] do_idle+0x174/0x268
[ 254.969279] cpu_startup_entry+0x20/0x28
[ 254.969290] secondary_start_kernel+0x12c/0x138

CRs-fixed: 2469907
Change-Id: Id4c3f0092151b84593beccb4bae24495ae9f83c0
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 2fd9b6ce
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -401,10 +401,12 @@ static struct sk_buff *rmnet_alloc_skb(struct rmnet_frag_descriptor *frag_desc,
	if (frag_desc->hdrs_valid) {
		u16 hdr_len = frag_desc->ip_len + frag_desc->trans_len;

		head_skb = alloc_skb(hdr_len, GFP_ATOMIC);
		head_skb = alloc_skb(hdr_len + RMNET_MAP_DEAGGR_HEADROOM,
				     GFP_ATOMIC);
		if (!head_skb)
			return NULL;

		skb_reserve(head_skb, RMNET_MAP_DEAGGR_HEADROOM);
		skb_put_data(head_skb, frag_desc->hdr_ptr, hdr_len);
		skb_reset_network_header(head_skb);
		if (frag_desc->trans_len)
@@ -423,9 +425,12 @@ static struct sk_buff *rmnet_alloc_skb(struct rmnet_frag_descriptor *frag_desc,
		/* Allocate enough space to avoid penalties in the stack
		 * from __pskb_pull_tail()
		 */
		head_skb = alloc_skb(256, GFP_ATOMIC);
		head_skb = alloc_skb(256 + RMNET_MAP_DEAGGR_HEADROOM,
				     GFP_ATOMIC);
		if (!head_skb)
			return NULL;

		skb_reserve(head_skb, RMNET_MAP_DEAGGR_HEADROOM);
	}

	/* Add main fragment */