You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
LSM: Make the Labeled IPsec hooks more stack friendly
The xfrm_get_policy() and xfrm_add_pol_expire() put some rather large structs on the stack to work around the LSM API. This patch attempts to fix that problem by changing the LSM API to require only the relevant "security" pointers instead of the entire SPD entry; we do this for all of the security_xfrm_policy*() functions to keep things consistent. Signed-off-by: Paul Moore <paul.moore@hp.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
00447872a6
commit
03e1ad7b5d
+11
-10
@@ -1014,26 +1014,27 @@ void security_inet_conn_established(struct sock *sk,
|
||||
|
||||
#ifdef CONFIG_SECURITY_NETWORK_XFRM
|
||||
|
||||
int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
|
||||
int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx)
|
||||
{
|
||||
return security_ops->xfrm_policy_alloc_security(xp, sec_ctx);
|
||||
return security_ops->xfrm_policy_alloc_security(ctxp, sec_ctx);
|
||||
}
|
||||
EXPORT_SYMBOL(security_xfrm_policy_alloc);
|
||||
|
||||
int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
|
||||
int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx,
|
||||
struct xfrm_sec_ctx **new_ctxp)
|
||||
{
|
||||
return security_ops->xfrm_policy_clone_security(old, new);
|
||||
return security_ops->xfrm_policy_clone_security(old_ctx, new_ctxp);
|
||||
}
|
||||
|
||||
void security_xfrm_policy_free(struct xfrm_policy *xp)
|
||||
void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx)
|
||||
{
|
||||
security_ops->xfrm_policy_free_security(xp);
|
||||
security_ops->xfrm_policy_free_security(ctx);
|
||||
}
|
||||
EXPORT_SYMBOL(security_xfrm_policy_free);
|
||||
|
||||
int security_xfrm_policy_delete(struct xfrm_policy *xp)
|
||||
int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx)
|
||||
{
|
||||
return security_ops->xfrm_policy_delete_security(xp);
|
||||
return security_ops->xfrm_policy_delete_security(ctx);
|
||||
}
|
||||
|
||||
int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
|
||||
@@ -1065,9 +1066,9 @@ void security_xfrm_state_free(struct xfrm_state *x)
|
||||
security_ops->xfrm_state_free_security(x);
|
||||
}
|
||||
|
||||
int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir)
|
||||
int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir)
|
||||
{
|
||||
return security_ops->xfrm_policy_lookup(xp, fl_secid, dir);
|
||||
return security_ops->xfrm_policy_lookup(ctx, fl_secid, dir);
|
||||
}
|
||||
|
||||
int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
|
||||
|
||||
Reference in New Issue
Block a user