Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\xfrm.c Create Date:2022-07-28 19:16:50
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:LSM hook implementation that allocates a xfrm_sec_state and populates based* on a secid.

Proto:int selinux_xfrm_state_alloc_acquire(struct xfrm_state *x, struct xfrm_sec_ctx *polsec, unsigned int secid)

Type:int

Parameter:

TypeParameterName
struct xfrm_state *x
struct xfrm_sec_ctx *polsec
unsigned intsecid
348  char * ctx_str = NULL
351  If Not polsec Then Return 0
354  If secid == 0 Then Return -EINVAL
357  rc = security_sid_to_context( & selinux_state, secid, & ctx_str, & str_len)
359  If rc Then Return rc
362  ctx = Allocation memory
363  If Not ctx Then
364  rc = -ENOMEM
365  Go to out
368  ctx_doi = XFRM_SC_DOI_LSM
369  ctx_alg = XFRM_SC_ALG_SELINUX
370  ctx_sid = secid
371  ctx_len = str_len
372  memcpy(ctx_str, ctx_str, str_len)
374  Security context = ctx
375  atomic_inc( & Labeled XFRM instance counter )
376  out :
377  kfree(ctx_str)
378  Return rc