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:   Wed, 20 Jun 2018 10:49:28 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     Boris Ostrovsky <boris.ostrovsky@...cle.com>, jgross@...e.com
Cc:     xen-devel@...ts.xenproject.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [BUG] xen: Two possible sleep-in-atomic-context bugs in
 bind_evtchn_to_irqhandler()

The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16.7 are:

[FUNC] mutex_lock_nested --> can sleep
drivers/xen/events/events_base.c, 839: mutex_lock_nested in 
bind_evtchn_to_irq
drivers/xen/events/events_base.c, 1030: bind_evtchn_to_irq in 
bind_evtchn_to_irqhandler
drivers/xen/pvcalls-front.c, 371: bind_evtchn_to_irqhandler in create_active
drivers/xen/pvcalls-front.c, 417: create_active in pvcalls_front_connect
drivers/xen/pvcalls-front.c, 410: spin_lock in pvcalls_front_connect

[FUNC] request_irq --> can sleep
drivers/xen/events/events_base.c, 1003: request_irq in 
bind_evtchn_to_irqhandler
drivers/xen/pvcalls-front.c, 371: bind_evtchn_to_irqhandler in create_active
drivers/xen/pvcalls-front.c, 417: create_active in pvcalls_front_connect
drivers/xen/pvcalls-front.c, 410: spin_lock in pvcalls_front_connect

These bugs are found by my static analysis tool (DSAC-2) and checked by my
code review.

I do not know how to correctly fix these bugs, so I just report them.
Maybe create_active() should not be called with holding a spinlock.


Best wishes,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ