bmhook and tmhook are requesting continuous pages, causing page allocation failure.

Solution Unverified - Updated -

Issue

  • A page allocation failure occurs and the following message is output.
kernel: test.sh: page allocation failure: order:5, mode:0x60c0c0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null),cpuset=/,mems_allowed=0
kernel: CPU: 1 PID: 4109438 Comm: test.sh Kdump: loaded Tainted: P           OE    --------- -  - 4.18.0-240.1.1.el8_3.x86_64 #1
kernel: Hardware name: Amazon EC2 c5.large/, BIOS 1.0 10/16/2017
kernel: Call Trace:
kernel: dump_stack+0x5c/0x80
kernel: warn_alloc.cold.118+0x7b/0x10d
kernel: ? _cond_resched+0x15/0x30
kernel: ? __alloc_pages_direct_compact+0x128/0x130
kernel: __alloc_pages_slowpath+0xcfc/0xd40
kernel: __alloc_pages_nodemask+0x245/0x280
kernel: kmalloc_order+0x14/0x30
kernel: kmalloc_order_trace+0x1d/0xa0
kernel: bmhook_kzalloc.constprop.79+0x11/0x20 [bmhook]
kernel: bmhook_get_argv_object_from_user_arg_ptr.isra.37+0x73/0x260 [bmhook]
kernel: ? cred_fscmp+0xc0/0xc0
kernel: bmhook_get_argv_object_from_object.isra.73+0x151/0x2c0 [bmhook]
kernel: bmhook_get_object+0x830/0xe90 [bmhook]
kernel: ? kmem_cache_alloc_trace+0x140/0x1c0
kernel: ? tmhook_attach_data+0x37/0x70 [tmhook]
kernel: ? _cond_resched+0x15/0x30
kernel: bmhook_save_object+0x82/0x110 [bmhook]
kernel: tmbpf_save_object+0xa/0x10 [bmhook]
kernel: ? mem_cgroup_commit_charge+0x7a/0x550
kernel: ? wp_page_copy+0x2c1/0x500
kernel: ? bmhook_prehook_handler+0x249/0x2c0 [bmhook]
kernel: ? tmhook_invoke_prehooks+0x41/0xa0 [tmhook]
kernel: ? tmhook_handler+0x187/0x200 [tmhook]
kernel: ? do_syscall_64+0x5b/0x1a0
kernel: ? tmhook_invoke_posthooks+0xc0/0xc0 [tmhook]
kernel: ? do_syscall_64+0x5b/0x1a0
kernel: ? entry_SYSCALL_64_after_hwframe+0x65/0xca
kernel: Mem-Info:
kernel: active_anon:112380 inactive_anon:112679 isolated_anon:12#012 active_file:169481 inactive_file:106716 isolated_file:0#012 unevictable:0 dirty:20 writeback:0 unstable:0#012 slab_reclaimable:210798 slab_unreclaimable:44504#012 mapped:30619 shmem:41020 pagetables:3344 bounce:0#012 free:54345 free_pcp:68 free_cma:0
kernel: Node 0 active_anon:449520kB inactive_anon:450716kB active_file:677924kB inactive_file:426864kB unevictable:0kB isolated(anon):48kB isolated(file):0kB mapped:122476kB dirty:80kB writeback:0kB shmem:164080kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 440320kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
kernel: Node 0 DMA free:14560kB min:288kB low:360kB high:432kB active_anon:0kB inactive_anon:0kB active_file:224kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15360kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
kernel: lowmem_reserve[]: 0 2831 3541 3541 3541
kernel: Node 0 DMA32 free:185740kB min:53748kB low:67184kB high:80620kB active_anon:407376kB inactive_anon:401076kB active_file:476012kB inactive_file:325000kB unevictable:0kB writepending:0kB present:3129256kB managed:2899880kB mlocked:0kB kernel_stack:1316kB pagetables:6136kB bounce:0kB free_pcp:272kB local_pcp:24kB free_cma:0kB
kernel: lowmem_reserve[]: 0 0 709 709 709
kernel: Node 0 Normal free:16892kB min:13544kB low:16928kB high:20312kB active_anon:42868kB inactive_anon:48552kB active_file:202040kB inactive_file:102044kB unevictable:0kB writepending:0kB present:829440kB managed:726240kB mlocked:0kB kernel_stack:3072kB pagetables:7240kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
kernel: lowmem_reserve[]: 0 0 0 0 0
kernel: Node 0 DMA: 0*4kB 2*8kB (UE) 13*16kB (UE) 4*32kB (UME) 2*64kB (E) 2*128kB (UE) 2*256kB (UM) 2*512kB (UM) 2*1024kB (ME) 1*2048kB (E) 2*4096kB (M) = 14560kB
kernel: Node 0 DMA32: 4602*4kB (UE) 4535*8kB (UME) 5141*16kB (UME) 1524*32kB (UME) 3*64kB (ME) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 185904kB
kernel: Node 0 Normal: 148*4kB (UMH) 865*8kB (UMEH) 391*16kB (UEH) 102*32kB (UEH) 3*64kB (H) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 17224kB
kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
kernel: 319988 total pagecache pages
kernel: 4757 pages in swap cache
kernel: Swap cache stats: add 442650, delete 437893, find 16562265/16580854
kernel: Free swap  = 1945076kB
kernel: Total swap = 2097140kB
kernel: 993672 pages RAM
kernel: 0 pages HighMem/MovableOnly
kernel: 83302 pages reserved
kernel: 0 pages hwpoisoned

Environment

  • Red Hat Enterprise Linux 8
  • 3rd-party kernel module: bmhook and tmhook in Trend Micro Deep Security Agent

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