Smack: fix another vsscanf out of bounds
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 23 Jul 2020 15:22:19 +0000 (18:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:01 +0000 (08:24 +0200)
commit32fecc76dfdda9f134de11c3f2df3338a6d3abf6
tree627222331b9166a4de0cbb57d6d2b7a2c10ffd67
parentf5080bbff3892e07b6bd6b6e456b4dd358d315d6
Smack: fix another vsscanf out of bounds

[ Upstream commit a6bd4f6d9b07452b0b19842044a6c3ea384b0b88 ]

This is similar to commit 84e99e58e8d1 ("Smack: slab-out-of-bounds in
vsscanf") where we added a bounds check on "rule".

Reported-by: syzbot+a22c6092d003d6fe1122@syzkaller.appspotmail.com
Fixes: f7112e6c9abf ("Smack: allow for significantly longer Smack labels v4")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/smack/smackfs.c