]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/landlock: Remove invalid unix socket bind()
authorMatthieu Buffet <matthieu@buffet.re>
Mon, 1 Dec 2025 00:36:31 +0000 (01:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:18:41 +0000 (11:18 +0100)
commit64bf182dfb42954da20acacec1fbe19bf603851d
tree02e30c9d7dc220419efed294eabf82c13eb0df0f
parent68495f89a19b6835e388b89b2ffecc0c68f9666c
selftests/landlock: Remove invalid unix socket bind()

[ Upstream commit e1a57c33590a50a6639798e60a597af4a23b0340 ]

Remove bind() call on a client socket that doesn't make sense.
Since strlen(cli_un.sun_path) returns a random value depending on stack
garbage, that many uninitialized bytes are read from the stack as an
unix socket address. This creates random test failures due to the bind
address being invalid or already in use if the same stack value comes up
twice.

Fixes: f83d51a5bdfe ("selftests/landlock: Check IOCTL restrictions for named UNIX domain sockets")
Signed-off-by: Matthieu Buffet <matthieu@buffet.re>
Reviewed-by: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20251201003631.190817-1-matthieu@buffet.re
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/landlock/fs_test.c