]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ovl: fix access beyond unterminated strings
authorAmir Goldstein <amir73il@gmail.com>
Fri, 28 Sep 2018 18:00:48 +0000 (21:00 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:52:28 +0000 (19:52 -0600)
commitb312b9b9f90cdfbe647caa3b37aa956df5c2e4ba
tree4d27270c5526de6d6d759814796fe362a0073d10
parent7c1dbbac7ad51c1770ac87324c30e864ce29a080
ovl: fix access beyond unterminated strings

BugLink: https://bugs.launchpad.net/bugs/1836426
commit 601350ff58d5415a001769532f6b8333820e5786 upstream.

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: 359f392ca53e ("ovl: lookup index entry for copy up origin")
Cc: <stable@vger.kernel.org> # v4.13
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/overlayfs/namei.c