Commit 034294f
selinux: Fix SCTP error inconsistency in selinux_socket_bind()
Check sk->sk_protocol instead of security class to recognize SCTP socket.
SCTP socket is initialized with SECCLASS_SOCKET class if policy does not
support EXTSOCKCLASS capability. In this case bind(2) hook wrongfully
return EAFNOSUPPORT instead of EINVAL.
The inconsistency was detected with help of Landlock tests:
https://lore.kernel.org/all/[email protected]/
Fixes: 0f8db8c ("selinux: add AF_UNSPEC and INADDR_ANY checks to selinux_socket_bind()")
Signed-off-by: Mikhail Ivanov <[email protected]>
Signed-off-by: Paul Moore <[email protected]>1 parent c75c794 commit 034294f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4835 | 4835 | | |
4836 | 4836 | | |
4837 | 4837 | | |
4838 | | - | |
| 4838 | + | |
4839 | 4839 | | |
4840 | 4840 | | |
4841 | 4841 | | |
| |||
0 commit comments