Go to file
Miaohe Lin 8787ade36f ksm: fix potential missing rmap_item for stable_node
[ Upstream commit c89a384e25 ]

When removing rmap_item from stable tree, STABLE_FLAG of rmap_item is
cleared with head reserved.  So the following scenario might happen: For
ksm page with rmap_item1:

cmp_and_merge_page
  stable_node->head = &migrate_nodes;
  remove_rmap_item_from_tree, but head still equal to stable_node;
  try_to_merge_with_ksm_page failed;
  return;

For the same ksm page with rmap_item2, stable node migration succeed this
time.  The stable_node->head does not equal to migrate_nodes now.  For ksm
page with rmap_item1 again:

cmp_and_merge_page
 stable_node->head != &migrate_nodes && rmap_item->head == stable_node
 return;

We would miss the rmap_item for stable_node and might result in failed
rmap_walk_ksm().  Fix this by set rmap_item->head to NULL when rmap_item
is removed from stable tree.

Link: https://lkml.kernel.org/r/20210330140228.45635-5-linmiaohe@huawei.com
Fixes: 4146d2d673 ("ksm: make !merge_across_nodes migration safe")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-22 10:57:39 +02:00
Documentation sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output 2021-03-07 11:27:45 +01:00
arch ARM: 9064/1: hw_breakpoint: Do not directly check the event's overflow_handler hook 2021-05-22 10:57:38 +02:00
block block: only update parent bi_status when bio fail 2021-04-16 11:57:53 +02:00
certs certs: Fix blacklist flag type confusion 2021-03-03 18:22:46 +01:00
crypto crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-22 10:57:16 +02:00
drivers drm/radeon: Fix off-by-one power_state index heap overwrite 2021-05-22 10:57:38 +02:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:20:30 +01:00
fs NFSv4.2 fix handling of sr_eof in SEEK's reply 2021-05-22 10:57:38 +02:00
include smp: Fix smp_call_function_single_async prototype 2021-05-22 10:57:35 +02:00
init init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM 2021-04-10 13:20:12 +02:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2020-05-20 08:17:07 +02:00
kernel smp: Fix smp_call_function_single_async prototype 2021-05-22 10:57:35 +02:00
lib bug: Remove redundant condition check in report_bug 2021-05-22 10:57:32 +02:00
mm ksm: fix potential missing rmap_item for stable_node 2021-05-22 10:57:39 +02:00
net sctp: fix a SCTP_MIB_CURRESTAB leak in sctp_sf_do_dupcook_b 2021-05-22 10:57:38 +02:00
samples samples/bpf: Fix broken tracex1 due to kprobe argument change 2021-05-22 10:57:37 +02:00
scripts kconfig: nconf: stop endless search loops 2021-05-22 10:57:37 +02:00
security security: commoncap: fix -Wstringop-overread warning 2021-05-22 10:57:21 +02:00
sound ASoC: rt286: Make RT286_SET_GPIO_* readable and writable 2021-05-22 10:57:37 +02:00
tools selftests: Set CC to clang in lib.mk if LLVM is set 2021-05-22 10:57:36 +02:00
usr initramfs: restore default compression behavior 2020-04-13 10:34:19 +02:00
virt KVM: arm64: Fix exclusive limit for IPA size 2021-03-17 16:34:35 +01:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore kbuild: rpm-pkg: keep spec file until make mrproper 2018-02-13 10:19:46 +01:00
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: Update drm/i915 bug filing URL 2020-02-28 16:36:12 +01:00
Makefile Linux 4.14.232 2021-04-28 12:08:44 +02:00
README

README

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

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

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.