cred: switch to using atomic_long_t
authorJens Axboe <axboe@kernel.dk>
Fri, 15 Dec 2023 20:24:10 +0000 (13:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:01:51 +0000 (17:01 +0100)
commitf6a7ce5ae416925954a23be83dee621dc8a4b98a
treedd14205f49a5fa02a9078ed637c54d0022a518ae
parent3b5daf20c426b04d9278c0d3d6e3c7e0d6f5c852
cred: switch to using atomic_long_t

commit f8fa5d76925991976b3e7076f9d1052515ec1fca upstream.

There are multiple ways to grab references to credentials, and the only
protection we have against overflowing it is the memory required to do
so.

With memory sizes only moving in one direction, let's bump the reference
count to 64-bit and move it outside the realm of feasibly overflowing.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/cred.h
kernel/cred.c