lsm,selinux: pass flowi_common instead of flowi to the LSM hooks
[ Upstream commit 3df98d79215ace13d1e91ddfc5a67a0f5acbd83f ] As pointed out by Herbert in a recent related patch, the LSM hooks do not have the necessary address family information to use the flowi struct safely. As none of the LSMs currently use any of the protocol specific flowi information, replace the flowi pointers with pointers to the address family independent flowi_common struct. Reported-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: James Morris <jamorris@linux.microsoft.com> Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a67a1661cf
commit
6950ee32c1
@@ -311,7 +311,7 @@ LSM_HOOK(int, 0, secmark_relabel_packet, u32 secid)
|
||||
LSM_HOOK(void, LSM_RET_VOID, secmark_refcount_inc, void)
|
||||
LSM_HOOK(void, LSM_RET_VOID, secmark_refcount_dec, void)
|
||||
LSM_HOOK(void, LSM_RET_VOID, req_classify_flow, const struct request_sock *req,
|
||||
struct flowi *fl)
|
||||
struct flowi_common *flic)
|
||||
LSM_HOOK(int, 0, tun_dev_alloc_security, void **security)
|
||||
LSM_HOOK(void, LSM_RET_VOID, tun_dev_free_security, void *security)
|
||||
LSM_HOOK(int, 0, tun_dev_create, void)
|
||||
@@ -351,7 +351,7 @@ LSM_HOOK(int, 0, xfrm_state_delete_security, struct xfrm_state *x)
|
||||
LSM_HOOK(int, 0, xfrm_policy_lookup, struct xfrm_sec_ctx *ctx, u32 fl_secid,
|
||||
u8 dir)
|
||||
LSM_HOOK(int, 1, xfrm_state_pol_flow_match, struct xfrm_state *x,
|
||||
struct xfrm_policy *xp, const struct flowi *fl)
|
||||
struct xfrm_policy *xp, const struct flowi_common *flic)
|
||||
LSM_HOOK(int, 0, xfrm_decode_session, struct sk_buff *skb, u32 *secid,
|
||||
int ckall)
|
||||
#endif /* CONFIG_SECURITY_NETWORK_XFRM */
|
||||
|
||||
Reference in New Issue
Block a user