alistair23-linux/fs/overlayfs
Amir Goldstein 601350ff58 ovl: fix access beyond unterminated strings
KASAN detected slab-out-of-bounds access in printk from overlayfs,
because string format used %*s instead of %.*s.

> BUG: KASAN: slab-out-of-bounds in string+0x298/0x2d0 lib/vsprintf.c:604
> Read of size 1 at addr ffff8801c36c66ba by task syz-executor2/27811
>
> CPU: 0 PID: 27811 Comm: syz-executor2 Not tainted 4.19.0-rc5+ #36
...
>  printk+0xa7/0xcf kernel/printk/printk.c:1996
>  ovl_lookup_index.cold.15+0xe8/0x1f8 fs/overlayfs/namei.c:689

Reported-by: syzbot+376cea2b0ef340db3dd4@syzkaller.appspotmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 359f392ca5 ("ovl: lookup index entry for copy up origin")
Cc: <stable@vger.kernel.org> # v4.13
2018-10-04 14:49:10 +02:00
..
copy_up.c vfs: swap names of {do,vfs}_clone_file_range() 2018-09-24 10:54:01 +02:00
dir.c ovl: set I_CREATING on inode being created 2018-08-22 13:15:25 -07:00
export.c ovl: Modify ovl_lookup() and friends to lookup metacopy dentry 2018-07-20 09:56:09 +02:00
file.c vfs: swap names of {do,vfs}_clone_file_range() 2018-09-24 10:54:01 +02:00
inode.c ovl: make symbol 'ovl_aops' static 2018-09-25 20:41:23 +02:00
Kconfig ovl: Provide a mount option metacopy=on/off for metadata copyup 2018-07-20 09:56:06 +02:00
Makefile ovl: stack file ops 2018-07-18 15:44:41 +02:00
namei.c ovl: fix access beyond unterminated strings 2018-10-04 14:49:10 +02:00
overlayfs.h ovl: add helper to force data copy-up 2018-07-20 09:56:16 +02:00
ovl_entry.h ovl: Store lower data inode in ovl_inode 2018-07-20 09:56:11 +02:00
readdir.c ovl: fix wrong use of impure dir cache in ovl_iterate() 2018-07-17 16:04:34 +02:00
super.c ovl: fix oopses in ovl_fill_super() failure paths 2018-09-10 12:55:49 +02:00
util.c ovl: fix memory leak on unlink of indexed file 2018-09-24 10:54:01 +02:00