squashfs: fix xattr id and id lookup sanity checks
authorPhillip Lougher <phillip@squashfs.org.uk>
Thu, 25 Mar 2021 04:37:35 +0000 (21:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:31:54 +0000 (14:31 +0200)
commit269042e8ffed672e29999789debed357efda72af
tree7b3c6324c1d999c9f4c1ffbae5614f6f6a03d403
parent61d72c5952c4ce52039105b6c6bcd884de7a98a1
squashfs: fix xattr id and id lookup sanity checks

commit 8b44ca2b634527151af07447a8090a5f3a043321 upstream.

The checks for maximum metadata block size is missing
SQUASHFS_BLOCK_OFFSET (the two byte length count).

Link: https://lkml.kernel.org/r/2069685113.2081245.1614583677427@webmail.123-reg.co.uk
Fixes: f37aa4c7366e23f ("squashfs: add more sanity checks in id lookup")
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Cc: Sean Nyekjaer <sean@geanix.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/squashfs/id.c
fs/squashfs/xattr_id.c