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-next>] [day] [month] [year] [list]
Date:   Mon, 30 Mar 2020 10:31:58 +0200
From:   Thibaut Sautereau <thibaut.sautereau@...p-os.org>
To:     Alexander Viro <viro@...iv.linux.org.uk>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: NULL pointer dereference in coredump code

I hit a kernel NULL pointer dereference caused by the following call chain:

do_coredump()
  file_start_write(cprm.file) # cprm.file is NULL
    file_inode(file) # NULL ptr deref

The `ispipe` path is followed in do_coredump(), and:
    # cat /proc/sys/kernel/core_pattern
    |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h

It seems that cprm.file can be NULL after the call to the usermode
helper, especially when setting CONFIG_STATIC_USERMODEHELPER=y and
CONFIG_STATIC_USERMODEHELPER_PATH="", which is the case for me.

One may say it's a strange combination of configuration options but I
think it should not crash the kernel anyway. As I don't know much about
coredumps in general and this code, I don't know what's the best way to
fix this issue in a clean and comprehensive way.

I attached the patch I used to temporarily work around this issue, if
that can clarify anything.

Thanks,

-- 
Thibaut Sautereau
CLIP OS developer

View attachment "0001-coredump-FIXUP.patch" of type "text/plain" (680 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ