hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/net/netlabel/netlabel_calipso.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * NetLabel CALIPSO/IPv6 Support
34 *
....@@ -7,25 +8,10 @@
78 *
89 * Authors: Paul Moore <paul@paul-moore.com>
910 * Huw Davies <huw@codeweavers.com>
10
- *
1111 */
1212
1313 /* (c) Copyright Hewlett-Packard Development Company, L.P., 2006
1414 * (c) Copyright Huw Davies <huw@codeweavers.com>, 2015
15
- *
16
- * This program is free software; you can redistribute it and/or modify
17
- * it under the terms of the GNU General Public License as published by
18
- * the Free Software Foundation; either version 2 of the License, or
19
- * (at your option) any later version.
20
- *
21
- * This program is distributed in the hope that it will be useful,
22
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
24
- * the GNU General Public License for more details.
25
- *
26
- * You should have received a copy of the GNU General Public License
27
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
28
- *
2915 */
3016
3117 #include <linux/types.h>
....@@ -318,32 +304,32 @@
318304 /* NetLabel Generic NETLINK Command Definitions
319305 */
320306
321
-static const struct genl_ops netlbl_calipso_ops[] = {
307
+static const struct genl_small_ops netlbl_calipso_ops[] = {
322308 {
323309 .cmd = NLBL_CALIPSO_C_ADD,
310
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
324311 .flags = GENL_ADMIN_PERM,
325
- .policy = calipso_genl_policy,
326312 .doit = netlbl_calipso_add,
327313 .dumpit = NULL,
328314 },
329315 {
330316 .cmd = NLBL_CALIPSO_C_REMOVE,
317
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
331318 .flags = GENL_ADMIN_PERM,
332
- .policy = calipso_genl_policy,
333319 .doit = netlbl_calipso_remove,
334320 .dumpit = NULL,
335321 },
336322 {
337323 .cmd = NLBL_CALIPSO_C_LIST,
324
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
338325 .flags = 0,
339
- .policy = calipso_genl_policy,
340326 .doit = netlbl_calipso_list,
341327 .dumpit = NULL,
342328 },
343329 {
344330 .cmd = NLBL_CALIPSO_C_LISTALL,
331
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
345332 .flags = 0,
346
- .policy = calipso_genl_policy,
347333 .doit = NULL,
348334 .dumpit = netlbl_calipso_listall,
349335 },
....@@ -354,9 +340,10 @@
354340 .name = NETLBL_NLTYPE_CALIPSO_NAME,
355341 .version = NETLBL_PROTO_VERSION,
356342 .maxattr = NLBL_CALIPSO_A_MAX,
343
+ .policy = calipso_genl_policy,
357344 .module = THIS_MODULE,
358
- .ops = netlbl_calipso_ops,
359
- .n_ops = ARRAY_SIZE(netlbl_calipso_ops),
345
+ .small_ops = netlbl_calipso_ops,
346
+ .n_small_ops = ARRAY_SIZE(netlbl_calipso_ops),
360347 };
361348
362349 /* NetLabel Generic NETLINK Protocol Functions
....@@ -439,7 +426,7 @@
439426 /**
440427 * calipso_doi_remove - Remove an existing DOI from the CALIPSO protocol engine
441428 * @doi: the DOI value
442
- * @audit_secid: the LSM secid to use in the audit message
429
+ * @audit_info: NetLabel audit information
443430 *
444431 * Description:
445432 * Removes a DOI definition from the CALIPSO engine. The NetLabel routines will
....@@ -608,7 +595,7 @@
608595
609596 /**
610597 * calipso_req_delattr - Delete the CALIPSO option from a request socket
611
- * @reg: the request socket
598
+ * @req: the request socket
612599 *
613600 * Description:
614601 * Removes the CALIPSO option from a request socket, if present.