* Re: [PATCH mm v2] mm: hugetlb: Add checks for NULL for vma returned from find_vma.
[not found] <20230116103947.73153-1-eesina@astralinux.ru>
@ 2023-01-16 18:30 ` Mike Kravetz
2023-01-17 7:57 ` Екатерина Есина
0 siblings, 1 reply; 2+ messages in thread
From: Mike Kravetz @ 2023-01-16 18:30 UTC (permalink / raw)
To: Esina Ekaterina; +Cc: Andrew Morton, linux-mm, linux-kernel, lvc-project
On 01/16/23 13:39, Esina Ekaterina wrote:
> find_vma may return NULL, that's why its return value
> is usually checked for NULL. vma should be checked before dereferencing
>
> Found by Astra Linux on behalf of Linux Verification Center
> (linuxtesting.org) with SVACE.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Esina Ekaterina <eesina@astralinux.ru>
> ---
> mm/hugetlb.c | 32 ++++++++++++++++++--------------
> 1 file changed, 18 insertions(+), 14 deletions(-)
This is not the latest version of the code. What version are you
targeting?
I would claim that find_vma() can not return NULL in previous versions
of the code which this patch seems to target. Why? This routine is
called with mmap sema held and we know addr is part of the vma.
--
Mike Kravetz
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH mm v2] mm: hugetlb: Add checks for NULL for vma returned from find_vma.
2023-01-16 18:30 ` [PATCH mm v2] mm: hugetlb: Add checks for NULL for vma returned from find_vma Mike Kravetz
@ 2023-01-17 7:57 ` Екатерина Есина
0 siblings, 0 replies; 2+ messages in thread
From: Екатерина Есина @ 2023-01-17 7:57 UTC (permalink / raw)
To: Mike Kravetz; +Cc: Andrew Morton, linux-mm, linux-kernel, lvc-project
[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]
The patch can be applied up to 5.12 version and in 5.13 the logic of the function huge_pmd_share changes. And in later versions vma is passed as a function argument.
Best regards,
Ekaterina Esina
-----Original Message-----
From: Mike <mike.kravetz@oracle.com>
To: Esina <eesina@astralinux.ru>
Cc: Andrew <akpm@linux-foundation.org>; linux-mm <linux-mm@kvack.org>; linux-kernel <linux-kernel@vger.kernel.org>; lvc-project <lvc-project@linuxtesting.org>
Date: Monday, 16 January 2023 9:30 PM MSK
Subject: Re: [PATCH mm v2] mm: hugetlb: Add checks for NULL for vma returned from find_vma.
On 01/16/23 13:39, Esina Ekaterina wrote:
> find_vma may return NULL, that's why its return value
> is usually checked for NULL. vma should be checked before dereferencing
>
> Found by Astra Linux on behalf of Linux Verification Center
> (linuxtesting.org) with SVACE.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Esina Ekaterina <eesina@astralinux.ru>
> ---
> mm/hugetlb.c | 32 ++++++++++++++++++--------------
> 1 file changed, 18 insertions(+), 14 deletions(-)
This is not the latest version of the code. What version are you
targeting?
I would claim that find_vma() can not return NULL in previous versions
of the code which this patch seems to target. Why? This routine is
called with mmap sema held and we know addr is part of the vma.
--
Mike Kravetz
[-- Attachment #2: Type: text/html, Size: 2162 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-17 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230116103947.73153-1-eesina@astralinux.ru>
2023-01-16 18:30 ` [PATCH mm v2] mm: hugetlb: Add checks for NULL for vma returned from find_vma Mike Kravetz
2023-01-17 7:57 ` Екатерина Есина
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox