Commit f7e0318a authored by Zheng Yejian's avatar Zheng Yejian Committed by David S. Miller

netlabel: remove unused parameter in netlbl_netlink_auditinfo()

loginuid/sessionid/secid have been read from 'current' instead of struct
netlink_skb_parms, the parameter 'skb' seems no longer needed.

Fixes: c53fa1ed ("netlink: kill loginuid/sessionid/sid members from struct netlink_skb_parms")
Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4bebe324
...@@ -105,7 +105,7 @@ static int netlbl_calipso_add(struct sk_buff *skb, struct genl_info *info) ...@@ -105,7 +105,7 @@ static int netlbl_calipso_add(struct sk_buff *skb, struct genl_info *info)
!info->attrs[NLBL_CALIPSO_A_MTYPE]) !info->attrs[NLBL_CALIPSO_A_MTYPE])
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
switch (nla_get_u32(info->attrs[NLBL_CALIPSO_A_MTYPE])) { switch (nla_get_u32(info->attrs[NLBL_CALIPSO_A_MTYPE])) {
case CALIPSO_MAP_PASS: case CALIPSO_MAP_PASS:
ret_val = netlbl_calipso_add_pass(info, &audit_info); ret_val = netlbl_calipso_add_pass(info, &audit_info);
...@@ -287,7 +287,7 @@ static int netlbl_calipso_remove(struct sk_buff *skb, struct genl_info *info) ...@@ -287,7 +287,7 @@ static int netlbl_calipso_remove(struct sk_buff *skb, struct genl_info *info)
if (!info->attrs[NLBL_CALIPSO_A_DOI]) if (!info->attrs[NLBL_CALIPSO_A_DOI])
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
cb_arg.doi = nla_get_u32(info->attrs[NLBL_CALIPSO_A_DOI]); cb_arg.doi = nla_get_u32(info->attrs[NLBL_CALIPSO_A_DOI]);
cb_arg.audit_info = &audit_info; cb_arg.audit_info = &audit_info;
ret_val = netlbl_domhsh_walk(&skip_bkt, &skip_chain, ret_val = netlbl_domhsh_walk(&skip_bkt, &skip_chain,
......
...@@ -410,7 +410,7 @@ static int netlbl_cipsov4_add(struct sk_buff *skb, struct genl_info *info) ...@@ -410,7 +410,7 @@ static int netlbl_cipsov4_add(struct sk_buff *skb, struct genl_info *info)
!info->attrs[NLBL_CIPSOV4_A_MTYPE]) !info->attrs[NLBL_CIPSOV4_A_MTYPE])
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
switch (nla_get_u32(info->attrs[NLBL_CIPSOV4_A_MTYPE])) { switch (nla_get_u32(info->attrs[NLBL_CIPSOV4_A_MTYPE])) {
case CIPSO_V4_MAP_TRANS: case CIPSO_V4_MAP_TRANS:
ret_val = netlbl_cipsov4_add_std(info, &audit_info); ret_val = netlbl_cipsov4_add_std(info, &audit_info);
...@@ -709,7 +709,7 @@ static int netlbl_cipsov4_remove(struct sk_buff *skb, struct genl_info *info) ...@@ -709,7 +709,7 @@ static int netlbl_cipsov4_remove(struct sk_buff *skb, struct genl_info *info)
if (!info->attrs[NLBL_CIPSOV4_A_DOI]) if (!info->attrs[NLBL_CIPSOV4_A_DOI])
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
cb_arg.doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]); cb_arg.doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]);
cb_arg.audit_info = &audit_info; cb_arg.audit_info = &audit_info;
ret_val = netlbl_domhsh_walk(&skip_bkt, &skip_chain, ret_val = netlbl_domhsh_walk(&skip_bkt, &skip_chain,
......
...@@ -434,7 +434,7 @@ static int netlbl_mgmt_add(struct sk_buff *skb, struct genl_info *info) ...@@ -434,7 +434,7 @@ static int netlbl_mgmt_add(struct sk_buff *skb, struct genl_info *info)
(info->attrs[NLBL_MGMT_A_IPV6MASK] != NULL))) (info->attrs[NLBL_MGMT_A_IPV6MASK] != NULL)))
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
return netlbl_mgmt_add_common(info, &audit_info); return netlbl_mgmt_add_common(info, &audit_info);
} }
...@@ -457,7 +457,7 @@ static int netlbl_mgmt_remove(struct sk_buff *skb, struct genl_info *info) ...@@ -457,7 +457,7 @@ static int netlbl_mgmt_remove(struct sk_buff *skb, struct genl_info *info)
if (!info->attrs[NLBL_MGMT_A_DOMAIN]) if (!info->attrs[NLBL_MGMT_A_DOMAIN])
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
domain = nla_data(info->attrs[NLBL_MGMT_A_DOMAIN]); domain = nla_data(info->attrs[NLBL_MGMT_A_DOMAIN]);
return netlbl_domhsh_remove(domain, AF_UNSPEC, &audit_info); return netlbl_domhsh_remove(domain, AF_UNSPEC, &audit_info);
...@@ -557,7 +557,7 @@ static int netlbl_mgmt_adddef(struct sk_buff *skb, struct genl_info *info) ...@@ -557,7 +557,7 @@ static int netlbl_mgmt_adddef(struct sk_buff *skb, struct genl_info *info)
(info->attrs[NLBL_MGMT_A_IPV6MASK] != NULL))) (info->attrs[NLBL_MGMT_A_IPV6MASK] != NULL)))
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
return netlbl_mgmt_add_common(info, &audit_info); return netlbl_mgmt_add_common(info, &audit_info);
} }
...@@ -576,7 +576,7 @@ static int netlbl_mgmt_removedef(struct sk_buff *skb, struct genl_info *info) ...@@ -576,7 +576,7 @@ static int netlbl_mgmt_removedef(struct sk_buff *skb, struct genl_info *info)
{ {
struct netlbl_audit audit_info; struct netlbl_audit audit_info;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
return netlbl_domhsh_remove_default(AF_UNSPEC, &audit_info); return netlbl_domhsh_remove_default(AF_UNSPEC, &audit_info);
} }
......
...@@ -814,7 +814,7 @@ static int netlbl_unlabel_accept(struct sk_buff *skb, struct genl_info *info) ...@@ -814,7 +814,7 @@ static int netlbl_unlabel_accept(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[NLBL_UNLABEL_A_ACPTFLG]) { if (info->attrs[NLBL_UNLABEL_A_ACPTFLG]) {
value = nla_get_u8(info->attrs[NLBL_UNLABEL_A_ACPTFLG]); value = nla_get_u8(info->attrs[NLBL_UNLABEL_A_ACPTFLG]);
if (value == 1 || value == 0) { if (value == 1 || value == 0) {
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
netlbl_unlabel_acceptflg_set(value, &audit_info); netlbl_unlabel_acceptflg_set(value, &audit_info);
return 0; return 0;
} }
...@@ -897,7 +897,7 @@ static int netlbl_unlabel_staticadd(struct sk_buff *skb, ...@@ -897,7 +897,7 @@ static int netlbl_unlabel_staticadd(struct sk_buff *skb,
!info->attrs[NLBL_UNLABEL_A_IPV6MASK]))) !info->attrs[NLBL_UNLABEL_A_IPV6MASK])))
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len); ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len);
if (ret_val != 0) if (ret_val != 0)
...@@ -947,7 +947,7 @@ static int netlbl_unlabel_staticadddef(struct sk_buff *skb, ...@@ -947,7 +947,7 @@ static int netlbl_unlabel_staticadddef(struct sk_buff *skb,
!info->attrs[NLBL_UNLABEL_A_IPV6MASK]))) !info->attrs[NLBL_UNLABEL_A_IPV6MASK])))
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len); ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len);
if (ret_val != 0) if (ret_val != 0)
...@@ -994,7 +994,7 @@ static int netlbl_unlabel_staticremove(struct sk_buff *skb, ...@@ -994,7 +994,7 @@ static int netlbl_unlabel_staticremove(struct sk_buff *skb,
!info->attrs[NLBL_UNLABEL_A_IPV6MASK]))) !info->attrs[NLBL_UNLABEL_A_IPV6MASK])))
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len); ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len);
if (ret_val != 0) if (ret_val != 0)
...@@ -1034,7 +1034,7 @@ static int netlbl_unlabel_staticremovedef(struct sk_buff *skb, ...@@ -1034,7 +1034,7 @@ static int netlbl_unlabel_staticremovedef(struct sk_buff *skb,
!info->attrs[NLBL_UNLABEL_A_IPV6MASK]))) !info->attrs[NLBL_UNLABEL_A_IPV6MASK])))
return -EINVAL; return -EINVAL;
netlbl_netlink_auditinfo(skb, &audit_info); netlbl_netlink_auditinfo(&audit_info);
ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len); ret_val = netlbl_unlabel_addrinfo_get(info, &addr, &mask, &addr_len);
if (ret_val != 0) if (ret_val != 0)
......
...@@ -28,11 +28,9 @@ ...@@ -28,11 +28,9 @@
/** /**
* netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg * netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg
* @skb: the packet
* @audit_info: NetLabel audit information * @audit_info: NetLabel audit information
*/ */
static inline void netlbl_netlink_auditinfo(struct sk_buff *skb, static inline void netlbl_netlink_auditinfo(struct netlbl_audit *audit_info)
struct netlbl_audit *audit_info)
{ {
security_task_getsecid_subj(current, &audit_info->secid); security_task_getsecid_subj(current, &audit_info->secid);
audit_info->loginuid = audit_get_loginuid(current); audit_info->loginuid = audit_get_loginuid(current);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment