Commit 7d8d93f
net: Restrict SO_PASS{CRED,PIDFD,SEC} to AF_{UNIX,NETLINK,BLUETOOTH}.
SCM_CREDENTIALS and SCM_SECURITY can be recv()ed by calling
scm_recv() or scm_recv_unix(), and SCM_PIDFD is only used by
scm_recv_unix().
scm_recv() is called from AF_NETLINK and AF_BLUETOOTH.
scm_recv_unix() is literally called from AF_UNIX.
Let's restrict SO_PASSCRED and SO_PASSSEC to such sockets and
SO_PASSPIDFD to AF_UNIX only.
Later, SOCK_PASS{CRED,PIDFD,SEC} will be moved to struct sock
and united with another field.
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent ae4f2f5 commit 7d8d93f
2 files changed
+31
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2773 | 2773 | | |
2774 | 2774 | | |
2775 | 2775 | | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
2776 | 2781 | | |
2777 | 2782 | | |
2778 | | - | |
| 2783 | + | |
2779 | 2784 | | |
2780 | 2785 | | |
2781 | 2786 | | |
2782 | 2787 | | |
2783 | 2788 | | |
2784 | 2789 | | |
2785 | 2790 | | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2786 | 2798 | | |
2787 | 2799 | | |
2788 | 2800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
1224 | 1227 | | |
1225 | 1228 | | |
1226 | 1229 | | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1227 | 1233 | | |
1228 | 1234 | | |
1229 | 1235 | | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1230 | 1239 | | |
1231 | 1240 | | |
1232 | 1241 | | |
| |||
1855 | 1864 | | |
1856 | 1865 | | |
1857 | 1866 | | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
1858 | 1870 | | |
1859 | 1871 | | |
1860 | 1872 | | |
1861 | 1873 | | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
1862 | 1877 | | |
1863 | 1878 | | |
1864 | 1879 | | |
| |||
1956 | 1971 | | |
1957 | 1972 | | |
1958 | 1973 | | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
1959 | 1977 | | |
1960 | 1978 | | |
1961 | 1979 | | |
| |||
0 commit comments