WSL2-Linux-Kernel/security/smack
Konstantin Andreev 09e89a5e11 smack: unix sockets: fix accept()ed socket label
[ Upstream commit e86cac0acdb1a74f608bacefe702f2034133a047 ]

When a process accept()s connection from a unix socket
(either stream or seqpacket)
it gets the socket with the label of the connecting process.

For example, if a connecting process has a label 'foo',
the accept()ed socket will also have 'in' and 'out' labels 'foo',
regardless of the label of the listener process.

This is because kernel creates unix child sockets
in the context of the connecting process.

I do not see any obvious way for the listener to abuse
alien labels coming with the new socket, but,
to be on the safe side, it's better fix new socket labels.

Signed-off-by: Konstantin Andreev <andreev@swemel.ru>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:07:45 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
smack.h smack: Record transmuting in smk_transmuted 2023-10-06 13:18:20 +02:00
smack_access.c Smack: Fix wrong semantics in smk_access_entry() 2021-07-20 09:17:36 -07:00
smack_lsm.c smack: unix sockets: fix accept()ed socket label 2024-09-12 11:07:45 +02:00
smack_netfilter.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
smackfs.c smackfs: Prevent underflow in smk_set_cipso() 2023-09-19 12:22:39 +02:00