kernel_samsung_a53x/security/smack
Konstantin Andreev 7ee4e0095c 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>
2025-01-19 14:48:42 +01:00
..
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smack.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smack_access.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smack_lsm.c smack: unix sockets: fix accept()ed socket label 2025-01-19 14:48:42 +01:00
smack_netfilter.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smackfs.c Revert "smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso" 2024-11-24 00:23:23 +01:00