Commit 113a0e4
smack: fixes for unlabeled host support
The following patch (against 2.6.29rc5) fixes a few issues in the
smack/netlabel "unlabeled host support" functionnality that was added in
2.6.29rc. It should go in before -final.
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
Signed-off-by: <etienne.basset@numericable.fr>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>1 parent 454804a commit 113a0e4
1 file changed
+49
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | 654 | | |
659 | 655 | | |
660 | 656 | | |
| |||
664 | 660 | | |
665 | 661 | | |
666 | 662 | | |
667 | | - | |
668 | | - | |
| 663 | + | |
| 664 | + | |
669 | 665 | | |
670 | | - | |
671 | | - | |
672 | | - | |
| 666 | + | |
673 | 667 | | |
674 | 668 | | |
675 | 669 | | |
| |||
702 | 696 | | |
703 | 697 | | |
704 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
705 | 735 | | |
706 | 736 | | |
707 | 737 | | |
| |||
725 | 755 | | |
726 | 756 | | |
727 | 757 | | |
728 | | - | |
| 758 | + | |
729 | 759 | | |
| 760 | + | |
730 | 761 | | |
731 | 762 | | |
732 | 763 | | |
| |||
762 | 793 | | |
763 | 794 | | |
764 | 795 | | |
765 | | - | |
766 | | - | |
767 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
768 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
769 | 803 | | |
770 | 804 | | |
771 | 805 | | |
772 | 806 | | |
773 | 807 | | |
774 | 808 | | |
775 | 809 | | |
| 810 | + | |
776 | 811 | | |
777 | 812 | | |
778 | 813 | | |
| |||
788 | 823 | | |
789 | 824 | | |
790 | 825 | | |
791 | | - | |
792 | 826 | | |
793 | | - | |
| 827 | + | |
794 | 828 | | |
795 | 829 | | |
796 | 830 | | |
| |||
0 commit comments