]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mm/filemap.c: fix an overly long line in read_cache_page
authorChristoph Hellwig <hch@lst.de>
Fri, 12 Jul 2019 03:55:17 +0000 (20:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Jul 2019 18:05:43 +0000 (11:05 -0700)
Patch series "fix filler_t callback type mismatches", v2.

Casting mapping->a_ops->readpage to filler_t causes an indirect call
type mismatch with Control-Flow Integrity checking.  This change fixes
the mismatch in read_cache_page_gfp and read_mapping_page by adding
using a NULL filler argument as an indication to call ->readpage
directly, and by passing the right parameter callbacks in nfs and jffs2.

This patch (of 4):

Code cleanup.

Link: http://lkml.kernel.org/r/20190520055731.24538-2-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c

index f1aa20ab8434ab9efb93616ed0b5c206f552907d..d6f7596f148f6f566024a24f5fbc8f0d449e91be 100644 (file)
@@ -2915,7 +2915,8 @@ struct page *read_cache_page(struct address_space *mapping,
                                int (*filler)(void *, struct page *),
                                void *data)
 {
-       return do_read_cache_page(mapping, index, filler, data, mapping_gfp_mask(mapping));
+       return do_read_cache_page(mapping, index, filler, data,
+                       mapping_gfp_mask(mapping));
 }
 EXPORT_SYMBOL(read_cache_page);