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:   Tue, 17 Dec 2019 20:56:53 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     akpm@...ux-foundation.org, ishkamiel@...il.com,
        rostedt@...dmis.org, dvyukov@...gle.com,
        andrea.parri@...rulasolutions.com, anders.roxell@...aro.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        elena.reshetova@...el.com, andreyknvl@...gle.com
Cc:     linux-kernel@...r.kernel.org
Subject: [BUG] kernel: kcov: a possible sleep-in-atomic-context bug in
 kcov_ioctl()

The kernel may sleep while holding a spinlock.
The function call path (from bottom to top) in Linux 4.19 is:

kernel/kcov.c, 237:
     vfree in kcov_put
kernel/kcov.c, 413:
     kcov_put in kcov_ioctl_locked
kernel/kcov.c, 427:
     kcov_ioctl_locked in kcov_ioctl
kernel/kcov.c, 426:
     spin_lock in kcov_ioctl

vfree() can sleep at runtime.

I am not sure how to properly fix this possible bug, so I only report it.
A possible way is to replace vfree() with kfree(), and replace related 
calls to vmalloc() with kmalloc().

This bug is found by a static analysis tool STCheck written by myself.


Best wishes,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ