lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHC9VhQ763vGOhBbyQtCZJ4Sj=dhdKBCzosk29kjg=xGQo=BNg@mail.gmail.com>
Date: Mon, 29 Jul 2024 22:36:40 -0400
From: Paul Moore <paul@...l-moore.com>
To: Ubisectech Sirius <bugreport@...iantsec.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>, jmorris <jmorris@...ei.org>, 
	serge <serge@...lyn.com>
Subject: Re: WARNING in hashtab_init

On Sun, Jul 28, 2024 at 10:49 PM Ubisectech Sirius
<bugreport@...iantsec.com> wrote:
>
> Hello.
> We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. Recently, our team has discovered a issue in Linux kernel 6.8. Attached to the email were a PoC file of the issue.
>
> Stack dump:
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 10493 at mm/page_alloc.c:4545 __alloc_pages+0x402/0x21b0 mm/page_alloc.c:4545
> Modules linked in:
> CPU: 0 PID: 10493 Comm: syz.3.141 Not tainted 6.8.0 #1
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
> RIP: 0010:__alloc_pages+0x402/0x21b0 mm/page_alloc.c:4545
> Code: ff 00 0f 84 15 fe ff ff 80 ce 01 e9 0d fe ff ff 83 fe 0a 0f 86 0e fd ff ff 80 3d c7 cf 6a 0d 00 75 0b c6 05 be cf 6a 0d 01 90 <0f> 0b 90 45 31 e4 e9 87 fe ff ff e8 5e 3e 9b ff 84 c0 0f 85 7a fe
> RSP: 0018:ffffc90001b37428 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: 1ffff92000366e98
> RDX: 0000000000000000 RSI: 0000000000000016 RDI: 0000000000040dc0
> RBP: ffffc90001b376d8 R08: 0000000000000005 R09: 0000000000000000
> R10: 0000000080000000 R11: 656c6c616b7a7973 R12: 0000000400000000
> R13: 0000000000000016 R14: 0000000000040dc0 R15: 0000000000000016
> FS:  00007f10c4184640(0000) GS:ffff88802c600000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007f10c4163658 CR3: 000000001bb8e000 CR4: 0000000000750ef0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> PKRU: 55555554
> Call Trace:
>  <TASK>
>  __alloc_pages_node include/linux/gfp.h:238 [inline]
>  alloc_pages_node include/linux/gfp.h:261 [inline]
>  __kmalloc_large_node+0x88/0x1a0 mm/slub.c:3926
>  __do_kmalloc_node mm/slub.c:3969 [inline]
>  __kmalloc+0x370/0x480 mm/slub.c:3994
>  kmalloc_array include/linux/slab.h:627 [inline]
>  kcalloc include/linux/slab.h:658 [inline]
>  hashtab_init+0x10a/0x270 security/selinux/ss/hashtab.c:42
>  class_read+0x1e4/0xa10 security/selinux/ss/policydb.c:1331
>  policydb_read+0x9b6/0x3850 security/selinux/ss/policydb.c:2565
>  security_load_policy+0x15d/0x12b0 security/selinux/ss/services.c:2269
>  sel_write_load+0x313/0x1b60 security/selinux/selinuxfs.c:600
>  vfs_write+0x2b2/0x1090 fs/read_write.c:588
>  ksys_write+0x122/0x250 fs/read_write.c:643
>  do_syscall_x64 arch/x86/entry/common.c:52 [inline]
>  do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83
>  entry_SYSCALL_64_after_hwframe+0x6f/0x77
> RIP: 0033:0x7f10c33958cd
> Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007f10c4183fa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
> RAX: ffffffffffffffda RBX: 00007f10c3534038 RCX: 00007f10c33958cd
> RDX: 0000000000002000 RSI: 0000000020000000 RDI: 0000000000000005
> RBP: 00007f10c341bb06 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 000000000000000b R14: 00007f10c3534038 R15: 00007f10c4164000
>  </TASK>
>
> Thank you for taking the time to read this email and we look forward to working with you further.

It looks like you've enabled panic_on_warn and the warning/panic above
is generated by __alloc_pages in response to loading a large and/or
bogus SELinux policy.  With panic_on_warn disabled, the policy load
should fail gracefully and the system should continue to run.  Have
you done any testing with panic_on_warn disabled and noticed any
unexpected behavior?

-- 
paul-moore.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ