Bug 561379
| Summary: | Kernel not blocking raw_socket with SELinux controls | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Daniel Walsh <dwalsh> |
| Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> |
| Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 19 | CC: | anton, gansalmon, itamar, jforbes, jonathan, kernel-maint, paul.moore, sdsmall, sgrubb |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-04-05 16:54:02 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Daniel Walsh
2010-02-03 15:22:50 UTC
I think this is a bug we need to pay attention too. Can not prevent raw_socket from certain packets. Last I looked, SELinux only mediated IP packet send/recv. selinux_sock_rcv_skb bails immediately if not inet or inet6. Outbound netfilter hooks are for ipv4 and ipv6 only. packet socket is not the same thing as IP raw socket. So merely changing packet/af_packet.c:run_filter() to invoke sk_filter() [which calls security_sock_rcv_skb] wouldn't cause these packets to get mediated; the SELinux hook would immediately return. To elaborate a bit on the issue I think Stephen is trying to make ... The real issue is that we likely can't rely on the packet already being parsed, i.e. skb_network_offset() isn't going to return anything useful, and without knowing that the packet is an IP packet we would have to parse the packet starting at the Ethernet header in order to get the IP information and the peer label (really only CIPSO and fallback, dealing with labeled IPsec packets here makes my head hurt due to the fact we would need to verify the AH/ESP header and then verify the SPI - basically a no-go). I'll look at this a bit more on Friday but I'm pretty sure this is just a limitation of non AF_INET[6] sockets. This message is a reminder that Fedora 12 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 12. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '12'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 12's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 12 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping I'm moving this bug to be against 'rawhide' so that we don't keep getting the end-of-life bugzapper comments added. Is there any progress being made on this upstream ? Stephen, Paul ? No one is actively pursuing adding SELinux per-packet controls for AF_PACKET sockets to my knowledge. SELinux can control what applications can create and use such sockets, but not per-packet send/recv based on peer information. This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19 |