]> git.baikalelectronics.ru Git - kernel.git/commit
relay: fix type mismatch when allocating memory in relay_create_buf()
authorGavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Tue, 29 Nov 2022 09:23:38 +0000 (09:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:58 +0000 (11:40 +0100)
commit7076ea74346e5c1d1b6a417cedc2efd4b793c16e
tree57b8818ac8089b7f025d28c220ad3628f900e878
parent168d06efe971837d1de5ba22d45b80aa31d2d9ef
relay: fix type mismatch when allocating memory in relay_create_buf()

[ Upstream commit 4d8586e04602fe42f0a782d2005956f8b6302678 ]

The 'padding' field of the 'rchan_buf' structure is an array of 'size_t'
elements, but the memory is allocated for an array of 'size_t *' elements.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Link: https://lkml.kernel.org/r/20221129092002.3538384-1-Ilia.Gavrilov@infotecs.ru
Fixes: 48b6ca91ae3f ("[PATCH] relay: migrate from relayfs to a generic relay API")
Signed-off-by: Ilia.Gavrilov <Ilia.Gavrilov@infotecs.ru>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: wuchi <wuchi.zero@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/relay.c