Closed jstancek closed 7 years ago
Thanks, this will save me from having to keep around this local policy module to keep things working after running selinux-testsuite: policy_module(myunlabeledpacket, 1.0)
require { type kernel_t; type unlabeled_t; type netif_t; type node_t; }
allow kernel_t unlabeled_t:peer recv; allow unlabeled_t netif_t:netif { ingress egress }; allow unlabeled_t node_t:node { recvfrom sendto };
ipsec-load/ipsec-flush leaves older kernels in state where some communication over loopback (e.g. SCTP) generates unexpected AVCs.
This can be reproduced up to 4.10 by running selinux-testsuite and then sendto02 from LTP [1], which triggers: avc: denied { recv } for pid=7995 comm="sendto02" saddr=127.0.0.1 daddr=127.0.0.1 netif=lo scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=peer
At minimum you need to run one ipsec test, for example:
4.11 has fixed this by doing garbage collection on policy flush:
This patch is a workaround for kernels < 4.11, that do garbage collect on policy delete.
[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/sendto/sendto02.c
Signed-off-by: Jan Stancek jstancek@redhat.com