Overview
Comment: | Added seccomp support |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | seccomp |
Files: | files | file ages | folders |
SHA1: |
854cb424a13ce941e180b2b87eb5fa62 |
User & Date: | rkeene on 2020-03-31 15:44:21 |
Other Links: | branch diff | manifest | tags |
Context
2020-03-31
| ||
16:18 | Disable seccomp support by default and cleanup check-in: 9184a4f1b9 user: rkeene tags: seccomp | |
15:44 | Added seccomp support check-in: 854cb424a1 user: rkeene tags: seccomp | |
14:33 | Merged in trunk check-in: 2204669e3b user: rkeene tags: seccomp | |
Changes
Modified .fossil-settings/ignore-glob from [3d8734b3a3] to [dec4870937].
1 2 3 4 | 1 2 3 4 5 6 7 | + + + | filed filed.o filed-mime-types.h.new filed-mime-types.h filed.seccomp.h.new filed.seccomp.h compiled |
Modified Makefile from [8ce95f72a7] to [c0971efb30].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + + + + + - + - + | vpath %.c $(srcdir) all: filed filed: filed.o $(CC) $(CFLAGS) $(LDFLAGS) -o "$@" $^ $(LIBS) |
Modified filed.c from [05973c0b4a] to [61d8dcb4f5].
︙ | |||
806 807 808 809 810 811 812 813 814 815 816 817 818 819 | 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if (filed_sockettimeout_devnull_fd < 0) { return(-1); } return(0); } #endif #include <linux/seccomp.h> #include <linux/filter.h> #include <linux/audit.h> #include <sys/ptrace.h> #include <stddef.h> static int filed_init_seccomp(void) { struct sock_fprog filter; struct sock_filter rules[] = { #include "filed.seccomp.h" }; int prctl_ret; /* Do not allow any privilege changes beyond this point */ prctl_ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); if (prctl_ret != 0) { return(-1); } filter.len = sizeof(rules) / sizeof(*rules); filter.filter = rules; prctl_ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &filter); if (prctl_ret != 0) { return(-1); } return(0); } /* Format time per RFC2616 */ static char *filed_format_time(char *buffer, size_t buffer_len, const time_t timeinfo) { struct tm timeinfo_tm, *timeinfo_tm_p; timeinfo_tm_p = gmtime_r(&timeinfo, &timeinfo_tm); if (timeinfo_tm_p == NULL) { |
︙ | |||
1911 1912 1913 1914 1915 1916 1917 | 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 | - - - | if (setuid_ret != 0) { perror("setuid"); return(1); } } |
︙ | |||
1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 | 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 | + + + + + + + + | /* Create socket termination thread */ init_ret = filed_sockettimeout_thread_init(); if (init_ret != 0) { perror("filed_sockettimeout_thread_init"); return(7); } /* Initialize seccomp */ init_ret = filed_init_seccomp(); if (init_ret != 0) { perror("filed_init_seccomp"); return(9); } /* Create worker threads */ init_ret = filed_worker_threads_init(fd, thread_count, &thread_options); if (init_ret != 0) { perror("filed_worker_threads_init"); return(5); |
︙ |
Added filed.seccomp version [4d1d628e0b].
|
Added generate-seccomp-filter version [d01690fff9].