summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2020-05-30 14:51:15 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2020-06-02 19:28:38 +1000
commit54a0741c590c48687905da7fce76544a4aede63d (patch)
tree68c02e867655873ea091f7c926eb1ea31028dbb8
parent193ee6b490760d2044b40ad35c25166955815c1a (diff)
downloadlinux-54a0741c590c48687905da7fce76544a4aede63d.tar.gz
maccess-always-use-strict-semantics-for-probe_kernel_read-fix
update "maccess: always use strict semantics for probe_kernel_read" (http://lkml.kernel.org/r/20200331165454.12263-1-vbabka@suse.cz) for "mm, dump_page(): do not crash with invalid mapping pointer" (http://lkml.kernel.org/r/20200331165454.12263-1-vbabka@suse.cz). Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--mm/debug.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/debug.c b/mm/debug.c
index f2ede2df585a..b5b1de8c71ac 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -120,9 +120,9 @@ void __dump_page(struct page *page, const char *reason)
* mapping can be invalid pointer and we don't want to crash
* accessing it, so probe everything depending on it carefully
*/
- if (probe_kernel_read_strict(&host, &mapping->host,
- sizeof(struct inode *)) ||
- probe_kernel_read_strict(&a_ops, &mapping->a_ops,
+ if (probe_kernel_read(&host, &mapping->host,
+ sizeof(struct inode *)) ||
+ probe_kernel_read(&a_ops, &mapping->a_ops,
sizeof(struct address_space_operations *))) {
pr_warn("failed to read mapping->host or a_ops, mapping not a valid kernel address?\n");
goto out_mapping;
@@ -133,7 +133,7 @@ void __dump_page(struct page *page, const char *reason)
goto out_mapping;
}
- if (probe_kernel_read_strict(&dentry_first,
+ if (probe_kernel_read(&dentry_first,
&host->i_dentry.first, sizeof(struct hlist_node *))) {
pr_warn("mapping->a_ops:%ps with invalid mapping->host inode address %px\n",
a_ops, host);
@@ -146,7 +146,7 @@ void __dump_page(struct page *page, const char *reason)
}
dentry_ptr = container_of(dentry_first, struct dentry, d_u.d_alias);
- if (probe_kernel_read_strict(&dentry, dentry_ptr,
+ if (probe_kernel_read(&dentry, dentry_ptr,
sizeof(struct dentry))) {
pr_warn("mapping->aops:%ps with invalid mapping->host->i_dentry.first %px\n",
a_ops, dentry_ptr);