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] [day] [month] [year] [list]
Message-ID: <2d38fcab-bc7a-2986-ff39-9403164914e4@gmail.com>
Date:   Tue, 1 Sep 2020 21:56:21 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Thierry Reding <thierry.reding@...il.com>,
        Joerg Roedel <joro@...tes.org>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Krishna Reddy <vdumpa@...dia.com>
Cc:     iommu@...ts.linux-foundation.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] iommu/tegra-smmu: Add locking around mapping
 operations

01.09.2020 20:13, Dmitry Osipenko пишет:
...
> +	/*
> +	 * In order to prevent exhaustion of the atomic memory pool, we
> +	 * allocate page in a sleeping context if GFP flags permit. Hence
> +	 * spinlock needs to be unlocked and re-locked after allocation.
> +	 */
> +	if (!(gfp & GFP_NOWAIT))
> +		spin_unlock_irqrestore(&as->lock, *flags);
> +
> +	page = alloc_page(gfp | __GFP_DMA | __GFP_ZERO);
> +
> +	if (!(gfp & GFP_NOWAIT))
> +		spin_lock_irqsave(&as->lock, *flags);

I realized that GFP_NOWAIT is a wrong flag to check here once I saw
warnings about sleeping in atomic context. Apparently __GFP_ATOMIC
should be used instead, I'll make v5.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ