]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ubifs: Check data node size before truncate
authorRichard Weinberger <richard@nod.at>
Sun, 1 Jul 2018 21:20:51 +0000 (23:20 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:46:00 +0000 (19:46 -0600)
commit19a016c5df5eaedcca4483acae5c8e5f67d15ff1
tree63548220ddef7f2d2a77f2bd2a4161231ebd6c4a
parent8ed767cfb2de5e6a7ba9333c890e7893043583e7
ubifs: Check data node size before truncate

BugLink: https://bugs.launchpad.net/bugs/1835972
commit 95a22d2084d72ea067d8323cc85677dba5d97cae upstream.

Check whether the size is within bounds before using it.
If the size is not correct, abort and dump the bad data node.

Cc: Kees Cook <keescook@chromium.org>
Cc: Silvio Cesare <silvio.cesare@gmail.com>
Cc: stable@vger.kernel.org
Fixes: 1e51764a3c2ac ("UBIFS: add new flash file system")
Reported-by: Silvio Cesare <silvio.cesare@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/ubifs/journal.c