Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:apparmor_socket_post_create - setup the per-socket security struct* Note:* - kernel sockets currently labeled unconfined but we may want to* move to a special kernel label* - socket may not have sk here if created with sock_create_lite or* sock_alloc

Proto:static int apparmor_socket_post_create(struct socket *sock, int family, int type, int protocol, int kern)

Type:int

Parameter:

TypeParameterName
struct socket *sock
intfamily
inttype
intprotocol
intkern
847  If kern Then
848  ns = aa_get_current_ns()
850  label = aa_get_label(ns_unconfined(ns))
851  aa_put_ns - decrement refcount on @ns*@ns: namespace to put reference of* Decrement reference count of @ns and if no longer in use free it
852  Else label = aa_get_current_label - get the newest version of the current tasks label* Returns: newest version of confining label (NOT NULL)* This fn will not update the tasks cred, so it is safe inside of locks* The returned reference must be put with aa_put_label()
855  If sk Then
856  ctx = SK_CTX(sk)
858  aa_put_label(label)
859  label = aa_get_label(label)
861  aa_put_label(label)
863  Return 0