Re: Patch "Fix a few incorrectly checked [io_]remap_pfn_range() calls" has been added to the 3.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

On 11/25/2013 10:18 PM, gregkh@xxxxxxxxxxxxxxxxxxx wrote:
> 
> This is a note to let you know that I've just added the patch titled
> 
>     Fix a few incorrectly checked [io_]remap_pfn_range() calls
> 
> to the 3.4-stable tree which can be found at:
>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> 
> The filename of the patch is:
>      fix-a-few-incorrectly-checked-remap_pfn_range-calls.patch
> and it can be found in the queue-3.4 subdirectory.
> 
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@xxxxxxxxxxxxxxx> know about it.
> 

this patch seems to break the  support of a uio driver I have on 3.10-stable. I
think I figured out whats the problem here.

> 
> From 7314e613d5ff9f0934f7a0f74ed7973b903315d1 Mon Sep 17 00:00:00 2001
> From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Date: Tue, 29 Oct 2013 10:21:34 -0700
> Subject: Fix a few incorrectly checked [io_]remap_pfn_range() calls
> 
> From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> 
> commit 7314e613d5ff9f0934f7a0f74ed7973b903315d1 upstream.
> 
> Nico Golde reports a few straggling uses of [io_]remap_pfn_range() that
> really should use the vm_iomap_memory() helper.  This trivially converts
> two of them to the helper, and comments about why the third one really
> needs to continue to use remap_pfn_range(), and adds the missing size
> check.
> 
> Reported-by: Nico Golde <nico@xxxxxxxxx>
> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx.
> [lizf: backported to 3.4:
>  - adjust context
>  - no uio_physical_vm_ops]
> Signed-off-by: Li Zefan <lizefan@xxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> 
> ---
>  drivers/uio/uio.c        |   16 +++++++++++++++-
>  drivers/video/au1100fb.c |   26 +-------------------------
>  drivers/video/au1200fb.c |   23 +----------------------
>  3 files changed, 17 insertions(+), 48 deletions(-)
> 
> --- a/drivers/uio/uio.c
> +++ b/drivers/uio/uio.c
> @@ -650,16 +650,30 @@ static int uio_mmap_physical(struct vm_a
>  {
>  	struct uio_device *idev = vma->vm_private_data;
>  	int mi = uio_find_mem_index(vma);
> +	struct uio_mem *mem;
>  	if (mi < 0)
>  		return -EINVAL;
> +	mem = idev->info->mem + mi;
> +
> +	if (vma->vm_end - vma->vm_start > mem->size)
> +		return -EINVAL;
>  

This check needs to be
vma->vm_end - vma->vm_start < mem->size

We want to run in the error condition if the vma area is smaller then mem->size or?

At least it fixes the driver on my side.

Regards
Holger

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]