]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: Use "buf" flexible array for memcpy() destination
authorKees Cook <keescook@chromium.org>
Sat, 24 Sep 2022 07:33:15 +0000 (00:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:26 +0000 (11:28 +0100)
commit353e2c5e6bb9e179c6abe0de247fda830e03f0bb
treec350794271883e276e25e563a5c548a9072e29a7
parentd007f845810759971ab526326a62299d974dc475
ovl: Use "buf" flexible array for memcpy() destination

commit cf8aa9bf97cadf85745506c6a3e244b22c268d63 upstream.

The "buf" flexible array needs to be the memcpy() destination to avoid
false positive run-time warning from the recent FORTIFY_SOURCE
hardening:

  memcpy: detected field-spanning write (size 93) of single field "&fh->fb"
  at fs/overlayfs/export.c:799 (size 21)

Reported-by: syzbot+9d14351a171d0d1c7955@syzkaller.appspotmail.com
Link: https://lore.kernel.org/all/000000000000763a6c05e95a5985@google.com/
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/export.c
fs/overlayfs/overlayfs.h