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: <4393e0d9-28c5-4b85-b603-40e457c9beba@deltatee.com>
Date: Thu, 9 May 2024 15:59:35 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: Alistair Popple <apopple@...dia.com>, linux-mm@...ck.org
Cc: 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

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.

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.

Thanks!

Logan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ