vsock/test: fix SEQPACKET message bounds test
authorArseniy Krasnov <avkrasnov@salutedevices.com>
Tue, 21 Nov 2023 21:16:42 +0000 (00:16 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Dec 2023 06:33:05 +0000 (07:33 +0100)
commit78c06141f7061b320579c9dd2ef9df6f56105130
treef7cfaeb585a8a3d6845c5ec9ae47e0c92606a7e6
parent0bdd88af71e069f209ae8cf53af81c3fc0019bc1
vsock/test: fix SEQPACKET message bounds test

[ Upstream commit f0863888f6cfef33e3117dccfe94fa78edf76be4 ]

Tune message length calculation to make this test work on machines
where 'getpagesize()' returns >32KB. Now maximum message length is not
hardcoded (on machines above it was smaller than 'getpagesize()' return
value, thus we get negative value and test fails), but calculated at
runtime and always bigger than 'getpagesize()' result. Reproduced on
aarch64 with 64KB page size.

Fixes: 5c338112e48a ("test/vsock: rework message bounds test")
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reported-by: Bogdan Marcynkov <bmarcynk@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20231121211642.163474-1-avkrasnov@salutedevices.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/vsock/vsock_test.c