tempesta-tech / tempesta

All-in-one solution for high performance web content delivery and advanced protection against DDoS and web attacks
https://tempesta-tech.com/
GNU General Public License v2.0
623 stars 103 forks source link

BUG: Bad page state in process tempesta.sh #2262

Open RomanBelozerov opened 1 month ago

RomanBelozerov commented 1 month ago

Tempesta - e3b1a36dd72c54dc52fb11867507b10d57843b01 tempesta-test - 57da51c30ca4d155819615f3a15648aae538f955 kernel-patch - 5.10.35.tfw-fa7cd2d

This error happened once on daily CI tests. I couldn't reproduce it again.

Start test: tls.test_tls_cert.WrkTestsMultipleVhosts.test_wrk
[tdb] Start Tempesta DB
[tempesta fw] Initializing Tempesta FW kernel module...
[tempesta fw] Warning: Vhost localhost doesn't have certificate with matching SAN/CN.
    Maybe that's fine, but it's worth checking the
    config - if there is no relations between the
    names, then host name confusion attack is possible.
[tempesta fw] Warning: Vhost private.example.com doesn't have certificate with matching SAN/CN.
    Maybe that's fine, but it's worth checking the
    config - if there is no relations between the
    names, then host name confusion attack is possible.
[tdb] Opened table /opt/tempesta/db/filter0.tdb: size=16777216 rec_size=20 base=000000005a4b6c04
[tdb] Opened table /opt/tempesta/db/sessions0.tdb: size=16777216 rec_size=312 base=000000006c906ad0
[tdb] Opened table /opt/tempesta/db/client0.tdb: size=16777216 rec_size=624 base=00000000157fbb5f
[tempesta fw] Tempesta FW is ready
[tempesta fw] Tempesta FW is ready
[tempesta fw] Tempesta FW is ready
[tempesta fw] Tempesta FW is ready
[tempesta fw] Tempesta FW is ready
[tempesta fw] Tempesta FW is ready
[tempesta fw] Tempesta FW is ready
[tempesta fw] Tempesta FW is ready
net_ratelimit: 700 callbacks suppressed
[tempesta fw] Warning: request dropped: processing error, status 502: 127.0.0.1
[tempesta fw] Warning: Vhost localhost doesn't have certificate with matching SAN/CN.
    Maybe that's fine, but it's worth checking the
    config - if there is no relations between the
    names, then host name confusion attack is possible.
[tempesta fw] Warning: Vhost private.example.com doesn't have certificate with matching SAN/CN.
    Maybe that's fine, but it's worth checking the
    config - if there is no relations between the
    names, then host name confusion attack is possible.
[tempesta fw] Configuration processing is completed.
[tempesta fw] Tempesta FW is ready
[tempesta fw] Live reconfiguration of Tempesta.
[tempesta fw] Warning: Vhost private.example.com doesn't have certificate with matching SAN/CN.
    Maybe that's fine, but it's worth checking the
    config - if there is no relations between the
    names, then host name confusion attack is possible.
[tempesta fw] Warning: Vhost localhost doesn't have certificate with matching SAN/CN.
    Maybe that's fine, but it's worth checking the
    config - if there is no relations between the
    names, then host name confusion attack is possible.
[tempesta fw] Configuration processing is completed.
[tempesta fw] Tempesta FW is ready
[tempesta fw] Live reconfiguration of Tempesta.
[tempesta fw] Warning: Vhost localhost doesn't have certificate with matching SAN/CN.
    Maybe that's fine, but it's worth checking the
    config - if there is no relations between the
    names, then host name confusion attack is possible.
[tempesta fw] Tempesta FW is ready
net_ratelimit: 2 callbacks suppressed
[tempesta fw] Warning: request dropped: processing error, status 502: 127.0.0.1
[tdb] Close table 'client0.tdb'
[tdb] Close table 'sessions0.tdb'
[tdb] Close table 'filter0.tdb'
[tempesta fw] modules are stopped
[tempesta fw] exiting...
BUG: Bad page state in process tempesta.sh  pfn:105752
page:00000000b179a92e refcount:-1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105752
flags: 0x17ffffc0000000()
raw: 0017ffffc0000000 dead000000000100 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 ffffffffffffffff 0000000000000000
page dumped because: nonzero _refcount
Modules linked in: tempesta_db(OE) tempesta_tls(OE) tempesta_lib(OE) tls sha256_ssse3 sha512_ssse3 vhost_vsock vmw_vsock_virtio_transport_common vhost vhost_iotlb vsock nft_masq nft_counter nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 bridge stp llc nf_tables nfnetlink sch_fq_codel kvm_amd ccp kvm binfmt_misc input_leds joydev serio_raw qemu_fw_cfg mac_hid netconsole dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua ramoops reed_solomon msr efi_pstore ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid hid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel bochs_drm drm_vram_helper drm_ttm_helper ttm drm_kms_helper aesni_intel crypto_simd cryptd syscopyarea glue_helper sysfillrect sysimgblt fb_sys_fops cec drm virtio_net virtio_scsi psmouse net_failover i2c_piix4 failover pata_acpi floppy
 [last unloaded: tempesta_fw]
CPU: 0 PID: 16906 Comm: tempesta.sh Tainted: G           OE     5.10.35.tfw-fa7cd2d #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
Call Trace:
 dump_stack+0x74/0x92
 bad_page.cold+0x63/0x94
 check_free_page_bad+0x66/0x70
 free_pcppages_bulk+0x175/0x6b0
 ? __alloc_pages_nodemask+0x193/0x330
 free_unref_page_commit+0xb6/0xe0
 free_unref_page_list+0x104/0x180
 release_pages+0x374/0x3e0
 free_pages_and_swap_cache+0xb9/0xd0
 tlb_flush_mmu+0x3c/0x140
 tlb_finish_mmu+0x42/0x80
 exit_mmap+0xdc/0x1b0
 mmput+0x5d/0x130
 begin_new_exec+0x437/0x990
 load_elf_binary+0x144/0x16a0
 ? tomoyo_find_next_domain+0x268/0x850
 bprm_execve+0x2f0/0x6d0
 do_execveat_common.isra.0+0x189/0x1c0
 __x64_sys_execve+0x37/0x50
 do_syscall_64+0x38/0x90
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7fa5ee2c908b
Code: Unable to access opcode bytes at RIP 0x7fa5ee2c9061.
RSP: 002b:00007ffe8dac1328 EFLAGS: 00000246 ORIG_RAX: 000000000000003b
RAX: ffffffffffffffda RBX: 000056017bf05ff0 RCX: 00007fa5ee2c908b
RDX: 000056017da3af80 RSI: 000056017da7b620 RDI: 000056017da79c40
RBP: 000056017da79c40 R08: 000056017da7b620 R09: 0000000000000000
R10: 0000000000000008 R11: 0000000000000246 R12: 000056017da79c40
R13: 000056017da7b620 R14: 000056017da3af80 R15: 000056017bf05f3c
Disabling lock debugging due to kernel taint
[tdb] Shutdown Tempesta DB

Testing

tls.test_tls_cert.WrkTestsMultipleVhosts.test_wrk