• P
    selinux: Better local/forward check in selinux_ip_postroute() · d8395c87
    Paul Moore 提交于
    It turns out that checking to see if skb->sk is NULL is not a very good
    indicator of a forwarded packet as some locally generated packets also have
    skb->sk set to NULL.  Fix this by not only checking the skb->sk field but also
    the IP[6]CB(skb)->flags field for the IP[6]SKB_FORWARDED flag.  While we are
    at it, we are calling selinux_parse_skb() much earlier than we really should
    resulting in potentially wasted cycles parsing packets for information we
    might no use; so shuffle the code around a bit to fix this.
    Signed-off-by: NPaul Moore <paul.moore@hp.com>
    Acked-by: NJames Morris <jmorris@namei.org>
    d8395c87
hooks.c 138.7 KB