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: <996e56cb-137f-cd3e-eb69-e9ef03ad75c4@virtuozzo.com>
Date:   Tue, 22 Nov 2016 19:35:34 +0300
From:   Andrey Ryabinin <aryabinin@...tuozzo.com>
To:     Christoph Hellwig <hch@....de>, <akpm@...ux-foundation.org>
CC:     <joelaf@...gle.com>, <jszhang@...vell.com>,
        <chris@...is-wilson.co.uk>, <joaodias@...gle.com>,
        <linux-mm@...ck.org>, <linux-rt-users@...r.kernel.org>,
        <x86@...nel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 07/10] mm: warn about vfree from atomic context

On 11/18/2016 04:03 PM, Christoph Hellwig wrote:
> We can't handle vfree itself from atomic context, but callers
> can explicitly use vfree_atomic instead, which defers the actual
> vfree to a workqueue.  Unfortunately in_atomic does not work
> on non-preemptible kernels, so we can't just do the right thing
> by default.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
>  mm/vmalloc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 80f3fae..e2030b4 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1530,6 +1530,7 @@ void vfree_atomic(const void *addr)
>  void vfree(const void *addr)
>  {
>  	BUG_ON(in_nmi());
> +	WARN_ON_ONCE(in_atomic());

This one is wrong. We still can call vfree() from interrupt context.
So WARN_ON_ONCE(in_atomic() && !in_interrupt()) would be correct,
but also redundant. DEBUG_ATOMIC_SLEEP=y should catch illegal vfree() calls.
Let's just drop this patch, ok?



>  	kmemleak_free(addr);
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ