[PATCH 1/2] mm: mmap: fix fput in error path v2

Jason Gunthorpe jgg at ziepe.ca
Fri Oct 16 16:13:10 UTC 2020


On Mon, Oct 12, 2020 at 10:52:02AM +0200, Christian König wrote:
> Patch "495c10cc1c0c CHROMIUM: dma-buf: restore args..."
> adds a workaround for a bug in mmap_region.
> 
> As the comment states ->mmap() callback can change
> vma->vm_file and so we might call fput() on the wrong file.
> 
> Revert the workaround and proper fix this in mmap_region.
> 
> v2: drop the extra if in dma_buf_mmap as well
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>
> ---
>  drivers/dma-buf/dma-buf.c | 20 +++-----------------
>  mm/mmap.c                 |  2 +-
>  2 files changed, 4 insertions(+), 18 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>

Probably should Fixes that other patch Andrew pointed at

Jason


More information about the dri-devel mailing list