Re: [PATCH] SMACK netlabel fixes

From: Casey Schaufler
Date: Thu Feb 19 2009 - 00:51:11 EST


etienne wrote:
> Hello,
>
> the following patch (against 2.6.29rc5) fixes a few issues in the smack/netlabel area :
> 1) smack_host_label disregard a "0.0.0.0/0 @" rule (or other label), preventing 'tagged' tasks to access Internet (many systems drop packets with IP options)
> 2) netmasks were not handled correctly, they were stored in a way _not equivalent_ to conversion to be32 (it was equivalent for /0, /8, /16, /24, /32 masks but not other masks)
> 3) smack_netlbladdr prefixes (IP/mask) were not consistent (mask&IP was not done), so there could have been different list entries for the same IP prefix; if those entries had different labels, well ...
> 4) they were not sorted
>
> 1) 2) 3) are bugs, 4) is a more cosmetic issue.
> The patch :
> -creates a new helper smk_netlbladdr_insert to insert a smk_netlbladdr, sorted by netmask length
> -use the new sorted nature of smack_netlbladdrs list to simplify smack_host_label :
> the first match _will_ be the more specific
> -corrects endianness issues in smk_write_netlbladdr & netlbladdr_seq_show
>
> The patch are "tested" so that they no crash the system; cat /smack/netlabel is now sorted and always consistent.
> Some basics ping tests to '@' and other label combination seems ok
> See an extract of my tests bellow the patch
>
> regards,
> Etienne
>

I am in the process of configuring the Smack test lab so that I
can bang on this a little. It looks good so far. Thank you.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/