This repository was archived by the owner on Nov 8, 2023. It is now read-only.
Commit e86cac0
smack: unix sockets: fix accept()ed socket label
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>1 parent 2fe209d commit e86cac0
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3846 | 3846 | | |
3847 | 3847 | | |
3848 | 3848 | | |
3849 | | - | |
3850 | | - | |
3851 | | - | |
3852 | 3849 | | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
3853 | 3853 | | |
3854 | 3854 | | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
3855 | 3861 | | |
3856 | 3862 | | |
3857 | 3863 | | |
| |||
0 commit comments