The null-dereference occurred in hashtab_map() causes kernel panic.
Issue
- Kernel panic's at hashtab_map() which is called from policydb_destroy() due to NULL de-reference
[10193550.696073] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[10193550.696260] PGD 0 P4D 0
[10193550.696355] Oops: 0000 [#1] SMP PTI
[10193550.696455] CPU: 0 PID: 1882513 Comm: load_policy Kdump: loaded Not tainted 4.18.0-305.7.1.el8_4.x86_64 #1
[10193550.696594] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 12/12/2018
[10193550.696753] RIP: 0010:hashtab_map+0x27/0x70
[10193550.696903] Code: 00 00 00 0f 1f 44 00 00 8b 47 08 85 c0 74 60 41 56 45 31 f6 41 55 49 89 fd 41 54 49 89 d4 55 48 89 f5 53 49 8b 55 00 44 89 f0 <48> 8b 1c c2 48 85 db 75 0b eb 25 48 8b 5b 10 48 85 db 74 1c 48 8b
[10193550.697143] RSP: 0018:ffffb70e52857ce8 EFLAGS: 00010246
[10193550.697179] RAX: 0000000000000000 RBX: ffff99dee3a91c50 RCX: 0000000000000003
[10193550.697212] RDX: 0000000000000000 RSI: ffffffff879f7650 RDI: ffff99dee3a91c50
[10193550.697243] RBP: ffffffff879f7650 R08: ffffef8e86703408 R09: 0000000000000002
[10193550.697274] R10: ffff99de6f09c948 R11: ffffef8e889b0508 R12: 0000000000000000
[10193550.697305] R13: ffff99dee3a91c50 R14: 0000000000000000 R15: 00000000fffffff4
[10193550.697336] FS: 00007f3dbb94f640(0000) GS:ffff99e12de00000(0000) knlGS:0000000000000000
[10193550.697371] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[10193550.697395] CR2: 0000000000000000 CR3: 0000000226c2a004 CR4: 00000000003706f0
[10193550.697466] Call Trace:
[10193550.697492] policydb_destroy+0x1e2/0x260
[10193550.697617] policydb_read+0x34d/0x1230
[10193550.697691] security_load_policy+0xa8/0x5e0
[10193550.697720] ? copy_user_generic_unrolled+0x32/0xc0
[10193550.697775] sel_write_load+0xd6/0x190
[10193550.697800] vfs_write+0xa5/0x1a0
[10193550.697823] ksys_write+0x4f/0xb0
[10193550.697846] do_syscall_64+0x5b/0x1a0
[10193550.697870] entry_SYSCALL_64_after_hwframe+0x65/0xca
[10193550.697898] RIP: 0033:0x7f3dbaf78648
Environment
- Red Hat Enterprise Linux 8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.