Tetsuo Handa 6cd00a01f0 fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot()
Since only dentry->d_name.len + 1 bytes out of DNAME_INLINE_LEN bytes
are initialized at __d_alloc(), we can't copy the whole size
unconditionally.

 WARNING: kmemcheck: Caught 32-bit read from uninitialized memory (ffff8fa27465ac50)
 636f6e66696766732e746d70000000000010000000000000020000000188ffff
  i i i i i i i i i i i i i u u u u u u u u u u i i i i i u u u u
                                  ^
 RIP: 0010:take_dentry_name_snapshot+0x28/0x50
 RSP: 0018:ffffa83000f5bdf8 EFLAGS: 00010246
 RAX: 0000000000000020 RBX: ffff8fa274b20550 RCX: 0000000000000002
 RDX: ffffa83000f5be40 RSI: ffff8fa27465ac50 RDI: ffffa83000f5be60
 RBP: ffffa83000f5bdf8 R08: ffffa83000f5be48 R09: 0000000000000001
 R10: ffff8fa27465ac00 R11: ffff8fa27465acc0 R12: ffff8fa27465ac00
 R13: ffff8fa27465acc0 R14: 0000000000000000 R15: 0000000000000000
 FS:  00007f79737ac8c0(0000) GS:ffffffff8fc30000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: ffff8fa274c0b000 CR3: 0000000134aa7002 CR4: 00000000000606f0
  take_dentry_name_snapshot+0x28/0x50
  vfs_rename+0x128/0x870
  SyS_rename+0x3b2/0x3d0
  entry_SYSCALL_64_fastpath+0x1a/0xa4
  0xffffffffffffffff

Link: http://lkml.kernel.org/r/201709131912.GBG39012.QMJLOVFSFFOOtH@I-love.SAKURA.ne.jp
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-17 16:20:28 -07:00
..
2018-08-03 16:03:33 -04:00
2018-08-13 21:58:53 -07:00
2018-06-11 10:16:13 -07:00
2018-03-14 13:31:23 +01:00
2018-08-15 22:40:03 -07:00
2018-08-03 16:03:32 -04:00
2018-08-15 22:47:23 -07:00
2018-03-27 13:18:09 -04:00
2018-05-22 14:27:52 -04:00
2018-08-17 16:20:27 -07:00
2018-05-22 14:27:52 -04:00
2018-08-15 22:06:26 -07:00
2018-05-22 14:27:53 -04:00
2018-07-03 16:44:45 -04:00
2018-08-14 10:23:25 -07:00
2018-06-05 19:23:26 +02:00
2018-06-07 17:34:35 -07:00
2018-07-12 10:04:29 -04:00
2018-05-03 16:11:37 -06:00
2018-08-14 08:56:02 -07:00
2018-06-11 08:22:34 -07:00
2018-02-15 15:34:42 -05:00
2018-04-04 12:44:02 -07:00