]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mm: fix madivse_pageout mishandling on non-LRU page
authorMinchan Kim <minchan@kernel.org>
Thu, 8 Sep 2022 15:12:04 +0000 (08:12 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 Nov 2022 14:11:58 +0000 (15:11 +0100)
commit16f65c05df6cbbbd9510efff5d9a4037c8da1648
tree5a515a65c44cefe50aa029afcfbb8c461e663835
parent030aea0ca8dd3eb30a60973ad770bc813153a45c
mm: fix madivse_pageout mishandling on non-LRU page

BugLink: https://bugs.launchpad.net/bugs/1995517
commit 58d426a7ba92870d489686dfdb9d06b66815a2ab upstream.

MADV_PAGEOUT tries to isolate non-LRU pages and gets a warning from
isolate_lru_page below.

Fix it by checking PageLRU in advance.

------------[ cut here ]------------
trying to isolate tail page
WARNING: CPU: 0 PID: 6175 at mm/folio-compat.c:158 isolate_lru_page+0x130/0x140
Modules linked in:
CPU: 0 PID: 6175 Comm: syz-executor.0 Not tainted 5.18.12 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:isolate_lru_page+0x130/0x140

Link: https://lore.kernel.org/linux-mm/485f8c33.2471b.182d5726afb.Coremail.hantianshuo@iie.ac.cn/
Link: https://lkml.kernel.org/r/20220908151204.762596-1-minchan@kernel.org
Fixes: 1a4e58cce84e ("mm: introduce MADV_PAGEOUT")
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: 韩天ç`\95 <hantianshuo@iie.ac.cn>
Suggested-by: Yang Shi <shy828301@gmail.com>
Acked-by: Yang Shi <shy828301@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
mm/madvise.c