]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smackfs: Prevent underflow in smk_set_cipso()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 6 Jul 2023 05:52:39 +0000 (08:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:39 +0000 (12:22 +0200)
commit32e060927351e4e7116949dd1067f9a504c303ce
tree6eccdc353289f5d5bb7035695b9ae0e2ad782424
parent502dfc5875bab9ae5d6a2939146c2c5e5683be40
smackfs: Prevent underflow in smk_set_cipso()

[ Upstream commit 3ad49d37cf5759c3b8b68d02e3563f633d9c1aee ]

There is a upper bound to "catlen" but no lower bound to prevent
negatives.  I don't see that this necessarily causes a problem but we
may as well be safe.

Fixes: e114e473771c ("Smack: Simplified Mandatory Access Control Kernel")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/smack/smackfs.c