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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171009041001.p47yc6r7f3borhba@node.shutemov.name>
Date:   Mon, 9 Oct 2017 07:10:01 +0300
From:   "Kirill A. Shutemov" <kirill@...temov.name>
To:     Jia-Ju Bai <baijiaju1990@....com>
Cc:     akpm@...ux-foundation.org, mhocko@...e.com, mingo@...nel.org,
        catalin.marinas@....com, labbott@...hat.com, thgarnie@...gle.com,
        kirill.shutemov@...ux.intel.com, aryabinin@...tuozzo.com,
        ard.biesheuvel@...aro.org, zijun_hu@....com, linux-mm@...ck.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] mm/vmalloc: ___might_sleep is called under a spinlock in
 __purge_vmap_area_lazy

On Mon, Oct 09, 2017 at 12:00:33PM +0800, Jia-Ju Bai wrote:
> The ___might_sleep is called under a spinlock, and the function call graph
> is:
> __purge_vmap_area_lazy (acquire the spinlock)
>   cond_resched_lock
>     ___might_sleep
> 
> In this situation, ___might_sleep may prints error log message because a
> spinlock is held.
> A possible fix is to remove ___might_sleep in cond_resched_lock.
> 
> This bug is found by my static analysis tool and my code review.

This analysis doesn't makes sense.

The point of cond_resched_lock() is that it drops the lock, if resched is
required.

___might_sleep() is called with preempt_offset equal to
PREEMPT_LOCK_OFFSET, so it won't report error if it's the only lock we
hold.

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ