[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <39cb4556-f80a-44ba-a8ae-7990544673a8@arm.com>
Date: Fri, 3 Oct 2025 21:55:00 +0530
From: Dev Jain <dev.jain@....com>
To: Kiryl Shutsemau <kirill@...temov.name>,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>
Cc: Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Kiryl Shutsemau <kas@...nel.org>, stable@...r.kernel.org,
Josef Bacik <josef@...icpanda.com>, Amir Goldstein <amir73il@...il.com>,
Jan Kara <jack@...e.cz>
Subject: Re: [PATCH] mm/mmap: Fix fsnotify_mmap_perm() call in vm_mmap_pgoff()
On 03/10/25 9:28 pm, Kiryl Shutsemau wrote:
> From: Kiryl Shutsemau <kas@...nel.org>
>
> vm_mmap_pgoff() includes a fsnotify call that allows for pre-content
> hooks on mmap().
>
> The fsnotify_mmap_perm() function takes, among other arguments, an
> offset in the file in the form of loff_t. However, vm_mmap_pgoff() has
> file offset in the form of pgoff. This offset needs to be converted
> before being passed to fsnotify_mmap_perm().
>
> The conversion from pgoff to loff_t is incorrect. The pgoff value needs
> to be shifted left by PAGE_SHIFT to obtain loff_t, not right.
>
> This issue was identified through code inspection.
>
> Signed-off-by: Kiryl Shutsemau <kas@...nel.org>
> Fixes: 066e053fe208 ("fsnotify: add pre-content hooks on mmap()")
> Cc: stable@...r.kernel.org
> Cc: Josef Bacik <josef@...icpanda.com>
> Cc: Amir Goldstein <amir73il@...il.com>
> Cc: Jan Kara <jack@...e.cz>
> ---
>
Reviewed-by: Dev Jain <dev.jain@....com>
Powered by blists - more mailing lists