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: <9AF41216-3CB7-4AFA-B461-0957074AF0A5@lightnvm.io>
Date:   Tue, 3 Oct 2017 16:11:11 +0200
From:   Javier González <jg@...htnvm.io>
To:     Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc:     Hans Holmberg <hans.ml.holmberg@...tronix.com>,
        Matias Bjørling <mb@...htnvm.io>,
        linux-block@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Christoph Hellwig <hch@....de>,
        Hans Holmberg <hans.holmberg@...xlabs.com>
Subject: Re: [PATCH] lightnvm: pblk: use vfree_atomic when freeing line
 metadata

> On 3 Oct 2017, at 16.07, Andrey Ryabinin <aryabinin@...tuozzo.com> wrote:
> 
> 
> 
> On 10/03/2017 04:48 PM, Hans Holmberg wrote:
>> From: Hans Holmberg <hans.holmberg@...xlabs.com>
>> 
>> The commit bf22e37a6413 ("mm: add vfree_atomic()") made vfree unsafe to
>> call in atomic context (unless the call came from an interrupt) and
>> introduced vfree_atomic that is safe to call in atomic context.
>> 
>> So, since we're holding locks when freeing line metadata, we need to
>> use the atomic version of vfree.
>> 
>> Fix this by introducing an atomic variant of pblk_mfree and
>> switching to that in pblk_line_meta_free.
>> 
>> Signed-off-by: Hans Holmberg <hans.holmberg@...xlabs.com>
>> ---
>> 
>> The patch is for:
>> https://github.com/OpenChannelSSD/linux branch for-4.15/pblk
>> 
>> drivers/lightnvm/pblk-init.c | 3 ++-
>> drivers/lightnvm/pblk.h      | 8 ++++++++
>> 2 files changed, 10 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
>> index c452478..3a191a6 100644
>> --- a/drivers/lightnvm/pblk-init.c
>> +++ b/drivers/lightnvm/pblk-init.c
>> @@ -396,7 +396,8 @@ static void pblk_line_meta_free(struct pblk *pblk)
>> 	spin_lock(&l_mg->free_lock);
> 
> What's the point in holding ->free_lock here? It seems like it could be just dropped.
> 

This lock can indeed be dropped, but the general pblk semaphore, which
serializes initialization and tear down cannot. This is taken on
pblk_exit().

Javier

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ