2008-10-29 05:25:09

by Ed Swierk

[permalink] [raw]
Subject: [PATCH] Fix range check on mmaped sysfs resource files

pci_mmap_fits() in 2.6.27.4 returns the wrong answer if the sysfs
resource file size is not a multiple of the page size. vm_end and
vm_start are already page-aligned, so size - start < nr, causing
mmap() to return EINVAL.

Signed-off-by: Ed Swierk <[email protected]>


Attachments:
(No filename) (277.00 B)
linux-2.6.27-pci-sysfs-mmap-bug.patch (607.00 B)
Download all attachments

2008-10-29 05:36:52

by Ed Swierk

[permalink] [raw]
Subject: Re: [PATCH] Fix range check on mmaped sysfs resource files

On Tue, 2008-10-28 at 22:24 -0700, Ed Swierk wrote:
> pci_mmap_fits() in 2.6.27.4 returns the wrong answer if the sysfs
> resource file size is not a multiple of the page size. vm_end and
> vm_start are already page-aligned, so size - start < nr, causing
> mmap() to return EINVAL.
>
> Signed-off-by: Ed Swierk <[email protected]>

...and here is the patch in a hopefully more readable form.


Attachments:
linux-2.6.27-pci-sysfs-mmap-bug.patch (607.00 B)