diff options
author | Domenico Cerasuolo <cerasuolodomenico@gmail.com> | 2023-09-22 19:22:11 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-09-29 17:20:47 -0700 |
commit | ca56489c2f1df516801eeff06129d2e9e282ab7b (patch) | |
tree | f0552b6e6a11e149523eb7340e40c60525f175e8 /mm/mincore.c | |
parent | 6f1bace9a9fb11402520ba7defa76bfaf7b8e09f (diff) | |
download | linux-ca56489c2f1df516801eeff06129d2e9e282ab7b.tar.gz linux-ca56489c2f1df516801eeff06129d2e9e282ab7b.tar.bz2 linux-ca56489c2f1df516801eeff06129d2e9e282ab7b.zip |
mm: zswap: fix potential memory corruption on duplicate store
While stress-testing zswap a memory corruption was happening when writing
back pages. __frontswap_store used to check for duplicate entries before
attempting to store a page in zswap, this was because if the store fails
the old entry isn't removed from the tree. This change removes duplicate
entries in zswap_store before the actual attempt.
[cerasuolodomenico@gmail.com: add a warning and a comment, per Johannes]
Link: https://lkml.kernel.org/r/20230925130002.1929369-1-cerasuolodomenico@gmail.com
Link: https://lkml.kernel.org/r/20230922172211.1704917-1-cerasuolodomenico@gmail.com
Fixes: 42c06a0e8ebe ("mm: kill frontswap")
Signed-off-by: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mincore.c')
0 files changed, 0 insertions, 0 deletions