]> git.baikalelectronics.ru Git - kernel.git/commit
mm/debug.c: do not dereference i_ino blindly
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 13 Oct 2020 23:51:10 +0000 (16:51 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Oct 2020 01:38:29 +0000 (18:38 -0700)
commitf7126b22ec20765e6e746de673921c0f63700d12
treef13a90a949ca24ebd21012e875f97a00cff061e6
parentd98723456748b914c17c39e5966226dfbfa0ee6d
mm/debug.c: do not dereference i_ino blindly

__dump_page() checks i_dentry is fetchable and i_ino is earlier in the
struct than i_ino, so it ought to work fine, but it's possible that struct
randomisation has reordered i_ino after i_dentry and the pointer is just
wild enough that i_dentry is fetchable and i_ino isn't.

Also print the inode number if the dentry is invalid.

Reported-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lkml.kernel.org/r/20200819185710.28180-1-willy@infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/debug.c