Go to file
Vishal Moola (Oracle) f528260b1a mm/khugepaged: fix invalid page access in release_pte_pages()
release_pte_pages() converts from a pfn to a folio by using pfn_folio(). 
If the pte is not mapped, pfn_folio() will result in undefined behavior
which ends up causing a kernel panic[1].

Only call pfn_folio() once we have validated that the pte is both valid
and mapped to fix the issue.

[1] https://lore.kernel.org/linux-mm/ff300770-afe9-908d-23ed-d23e0796e899@samsung.com/

Link: https://lkml.kernel.org/r/20230213214324.34215-1-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Fixes: 9bdfeea46f ("mm/khugepaged: convert release_pte_pages() to use folios")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Debugged-by: Alexandre Ghiti <alex@ghiti.fr>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-02-13 15:54:26 -08:00
arch sh: mm: set VM_IOREMAP flag to the vmalloc area 2023-02-09 16:51:43 -08:00
block block: remove ->rw_page 2023-02-02 22:33:34 -08:00
certs certs: make system keyring depend on built-in x509 parser 2022-09-24 04:31:18 +09:00
crypto This update includes the following changes: 2022-12-14 12:31:09 -08:00
Documentation mm: memory-failure: document memory failure stats 2023-02-02 22:33:28 -08:00
drivers Merge branch 'mm-hotfixes-stable' into mm-stable 2023-02-10 15:34:48 -08:00
fs Merge branch 'mm-hotfixes-stable' into mm-stable 2023-02-10 15:34:48 -08:00
include Merge branch 'mm-hotfixes-stable' into mm-stable 2023-02-10 15:34:48 -08:00
init mm/page_ext: init page_ext early if there are no deferred struct pages 2023-02-02 22:33:22 -08:00
io_uring mm/nommu: factor out check for NOMMU shared mappings into is_nommu_shared_mapping() 2023-01-18 17:12:56 -08:00
ipc ipc/shm: introduce new do_vma_munmap() to munmap 2023-02-09 16:51:33 -08:00
kernel mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
lib Merge branch 'mm-hotfixes-stable' into mm-stable 2023-02-10 15:34:48 -08:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm mm/khugepaged: fix invalid page access in release_pte_pages() 2023-02-13 15:54:26 -08:00
net mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
rust rust: types: add Opaque type 2022-12-04 01:59:16 +01:00
samples Char/Misc driver changes for 6.2-rc1 2022-12-16 03:49:24 -08:00
scripts scripts/gdb: fix 'lx-current' for x86 2023-02-09 15:56:51 -08:00
security mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
sound mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
tools kselftest: vm: add tests for memory-deny-write-execute 2023-02-02 22:33:25 -08:00
usr usr/gen_init_cpio.c: remove unnecessary -1 values from int file 2022-10-03 14:21:44 -07:00
virt KVM: Ensure lockdep knows about kvm->lock vs. vcpu->mutex ordering rule 2023-01-11 13:32:21 -05:00
.clang-format iommufd for 6.2 2022-12-14 09:15:43 -08:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore *.rpm 2022-12-30 17:22:14 +09:00
.mailmap mailmap: add entry for Alexander Mikhalitsyn 2023-02-03 17:52:24 -08:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: zram: zsmalloc: Add an additional co-maintainer 2022-12-15 16:37:49 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS/DAMON: link maintainer profile, git trees, and website 2023-02-02 22:32:52 -08:00
Makefile Linux 6.2-rc4 2023-01-15 09:22:43 -06:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.