]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/archrandom: add parameter check for s390_arch_random_generate
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 20 Apr 2021 06:23:12 +0000 (08:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 06:37:29 +0000 (08:37 +0200)
commit10e1db0be8c2b560b040b7a88c1d6809aa105e9d
tree3fc7f9df8e4a3b6b6c47a32972f4cc33fb47e25c
parenta51f210d4609a6c1e96f6ee7151dfe953448201e
s390/archrandom: add parameter check for s390_arch_random_generate

[ Upstream commit 28096067686c5a5cbd4c35b079749bd805df5010 ]

A review of the code showed, that this function which is exposed
within the whole kernel should do a parameter check for the
amount of bytes requested. If this requested bytes is too high
an unsigned int overflow could happen causing this function to
try to memcpy a really big memory chunk.

This is not a security issue as there are only two invocations
of this function from arch/s390/include/asm/archrandom.h and both
are not exposed to userland.

Reported-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/crypto/arch_random.c