Skip to content

Instantly share code, notes, and snippets.

@ARISTODE
Created March 30, 2023 15:02
Show Gist options
  • Select an option

  • Save ARISTODE/d7d0da812265c066c44976c3086d0390 to your computer and use it in GitHub Desktop.

Select an option

Save ARISTODE/d7d0da812265c066c44976c3086d0390 to your computer and use it in GitHub Desktop.
Kernel Alloc API Example
Call Path: napi_gro_receive->dev_gro_receive->napi_gro_complete->netif_receive_skb_internal->__netif_receive_skb->__netif_receive_skb_core->skb_vlan_untag->pskb_may_pull.2063->__pskb_pull_tail->pskb_expand_head->__kmalloc_reserve
- kernel func (napi_gro_receive) | allocator (__kmalloc_reserve) | driver call site (ixgbe_rx_skb) - %17 = call i32 @napi_gro_receive(%struct.napi_struct* %15, %struct.sk_buff* %16) #11, !dbg !281511
Call Path: netif_receive_skb->netif_receive_skb_internal->__netif_receive_skb->__netif_receive_skb_core->skb_vlan_untag->pskb_may_pull.2063->__pskb_pull_tail->pskb_expand_head->__kmalloc_reserve
- kernel func (netif_receive_skb) | allocator (__kmalloc_reserve) | driver call site (ixgbe_rx_skb) - %12 = call i32 @netif_receive_skb(%struct.sk_buff* %11) #11, !dbg !281507
Call Path: netif_set_xps_queue->kzalloc.1679
- kernel func (netif_set_xps_queue) | allocator (kzalloc.1679) | driver call site (ixgbe_configure_tx_ring) - %170 = call i32 @netif_set_xps_queue(%struct.net_device* %163, %struct.cpumask* %165, i16 zeroext %169) #11, !dbg !281622
Call Path: __pskb_pull_tail->pskb_expand_head->__kmalloc_reserve
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (pskb_may_pull) - %34 = call i8* @__pskb_pull_tail(%struct.sk_buff* %29, i32 %33) #11, !dbg !281511
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (pskb_may_pull.2113) - %34 = call i8* bitcast (i8* (%struct.sk_buff*, i32)* @__pskb_pull_tail to i8* (%struct.sk_buff.12149*, i32)*)(%struct.sk_buff.12149* %29, i32 %33) #11, !dbg !281511
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (__pskb_pull) - %16 = call i8* @__pskb_pull_tail(%struct.sk_buff* %11, i32 %15) #11, !dbg !281509
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (pskb_may_pull.2063) - %34 = call i8* @__pskb_pull_tail(%struct.sk_buff* %29, i32 %33) #11, !dbg !281511
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (skb_maybe_pull_tail) - %29 = call i8* @__pskb_pull_tail(%struct.sk_buff* %24, i32 %28) #11, !dbg !281523
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (skb_cow_data) - %32 = call i8* @__pskb_pull_tail(%struct.sk_buff* %26, i32 %31) #11, !dbg !281521
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (__skb_linearize.2006) - %7 = call i8* @__pskb_pull_tail(%struct.sk_buff* %3, i32 %6) #11, !dbg !281497
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (pskb_may_pull.341) - %34 = call i8* @__pskb_pull_tail(%struct.sk_buff* %29, i32 %33) #11, !dbg !281511
- kernel func (__pskb_pull_tail) | allocator (__kmalloc_reserve) | driver call site (__skb_linearize) - %7 = call i8* @__pskb_pull_tail(%struct.sk_buff* %3, i32 %6) #11, !dbg !281497
Call Path: pskb_expand_head->__kmalloc_reserve
- kernel func (pskb_expand_head) | allocator (__kmalloc_reserve) | driver call site (__skb_cow) - %62 = call i32 @pskb_expand_head(%struct.sk_buff* %31, i32 %61, i32 0, i32 34078752) #11, !dbg !281529
- kernel func (pskb_expand_head) | allocator (__kmalloc_reserve) | driver call site (__pskb_pull_tail) - %39 = call i32 @pskb_expand_head(%struct.sk_buff* %30, i32 0, i32 %38, i32 34078752) #11, !dbg !281525
- kernel func (pskb_expand_head) | allocator (__kmalloc_reserve) | driver call site (___pskb_trim) - %28 = call i32 @pskb_expand_head(%struct.sk_buff* %27, i32 0, i32 0, i32 34078752) #11, !dbg !281518
- kernel func (pskb_expand_head) | allocator (__kmalloc_reserve) | driver call site (__skb_cow.2041) - %62 = call i32 @pskb_expand_head(%struct.sk_buff* %31, i32 %61, i32 0, i32 34078752) #11, !dbg !281529
- kernel func (pskb_expand_head) | allocator (__kmalloc_reserve) | driver call site (skb_ensure_writable) - %23 = call i32 @pskb_expand_head(%struct.sk_buff* %22, i32 0, i32 0, i32 34078752) #11, !dbg !281514
- kernel func (pskb_expand_head) | allocator (__kmalloc_reserve) | driver call site (skb_cow_data) - %50 = call i32 @pskb_expand_head(%struct.sk_buff* %44, i32 0, i32 %49, i32 34078752) #11, !dbg !281542
- kernel func (pskb_expand_head) | allocator (__kmalloc_reserve) | driver call site (skb_pad) - %58 = call i32 @pskb_expand_head(%struct.sk_buff* %56, i32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment