.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * NetLabel Management Support |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * protocols such as CIPSO and RIPSO. |
---|
7 | 8 | * |
---|
8 | 9 | * Author: Paul Moore <paul@paul-moore.com> |
---|
9 | | - * |
---|
10 | 10 | */ |
---|
11 | 11 | |
---|
12 | 12 | /* |
---|
13 | 13 | * (c) Copyright Hewlett-Packard Development Company, L.P., 2006, 2008 |
---|
14 | | - * |
---|
15 | | - * This program is free software; you can redistribute it and/or modify |
---|
16 | | - * it under the terms of the GNU General Public License as published by |
---|
17 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
18 | | - * (at your option) any later version. |
---|
19 | | - * |
---|
20 | | - * This program is distributed in the hope that it will be useful, |
---|
21 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
22 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
---|
23 | | - * the GNU General Public License for more details. |
---|
24 | | - * |
---|
25 | | - * You should have received a copy of the GNU General Public License |
---|
26 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
---|
27 | | - * |
---|
28 | 14 | */ |
---|
29 | 15 | |
---|
30 | 16 | #include <linux/types.h> |
---|
.. | .. |
---|
316 | 302 | |
---|
317 | 303 | switch (entry->def.type) { |
---|
318 | 304 | case NETLBL_NLTYPE_ADDRSELECT: |
---|
319 | | - nla_a = nla_nest_start(skb, NLBL_MGMT_A_SELECTORLIST); |
---|
| 305 | + nla_a = nla_nest_start_noflag(skb, NLBL_MGMT_A_SELECTORLIST); |
---|
320 | 306 | if (nla_a == NULL) |
---|
321 | 307 | return -ENOMEM; |
---|
322 | 308 | |
---|
.. | .. |
---|
324 | 310 | struct netlbl_domaddr4_map *map4; |
---|
325 | 311 | struct in_addr addr_struct; |
---|
326 | 312 | |
---|
327 | | - nla_b = nla_nest_start(skb, NLBL_MGMT_A_ADDRSELECTOR); |
---|
| 313 | + nla_b = nla_nest_start_noflag(skb, |
---|
| 314 | + NLBL_MGMT_A_ADDRSELECTOR); |
---|
328 | 315 | if (nla_b == NULL) |
---|
329 | 316 | return -ENOMEM; |
---|
330 | 317 | |
---|
.. | .. |
---|
358 | 345 | netlbl_af6list_foreach_rcu(iter6, &entry->def.addrsel->list6) { |
---|
359 | 346 | struct netlbl_domaddr6_map *map6; |
---|
360 | 347 | |
---|
361 | | - nla_b = nla_nest_start(skb, NLBL_MGMT_A_ADDRSELECTOR); |
---|
| 348 | + nla_b = nla_nest_start_noflag(skb, |
---|
| 349 | + NLBL_MGMT_A_ADDRSELECTOR); |
---|
362 | 350 | if (nla_b == NULL) |
---|
363 | 351 | return -ENOMEM; |
---|
364 | 352 | |
---|
.. | .. |
---|
770 | 758 | * NetLabel Generic NETLINK Command Definitions |
---|
771 | 759 | */ |
---|
772 | 760 | |
---|
773 | | -static const struct genl_ops netlbl_mgmt_genl_ops[] = { |
---|
| 761 | +static const struct genl_small_ops netlbl_mgmt_genl_ops[] = { |
---|
774 | 762 | { |
---|
775 | 763 | .cmd = NLBL_MGMT_C_ADD, |
---|
| 764 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
776 | 765 | .flags = GENL_ADMIN_PERM, |
---|
777 | | - .policy = netlbl_mgmt_genl_policy, |
---|
778 | 766 | .doit = netlbl_mgmt_add, |
---|
779 | 767 | .dumpit = NULL, |
---|
780 | 768 | }, |
---|
781 | 769 | { |
---|
782 | 770 | .cmd = NLBL_MGMT_C_REMOVE, |
---|
| 771 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
783 | 772 | .flags = GENL_ADMIN_PERM, |
---|
784 | | - .policy = netlbl_mgmt_genl_policy, |
---|
785 | 773 | .doit = netlbl_mgmt_remove, |
---|
786 | 774 | .dumpit = NULL, |
---|
787 | 775 | }, |
---|
788 | 776 | { |
---|
789 | 777 | .cmd = NLBL_MGMT_C_LISTALL, |
---|
| 778 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
790 | 779 | .flags = 0, |
---|
791 | | - .policy = netlbl_mgmt_genl_policy, |
---|
792 | 780 | .doit = NULL, |
---|
793 | 781 | .dumpit = netlbl_mgmt_listall, |
---|
794 | 782 | }, |
---|
795 | 783 | { |
---|
796 | 784 | .cmd = NLBL_MGMT_C_ADDDEF, |
---|
| 785 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
797 | 786 | .flags = GENL_ADMIN_PERM, |
---|
798 | | - .policy = netlbl_mgmt_genl_policy, |
---|
799 | 787 | .doit = netlbl_mgmt_adddef, |
---|
800 | 788 | .dumpit = NULL, |
---|
801 | 789 | }, |
---|
802 | 790 | { |
---|
803 | 791 | .cmd = NLBL_MGMT_C_REMOVEDEF, |
---|
| 792 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
804 | 793 | .flags = GENL_ADMIN_PERM, |
---|
805 | | - .policy = netlbl_mgmt_genl_policy, |
---|
806 | 794 | .doit = netlbl_mgmt_removedef, |
---|
807 | 795 | .dumpit = NULL, |
---|
808 | 796 | }, |
---|
809 | 797 | { |
---|
810 | 798 | .cmd = NLBL_MGMT_C_LISTDEF, |
---|
| 799 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
811 | 800 | .flags = 0, |
---|
812 | | - .policy = netlbl_mgmt_genl_policy, |
---|
813 | 801 | .doit = netlbl_mgmt_listdef, |
---|
814 | 802 | .dumpit = NULL, |
---|
815 | 803 | }, |
---|
816 | 804 | { |
---|
817 | 805 | .cmd = NLBL_MGMT_C_PROTOCOLS, |
---|
| 806 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
818 | 807 | .flags = 0, |
---|
819 | | - .policy = netlbl_mgmt_genl_policy, |
---|
820 | 808 | .doit = NULL, |
---|
821 | 809 | .dumpit = netlbl_mgmt_protocols, |
---|
822 | 810 | }, |
---|
823 | 811 | { |
---|
824 | 812 | .cmd = NLBL_MGMT_C_VERSION, |
---|
| 813 | + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, |
---|
825 | 814 | .flags = 0, |
---|
826 | | - .policy = netlbl_mgmt_genl_policy, |
---|
827 | 815 | .doit = netlbl_mgmt_version, |
---|
828 | 816 | .dumpit = NULL, |
---|
829 | 817 | }, |
---|
.. | .. |
---|
834 | 822 | .name = NETLBL_NLTYPE_MGMT_NAME, |
---|
835 | 823 | .version = NETLBL_PROTO_VERSION, |
---|
836 | 824 | .maxattr = NLBL_MGMT_A_MAX, |
---|
| 825 | + .policy = netlbl_mgmt_genl_policy, |
---|
837 | 826 | .module = THIS_MODULE, |
---|
838 | | - .ops = netlbl_mgmt_genl_ops, |
---|
839 | | - .n_ops = ARRAY_SIZE(netlbl_mgmt_genl_ops), |
---|
| 827 | + .small_ops = netlbl_mgmt_genl_ops, |
---|
| 828 | + .n_small_ops = ARRAY_SIZE(netlbl_mgmt_genl_ops), |
---|
840 | 829 | }; |
---|
841 | 830 | |
---|
842 | 831 | /* |
---|