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]
Date: Thu, 09 May 2024 16:14:32 -0700
From: Alistair Popple <apopple@...dia.com>
To: Logan Gunthorpe <logang@...tatee.com>
Cc: linux-mm@...ck.org, david@...morbit.com, dan.j.williams@...el.com,
 jhubbard@...dia.com, rcampbell@...dia.com, willy@...radead.org,
 jgg@...dia.com, linux-fsdevel@...r.kernel.org, jack@...e.cz,
 djwong@...nel.org, hch@....de, david@...hat.com, ruansy.fnst@...itsu.com,
 nvdimm@...ts.linux.dev, linux-xfs@...r.kernel.org,
 linux-ext4@...r.kernel.org, jglisse@...hat.com
Subject: Re: [RFC 03/10] pci/p2pdma: Don't initialise page refcount to one


Logan Gunthorpe <logang@...tatee.com> writes:

> Hi Alistair,
>
> I was working on testing your patch set, however I'm dealing with some
> hardware issues at the moment so I haven't fully tested everything yet.

Oh great. I haven't extensively tested the p2pdma setup yet because I
rely on a pretty janky qemu setup to do so.

> I managed to find one issue though:
>
> On 2024-04-10 18:57, Alistair Popple wrote:
>> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
>> index fa7370f..ab7ef18 100644
>> --- a/drivers/pci/p2pdma.c
>> +++ b/drivers/pci/p2pdma.c
>> @@ -128,6 +128,8 @@ static int p2pmem_alloc_mmap(struct file *filp, struct kobject *kobj,
>>  		goto out;
>>  	}
>>  
>> +	get_page(virt_to_page(kaddr));
>> +
>
> kaddr may represent more than one page, so this will fail to map
> anything if the mapping size is greater than 4KB. There is a loop just
> below this that calls vm_insert_page(). Moving a set_page_count() call
> just before vm_insert_page() fixes the issue.

Good point. I'm in the middle of respinning this (I was hoping to get it
done before LSF/MM but I suspect my travel will preempt it) so will add
this fix.

Note that there are problems with both fs-dax and device-dax in this
version which the next one fixes, but any p2p dma testing would be
appreciated. Thanks!

> Thanks!
>
> Logan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ