The crash built-in "bpf -m|-M" option displays bogus values of MEMLOCK and UID.

Solution Verified - Updated -

Issue

  • The crash built-in "bpf -m|-M" option displays bogus values of MEMLOCK and UID.
crash> bpf
 ID      BPF_PROG       BPF_PROG_AUX   BPF_PROG_TYPE       TAG        USED_MAPS
 28  ffffae70c0127000 ffff96ba56cfbc00 CGROUP_DEVICE 40ddf486530245f5           
 29  ffffae70c0115000 ffff96ba56cfac00  CGROUP_SKB   6deef7357e7b4530           
 30  ffffae70c011d000 ffff96ba56cf8c00  CGROUP_SKB   6deef7357e7b4530           
 31  ffffae70c016d000 ffff96ba56cf9400 CGROUP_DEVICE ca8e50a3c7fb034b           
 32  ffffae70c015f000 ffff96ba56cfa000  CGROUP_SKB   6deef7357e7b4530           
 33  ffffae70c0161000 ffff96ba56cfb800  CGROUP_SKB   6deef7357e7b4530           
 34  ffffae70c0299000 ffff96ba023ddc00 CGROUP_DEVICE 3a0ef5414c2f6fca           
 35  ffffae70c028d000 ffff96ba023df400  CGROUP_SKB   6deef7357e7b4530           
 36  ffffae70c0285000 ffff96ba023df000  CGROUP_SKB   6deef7357e7b4530           
 37  ffffae70c0389000 ffff96ba56ce9c00 CGROUP_DEVICE ee0e253c78993a24           
 42  ffffae70c0047000 ffff96ba41804c00    KPROBE     2917f108481d7b94    2,1    

 ID      BPF_MAP          BPF_MAP_TYPE     MAP_FLAGS                     
 1   ffff96ba41804400        ARRAY          00000000  
 2   ffff96ba41804000         HASH          00000000   

crash> bpf -m 1                                          
 ID      BPF_MAP          BPF_MAP_TYPE     MAP_FLAGS       
 1   ffff96ba41804400        ARRAY          00000000                      
     KEY_SIZE: 4  VALUE_SIZE: 8  MAX_ENTRIES: 64  MEMLOCK: (unknown)    
     NAME: "dist"  UID: (unknown)                          ^^^^^^^^^                            
                        ^^^^^^^^^                                                                    

crash> bpf -m 2                                                         
 ID      BPF_MAP          BPF_MAP_TYPE     MAP_FLAGS  
 2   ffff96ba41804000         HASH          00000000 
     KEY_SIZE: 4  VALUE_SIZE: 8  MAX_ENTRIES: 4194304  MEMLOCK: (unknown)
     NAME: "start"  UID: (unknown)                              ^^^^^^^^^
                         ^^^^^^^^^
OR

crash> bpf -M
 ID      BPF_MAP          BPF_MAP_TYPE     MAP_FLAGS
 1   ffff96ba41804400        ARRAY          00000000 
     KEY_SIZE: 4  VALUE_SIZE: 8  MAX_ENTRIES: 64  MEMLOCK: (unknown)
     NAME: "dist"  UID: (unknown)                          ^^^^^^^^^
                        ^^^^^^^^^

 ID      BPF_MAP          BPF_MAP_TYPE     MAP_FLAGS
 2   ffff96ba41804000         HASH          00000000 
     KEY_SIZE: 4  VALUE_SIZE: 8  MAX_ENTRIES: 4194304  MEMLOCK: (unknown)
     NAME: "start"  UID: (unknown)                              ^^^^^^^^^ 
                         ^^^^^^^^^
  • The bpftool command shows the correct value:
# bpftool prog show id 42
42: kprobe  name sched_switch  tag 2917f108481d7b94  gpl
        loaded_at 2022-01-11T17:34:15+0530  uid 0  <<---
        xlated 976B  jited 581B  memlock 4096B  map_ids 2,1
        btf_id 2
        pids cpudist(1377)

# bpftool map show id 1
1: array  name dist  flags 0x0
        key 4B  value 8B  max_entries 64  memlock 4096B
        btf_id 2                                  ^^^^^
        pids cpudist(1377)
# bpftool map show id 2
2: hash  name start  flags 0x0
        key 4B  value 8B  max_entries 4194304  memlock 67108864B
        btf_id 2                                       ^^^^^^^^^ 
        pids cpudist(1377)

Environment

  • Red Hat Enterprise Linux 9
  • crash

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content