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]
Date:   Mon, 16 Dec 2019 15:35:53 +0100
From:   Auger Eric <eric.auger@...hat.com>
To:     Qian Cai <cai@....pw>, Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     eric.auger.pro@...il.com, Joerg Roedel <joro@...tes.org>,
        hch@....de, iommu@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] iommu: fix KASAN use-after-free in
 iommu_insert_resv_region

Hi,
On 12/16/19 3:24 PM, Qian Cai wrote:
> 
> 
>> On Nov 26, 2019, at 5:27 AM, Eric Auger <eric.auger@...hat.com> wrote:
>>
>> In case the new region gets merged into another one, the nr
>> list node is freed. Checking its type while completing the
>> merge algorithm leads to a use-after-free. Use new->type
>> instead.
>>
>> Fixes: 4dbd258ff63e ("iommu: Revisit iommu_insert_resv_region()
>> implementation")
>> Signed-off-by: Eric Auger <eric.auger@...hat.com>
>> Reported-by: Qian Cai <cai@....pw>
>> Cc: Stable <stable@...r.kernel.org> #v5.3+
> 
> 
> Looks like Joerg is away for a few weeks. Could Andrew or Linus pick up this 
> use-after-free?
Thanks for the heads up. Indeed I was wondering why it hasn't been taken
yet.

Note the right version to pick up is the v4, reviewed by Jerry:
https://www.mail-archive.com/iommu@lists.linux-foundation.org/msg36226.html

Thanks

Eric
> 
>>
>> ---
>>
>> v2 -> v3:
>> - directly use new->type
>>
>> v1 -> v2:
>> - remove spurious new line
>> ---
>> drivers/iommu/iommu.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index d658c7c6a2ab..285ad4a4c7f2 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -313,7 +313,7 @@ int iommu_insert_resv_region(struct iommu_resv_region *new,
>> 		phys_addr_t top_end, iter_end = iter->start + iter->length - 1;
>>
>> 		/* no merge needed on elements of different types than @nr */
>> -		if (iter->type != nr->type) {
>> +		if (iter->type != new->type) {
>> 			list_move_tail(&iter->list, &stack);
>> 			continue;
>> 		}
>> -- 
>> 2.20.1
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ