Linus Torvalds b1b4675167 mm: fix follow_pfnmap API lockdep assert
The lockdep asserts for the new follow_pfnmap() API "knows" that a
pfnmap always has a vma->vm_file, since that's the only way to create
such a mapping.

And that's actually true for all the normal cases.  But not for the mmap
failure case, where the incomplete mapping is torn down and we have
cleared vma->vm_file because the failure occured before the file was
linked to the vma.

So this codepath does actually need to check for vm_file being NULL.

Reported-by: Jann Horn <jannh@google.com>
Fixes: 6da8e9634bb7 ("mm: new follow_pfnmap API")
Cc: Peter Xu <peterx@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-10-18 09:50:05 -07:00
..
2024-09-25 10:25:40 -07:00
2024-09-03 21:15:36 -07:00
2024-09-09 16:38:59 -07:00
2023-12-12 10:11:32 +01:00
2024-09-03 21:15:44 -07:00
2023-04-12 17:36:23 -07:00
2024-09-03 21:15:31 -07:00
2024-09-25 11:35:19 -07:00
2022-10-03 14:02:43 -07:00
2024-09-01 20:26:01 -07:00
2024-09-03 21:15:31 -07:00
2024-08-15 22:16:14 -07:00
2024-07-10 12:14:54 -07:00
2024-09-01 20:26:04 -07:00
2024-09-01 14:43:08 -07:00
2024-09-09 16:38:59 -07:00
2023-04-12 17:36:23 -07:00
2024-09-09 16:39:04 -07:00
2024-04-25 20:55:48 -07:00
2024-04-25 20:55:48 -07:00