linux/fs/ubifs/journal.c
Richard Weinberger 735bbb8633 ubifs: Check data node size before truncate
commit 95a22d2084 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>
Fixes: 1e51764a3c ("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>
[bwh: Backported to 3.16: Drop first argument to ubifs_err()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-12-16 22:08:46 +00:00

1475 lines
43 KiB