E
E
egorggegor2020-12-12 14:38:38
linux
egorggegor, 2020-12-12 14:38:38

Why does the computer freeze after unloading a module?

I loaded the module with interception of system calls (roughly speaking, the module intercepts ip packets), after unloading it, the computer freezes, displays the following messages in the log.

[  750.094171] Bye! drop module unloaded
[  750.094203] WARNING: CPU: 1 PID: 6049 at /build/linux-7wS8Nk/linux-4.15.0/net/netfilter/core.c:353 nf_unregister_net_hook+0xb2/0xd0
[  750.094204] Modules linked in: firewall(OE-) usblp snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi gpio_ich x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_seq pcbc uvcvideo videobuf2_vmalloc videobuf2_memops snd_seq_device aesni_intel videobuf2_v4l2 prl_fs_freeze(POE) aes_x86_64 crypto_simd prl_fs(POE) prl_eth(POE) glue_helper cryptd videobuf2_core snd_timer intel_rapl_perf videodev media input_leds serio_raw snd soundcore sbs lpc_ich sbshc shpchp prl_tg(POE) pvpanic mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 ahci psmouse libahci pata_acpi virtio_net
[  750.094224] CPU: 1 PID: 6049 Comm: rmmod Tainted: P           OE    4.15.0-126-generic #129-Ubuntu
[  750.094224] Hardware name: Parallels Software International Inc. Parallels Virtual Platform/Parallels Virtual Platform, BIOS 14.1.3 (45485) 03/12/2019
[  750.094227] RIP: 0010:nf_unregister_net_hook+0xb2/0xd0
[  750.094228] RSP: 0018:ffffa864c48c3ea0 EFLAGS: 00010246
[  750.094229] RAX: 0000000000000000 RBX: ffffffffb23e95d0 RCX: 0000000000000006
[  750.094230] RDX: ffff9619f0b08000 RSI: ffffffffc055f140 RDI: 0000000000000000
[  750.094231] RBP: ffffa864c48c3eb8 R08: 00000000000002c1 R09: 0000000000000004
[  750.094232] R10: ffffa864c48c3e88 R11: 0000000000000001 R12: ffffffffb23e8740
[  750.094234] R13: ffffffffc055f140 R14: 0000000000000000 R15: 0000000000000000
[  750.094235] FS:  00007efec8d41540(0000) GS:ffff9619fde40000(0000) knlGS:0000000000000000
[  750.094236] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  750.094237] CR2: 0000555a89e18f38 CR3: 000000003534c005 CR4: 00000000003606e0
[  750.094241] Call Trace:
[  750.094249]  icmp_drop_exit+0x69/0xa78 [firewall]
[  750.094254]  SyS_delete_module+0x1ab/0x2d0
[  750.094258]  do_syscall_64+0x73/0x130
[  750.094263]  entry_SYSCALL_64_after_hwframe+0x41/0xa6
[  750.094265] RIP: 0033:0x7efec8862367
[  750.094265] RSP: 002b:00007ffecf5f2758 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[  750.094267] RAX: ffffffffffffffda RBX: 00007ffecf5f27b8 RCX: 00007efec8862367
[  750.094267] RDX: 000000000000000a RSI: 0000000000000800 RDI: 0000555a89e0e7e8
[  750.094268] RBP: 0000555a89e0e780 R08: 00007ffecf5f16d1 R09: 0000000000000000
[  750.094269] R10: 00007efec88def20 R11: 0000000000000206 R12: 00007ffecf5f2980
[  750.094269] R13: 00007ffecf5f37a7 R14: 0000555a89e0e260 R15: 0000555a89e0e780
[  750.094270] Code: 41 5d 5d c3 48 8b 5e 08 48 85 db 74 0d 85 d2 75 09 48 3b bb e0 04 00 00 74 21 e8 9a fb ff ff 48 89 c3 eb 83 e8 30 52 fb ff eb ca <0f> 0b 48 c7 c7 80 b4 3f b2 e8 20 a7 10 00 eb c2 48 81 c3 80 03 
[  750.094283] ---[ end trace 68ae87b144bb4017 ]---


I do not know how useful this information can be, but suddenly. I can send you the code.

Thanks for answers!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2020-12-12
@egorggegor

linux-4.15.0/net/netfilter/core.c:353

You can start watching from here.
Without your driver code, one can only guess, my crystal ball tells you that you did not wait for your driver to finish processing packets before unregistering its functions and allowing it to unload.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question