mm/highmem: Add VM_BUG_ON() to mem*_page() calls
authorIra Weiny <ira.weiny@intel.com>
Wed, 10 Feb 2021 17:49:28 +0000 (09:49 -0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Feb 2021 18:56:15 +0000 (19:56 +0100)
commitca18f6ea012bf30236b76c3480ac2c97131b6f8f
treea5f9c09af903cb39b9245e03f0a96e863696580c
parent6a0996db6879cf09f989c5f44f9edd38240cb346
mm/highmem: Add VM_BUG_ON() to mem*_page() calls

Add VM_BUG_ON bounds checks to ensure the newly lifted and created page
memory operations do not result in corrupted data in neighbor pages.[1][2]

[1] https://lore.kernel.org/lkml/20201210053502.GS1563847@iweiny-DESK2.sc.intel.com/
[2] https://lore.kernel.org/lkml/20210209110931.00f00e47d9a0529fcee2ff01@linux-foundation.org/

Suggested-by: Matthew Wilcox <willy@infradead.org>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: David Sterba <dsterba@suse.com>
include/linux/highmem.h