netlabel_mgmt.c (4f6b838c378a52ea3ae0b15f12ca8a20849072fa) | netlabel_mgmt.c (872f690341948b502c93318f806d821c56772c42) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * NetLabel Management Support 4 * 5 * This file defines the management functions for the NetLabel system. The 6 * NetLabel system manages static and dynamic label mappings for network 7 * protocols such as CIPSO and RIPSO. 8 * --- 81 unchanged lines hidden (view full) --- 90 entry->def.type = nla_get_u32(info->attrs[NLBL_MGMT_A_PROTOCOL]); 91 if (info->attrs[NLBL_MGMT_A_DOMAIN]) { 92 size_t tmp_size = nla_len(info->attrs[NLBL_MGMT_A_DOMAIN]); 93 entry->domain = kmalloc(tmp_size, GFP_KERNEL); 94 if (entry->domain == NULL) { 95 ret_val = -ENOMEM; 96 goto add_free_entry; 97 } | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * NetLabel Management Support 4 * 5 * This file defines the management functions for the NetLabel system. The 6 * NetLabel system manages static and dynamic label mappings for network 7 * protocols such as CIPSO and RIPSO. 8 * --- 81 unchanged lines hidden (view full) --- 90 entry->def.type = nla_get_u32(info->attrs[NLBL_MGMT_A_PROTOCOL]); 91 if (info->attrs[NLBL_MGMT_A_DOMAIN]) { 92 size_t tmp_size = nla_len(info->attrs[NLBL_MGMT_A_DOMAIN]); 93 entry->domain = kmalloc(tmp_size, GFP_KERNEL); 94 if (entry->domain == NULL) { 95 ret_val = -ENOMEM; 96 goto add_free_entry; 97 } |
98 nla_strlcpy(entry->domain, | 98 nla_strscpy(entry->domain, |
99 info->attrs[NLBL_MGMT_A_DOMAIN], tmp_size); 100 } 101 102 /* NOTE: internally we allow/use a entry->def.type value of 103 * NETLBL_NLTYPE_ADDRSELECT but we don't currently allow users 104 * to pass that as a protocol value because we need to know the 105 * "real" protocol */ 106 --- 739 unchanged lines hidden --- | 99 info->attrs[NLBL_MGMT_A_DOMAIN], tmp_size); 100 } 101 102 /* NOTE: internally we allow/use a entry->def.type value of 103 * NETLBL_NLTYPE_ADDRSELECT but we don't currently allow users 104 * to pass that as a protocol value because we need to know the 105 * "real" protocol */ 106 --- 739 unchanged lines hidden --- |