亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? services.c

?? linux 內核源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
 * if the access vector decisions were computed successfully. */int security_compute_av(u32 ssid,			u32 tsid,			u16 tclass,			u32 requested,			struct av_decision *avd){	struct context *scontext = NULL, *tcontext = NULL;	int rc = 0;	if (!ss_initialized) {		avd->allowed = 0xffffffff;		avd->decided = 0xffffffff;		avd->auditallow = 0;		avd->auditdeny = 0xffffffff;		avd->seqno = latest_granting;		return 0;	}	POLICY_RDLOCK;	scontext = sidtab_search(&sidtab, ssid);	if (!scontext) {		printk(KERN_ERR "security_compute_av:  unrecognized SID %d\n",		       ssid);		rc = -EINVAL;		goto out;	}	tcontext = sidtab_search(&sidtab, tsid);	if (!tcontext) {		printk(KERN_ERR "security_compute_av:  unrecognized SID %d\n",		       tsid);		rc = -EINVAL;		goto out;	}	rc = context_struct_compute_av(scontext, tcontext, tclass,				       requested, avd);out:	POLICY_RDUNLOCK;	return rc;}/* * Write the security context string representation of * the context structure `context' into a dynamically * allocated string of the correct size.  Set `*scontext' * to point to this string and set `*scontext_len' to * the length of the string. */static int context_struct_to_string(struct context *context, char **scontext, u32 *scontext_len){	char *scontextp;	*scontext = NULL;	*scontext_len = 0;	/* Compute the size of the context. */	*scontext_len += strlen(policydb.p_user_val_to_name[context->user - 1]) + 1;	*scontext_len += strlen(policydb.p_role_val_to_name[context->role - 1]) + 1;	*scontext_len += strlen(policydb.p_type_val_to_name[context->type - 1]) + 1;	*scontext_len += mls_compute_context_len(context);	/* Allocate space for the context; caller must free this space. */	scontextp = kmalloc(*scontext_len, GFP_ATOMIC);	if (!scontextp) {		return -ENOMEM;	}	*scontext = scontextp;	/*	 * Copy the user name, role name and type name into the context.	 */	sprintf(scontextp, "%s:%s:%s",		policydb.p_user_val_to_name[context->user - 1],		policydb.p_role_val_to_name[context->role - 1],		policydb.p_type_val_to_name[context->type - 1]);	scontextp += strlen(policydb.p_user_val_to_name[context->user - 1]) +	             1 + strlen(policydb.p_role_val_to_name[context->role - 1]) +	             1 + strlen(policydb.p_type_val_to_name[context->type - 1]);	mls_sid_to_context(context, &scontextp);	*scontextp = 0;	return 0;}#include "initial_sid_to_string.h"const char *security_get_initial_sid_context(u32 sid){	if (unlikely(sid > SECINITSID_NUM))		return NULL;	return initial_sid_to_string[sid];}/** * security_sid_to_context - Obtain a context for a given SID. * @sid: security identifier, SID * @scontext: security context * @scontext_len: length in bytes * * Write the string representation of the context associated with @sid * into a dynamically allocated string of the correct size.  Set @scontext * to point to this string and set @scontext_len to the length of the string. */int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len){	struct context *context;	int rc = 0;	*scontext = NULL;	*scontext_len  = 0;	if (!ss_initialized) {		if (sid <= SECINITSID_NUM) {			char *scontextp;			*scontext_len = strlen(initial_sid_to_string[sid]) + 1;			scontextp = kmalloc(*scontext_len,GFP_ATOMIC);			if (!scontextp) {				rc = -ENOMEM;				goto out;			}			strcpy(scontextp, initial_sid_to_string[sid]);			*scontext = scontextp;			goto out;		}		printk(KERN_ERR "security_sid_to_context:  called before initial "		       "load_policy on unknown SID %d\n", sid);		rc = -EINVAL;		goto out;	}	POLICY_RDLOCK;	context = sidtab_search(&sidtab, sid);	if (!context) {		printk(KERN_ERR "security_sid_to_context:  unrecognized SID "		       "%d\n", sid);		rc = -EINVAL;		goto out_unlock;	}	rc = context_struct_to_string(context, scontext, scontext_len);out_unlock:	POLICY_RDUNLOCK;out:	return rc;}static int security_context_to_sid_core(char *scontext, u32 scontext_len, u32 *sid, u32 def_sid){	char *scontext2;	struct context context;	struct role_datum *role;	struct type_datum *typdatum;	struct user_datum *usrdatum;	char *scontextp, *p, oldc;	int rc = 0;	if (!ss_initialized) {		int i;		for (i = 1; i < SECINITSID_NUM; i++) {			if (!strcmp(initial_sid_to_string[i], scontext)) {				*sid = i;				goto out;			}		}		*sid = SECINITSID_KERNEL;		goto out;	}	*sid = SECSID_NULL;	/* Copy the string so that we can modify the copy as we parse it.	   The string should already by null terminated, but we append a	   null suffix to the copy to avoid problems with the existing	   attr package, which doesn't view the null terminator as part	   of the attribute value. */	scontext2 = kmalloc(scontext_len+1,GFP_KERNEL);	if (!scontext2) {		rc = -ENOMEM;		goto out;	}	memcpy(scontext2, scontext, scontext_len);	scontext2[scontext_len] = 0;	context_init(&context);	*sid = SECSID_NULL;	POLICY_RDLOCK;	/* Parse the security context. */	rc = -EINVAL;	scontextp = (char *) scontext2;	/* Extract the user. */	p = scontextp;	while (*p && *p != ':')		p++;	if (*p == 0)		goto out_unlock;	*p++ = 0;	usrdatum = hashtab_search(policydb.p_users.table, scontextp);	if (!usrdatum)		goto out_unlock;	context.user = usrdatum->value;	/* Extract role. */	scontextp = p;	while (*p && *p != ':')		p++;	if (*p == 0)		goto out_unlock;	*p++ = 0;	role = hashtab_search(policydb.p_roles.table, scontextp);	if (!role)		goto out_unlock;	context.role = role->value;	/* Extract type. */	scontextp = p;	while (*p && *p != ':')		p++;	oldc = *p;	*p++ = 0;	typdatum = hashtab_search(policydb.p_types.table, scontextp);	if (!typdatum)		goto out_unlock;	context.type = typdatum->value;	rc = mls_context_to_sid(oldc, &p, &context, &sidtab, def_sid);	if (rc)		goto out_unlock;	if ((p - scontext2) < scontext_len) {		rc = -EINVAL;		goto out_unlock;	}	/* Check the validity of the new context. */	if (!policydb_context_isvalid(&policydb, &context)) {		rc = -EINVAL;		goto out_unlock;	}	/* Obtain the new sid. */	rc = sidtab_context_to_sid(&sidtab, &context, sid);out_unlock:	POLICY_RDUNLOCK;	context_destroy(&context);	kfree(scontext2);out:	return rc;}/** * security_context_to_sid - Obtain a SID for a given security context. * @scontext: security context * @scontext_len: length in bytes * @sid: security identifier, SID * * Obtains a SID associated with the security context that * has the string representation specified by @scontext. * Returns -%EINVAL if the context is invalid, -%ENOMEM if insufficient * memory is available, or 0 on success. */int security_context_to_sid(char *scontext, u32 scontext_len, u32 *sid){	return security_context_to_sid_core(scontext, scontext_len,	                                    sid, SECSID_NULL);}/** * security_context_to_sid_default - Obtain a SID for a given security context, * falling back to specified default if needed. * * @scontext: security context * @scontext_len: length in bytes * @sid: security identifier, SID * @def_sid: default SID to assign on error * * Obtains a SID associated with the security context that * has the string representation specified by @scontext. * The default SID is passed to the MLS layer to be used to allow * kernel labeling of the MLS field if the MLS field is not present * (for upgrading to MLS without full relabel). * Returns -%EINVAL if the context is invalid, -%ENOMEM if insufficient * memory is available, or 0 on success. */int security_context_to_sid_default(char *scontext, u32 scontext_len, u32 *sid, u32 def_sid){	return security_context_to_sid_core(scontext, scontext_len,	                                    sid, def_sid);}static int compute_sid_handle_invalid_context(	struct context *scontext,	struct context *tcontext,	u16 tclass,	struct context *newcontext){	char *s = NULL, *t = NULL, *n = NULL;	u32 slen, tlen, nlen;	if (context_struct_to_string(scontext, &s, &slen) < 0)		goto out;	if (context_struct_to_string(tcontext, &t, &tlen) < 0)		goto out;	if (context_struct_to_string(newcontext, &n, &nlen) < 0)		goto out;	audit_log(current->audit_context, GFP_ATOMIC, AUDIT_SELINUX_ERR,		  "security_compute_sid:  invalid context %s"		  " for scontext=%s"		  " tcontext=%s"		  " tclass=%s",		  n, s, t, policydb.p_class_val_to_name[tclass-1]);out:	kfree(s);	kfree(t);	kfree(n);	if (!selinux_enforcing)		return 0;	return -EACCES;}static int security_compute_sid(u32 ssid,				u32 tsid,				u16 tclass,				u32 specified,				u32 *out_sid){	struct context *scontext = NULL, *tcontext = NULL, newcontext;	struct role_trans *roletr = NULL;	struct avtab_key avkey;	struct avtab_datum *avdatum;	struct avtab_node *node;	int rc = 0;	if (!ss_initialized) {		switch (tclass) {		case SECCLASS_PROCESS:			*out_sid = ssid;			break;		default:			*out_sid = tsid;			break;		}		goto out;	}	context_init(&newcontext);	POLICY_RDLOCK;	scontext = sidtab_search(&sidtab, ssid);	if (!scontext) {		printk(KERN_ERR "security_compute_sid:  unrecognized SID %d\n",		       ssid);		rc = -EINVAL;		goto out_unlock;	}	tcontext = sidtab_search(&sidtab, tsid);	if (!tcontext) {		printk(KERN_ERR "security_compute_sid:  unrecognized SID %d\n",		       tsid);		rc = -EINVAL;		goto out_unlock;	}	/* Set the user identity. */	switch (specified) {	case AVTAB_TRANSITION:	case AVTAB_CHANGE:		/* Use the process user identity. */		newcontext.user = scontext->user;		break;	case AVTAB_MEMBER:		/* Use the related object owner. */		newcontext.user = tcontext->user;		break;	}	/* Set the role and type to default values. */	switch (tclass) {	case SECCLASS_PROCESS:		/* Use the current role and type of process. */		newcontext.role = scontext->role;		newcontext.type = scontext->type;		break;	default:		/* Use the well-defined object role. */		newcontext.role = OBJECT_R_VAL;		/* Use the type of the related object. */		newcontext.type = tcontext->type;	}	/* Look for a type transition/member/change rule. */	avkey.source_type = scontext->type;	avkey.target_type = tcontext->type;	avkey.target_class = tclass;	avkey.specified = specified;	avdatum = avtab_search(&policydb.te_avtab, &avkey);	/* If no permanent rule, also check for enabled conditional rules */	if(!avdatum) {		node = avtab_search_node(&policydb.te_cond_avtab, &avkey);		for (; node != NULL; node = avtab_search_node_next(node, specified)) {			if (node->key.specified & AVTAB_ENABLED) {				avdatum = &node->datum;				break;			}		}	}	if (avdatum) {		/* Use the type from the type transition/member/change rule. */		newcontext.type = avdatum->data;	}	/* Check for class-specific changes. */	switch (tclass) {	case SECCLASS_PROCESS:		if (specified & AVTAB_TRANSITION) {			/* Look for a role transition rule. */			for (roletr = policydb.role_tr; roletr;			     roletr = roletr->next) {				if (roletr->role == scontext->role &&				    roletr->type == tcontext->type) {					/* Use the role transition rule. */					newcontext.role = roletr->new_role;					break;				}			}		}		break;	default:		break;	}	/* Set the MLS attributes.	   This is done last because it may allocate memory. */	rc = mls_compute_sid(scontext, tcontext, tclass, specified, &newcontext);	if (rc)		goto out_unlock;	/* Check the validity of the context. */	if (!policydb_context_isvalid(&policydb, &newcontext)) {		rc = compute_sid_handle_invalid_context(scontext,							tcontext,							tclass,							&newcontext);		if (rc)			goto out_unlock;	}	/* Obtain the sid for the context. */	rc = sidtab_context_to_sid(&sidtab, &newcontext, out_sid);out_unlock:	POLICY_RDUNLOCK;	context_destroy(&newcontext);out:	return rc;}/** * security_transition_sid - Compute the SID for a new subject/object. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @out_sid: security identifier for new subject/object * * Compute a SID to use for labeling a new subject or object in the * class @tclass based on a SID pair (@ssid, @tsid). * Return -%EINVAL if any of the parameters are invalid, -%ENOMEM * if insufficient memory is available, or %0 if the new SID was * computed successfully. */int security_transition_sid(u32 ssid,			    u32 tsid,			    u16 tclass,			    u32 *out_sid){	return security_compute_sid(ssid, tsid, tclass, AVTAB_TRANSITION, out_sid);}/** * security_member_sid - Compute the SID for member selection. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @out_sid: security identifier for selected member * * Compute a SID to use when selecting a member of a polyinstantiated * object of class @tclass based on a SID pair (@ssid, @tsid). * Return -%EINVAL if any of the parameters are invalid, -%ENOMEM * if insufficient memory is available, or %0 if the SID was * computed successfully. */int security_member_sid(u32 ssid,			u32 tsid,			u16 tclass,			u32 *out_sid){	return security_compute_sid(ssid, tsid, tclass, AVTAB_MEMBER, out_sid);}/** * security_change_sid - Compute the SID for object relabeling. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @out_sid: security identifier for selected member * * Compute a SID to use for relabeling an object of class @tclass * based on a SID pair (@ssid, @tsid). * Return -%EINVAL if any of the parameters are invalid, -%ENOMEM * if insufficient memory is available, or %0 if the SID was * computed successfully.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品免费**视频| 亚洲欧美日本韩国| 中文字幕在线观看一区| 丝袜国产日韩另类美女| 懂色一区二区三区免费观看| 欧美日韩成人高清| 成人欧美一区二区三区黑人麻豆| 日韩和欧美的一区| 99国产精品久久| 久久这里只有精品首页| 午夜欧美在线一二页| 91麻豆123| 中文字幕中文字幕在线一区| 极品销魂美女一区二区三区| 91麻豆精品久久久久蜜臀| 亚洲视频资源在线| 成人av在线看| 国产精品视频观看| 丁香一区二区三区| 欧美激情综合五月色丁香小说| 久久国产综合精品| 欧美一区二区三区免费观看视频| 亚洲午夜一区二区| 欧美自拍偷拍一区| 亚洲精品你懂的| 99国产欧美另类久久久精品 | 天堂精品中文字幕在线| 色综合久久久久综合| 日韩码欧中文字| 91丨porny丨首页| 中文字幕一区二区三区四区 | 国产精品亚洲人在线观看| 欧美一级黄色录像| 美女国产一区二区| 精品捆绑美女sm三区| 激情综合一区二区三区| 精品久久人人做人人爰| 激情六月婷婷久久| 久久精品一区二区三区av| 国产精品亚洲午夜一区二区三区| 久久综合九色综合97婷婷 | 91福利区一区二区三区| 洋洋av久久久久久久一区| 欧美三级一区二区| 午夜精品福利视频网站| 欧美大肚乱孕交hd孕妇| 国产精品99久久久久久久女警| 久久久99精品久久| 99国产欧美久久久精品| 亚洲va在线va天堂| 精品99一区二区| kk眼镜猥琐国模调教系列一区二区| 国产精品天美传媒| 欧美性高清videossexo| 视频一区二区不卡| 国产亚洲欧美一级| 一本久久精品一区二区| 美女视频黄频大全不卡视频在线播放| 精品国产成人在线影院| 99久久精品免费| 日韩福利电影在线观看| 国产精品丝袜91| 欧美另类高清zo欧美| 国产美女精品人人做人人爽| 亚洲日本va在线观看| 日韩一区二区在线看| 成人aaaa免费全部观看| 天天综合日日夜夜精品| 欧美国产1区2区| 欧美日韩成人高清| 95精品视频在线| 九九**精品视频免费播放| 亚洲美腿欧美偷拍| 久久久久国产精品人| 欧美日韩一卡二卡| 99精品欧美一区| 国产在线播放一区二区三区| 亚洲五月六月丁香激情| 国产精品私人影院| 精品久久久久久久久久久院品网| 一本色道a无线码一区v| 岛国一区二区三区| 麻豆精品视频在线观看免费| 亚洲自拍偷拍九九九| 国产日韩综合av| 日韩精品一区二区三区视频播放| 欧美性猛片xxxx免费看久爱| 丁香激情综合国产| 韩日av一区二区| 日本成人在线电影网| 一区二区三区四区在线播放| 国产精品欧美一区二区三区| 精品国产乱码久久久久久1区2区| 5月丁香婷婷综合| 日本韩国欧美在线| jlzzjlzz亚洲女人18| 国产精品一区二区在线看| 蜜桃久久久久久久| 日韩精品成人一区二区三区| 一区二区三区四区国产精品| 国产精品―色哟哟| 国产欧美va欧美不卡在线| 欧美xxxx在线观看| 日韩视频中午一区| 337p亚洲精品色噜噜| 欧美主播一区二区三区美女| 91欧美激情一区二区三区成人| 盗摄精品av一区二区三区| 国产福利一区二区三区视频| 国内精品嫩模私拍在线| 国产在线观看一区二区| 精品一区二区三区在线播放| 日本不卡视频在线观看| 麻豆国产91在线播放| 美女在线观看视频一区二区| 欧美a级理论片| 久久99国产精品麻豆| 韩国精品久久久| 国产精品一二三| 99久久精品国产一区二区三区| 99re这里只有精品首页| 色综合久久久久综合体| 欧美色综合网站| 8v天堂国产在线一区二区| 日韩你懂的在线播放| 久久九九全国免费| 国产精品久久777777| 亚洲乱码中文字幕| 午夜影院久久久| 免费精品99久久国产综合精品| 蜜臀av性久久久久蜜臀aⅴ| 激情成人综合网| 懂色av中文一区二区三区| 91女厕偷拍女厕偷拍高清| 在线免费av一区| 777亚洲妇女| 久久精品一区蜜桃臀影院| 国产精品久久久久久亚洲伦| 亚洲综合一区在线| 久久国产剧场电影| 成人av动漫网站| 欧美理论电影在线| 久久综合九色欧美综合狠狠| 亚洲天堂网中文字| 日产国产高清一区二区三区| 国产精品一区在线观看乱码| 在线一区二区三区四区五区| 日韩一级片网站| 中文字幕色av一区二区三区| 亚洲一区在线观看网站| 久久69国产一区二区蜜臀| 一本大道综合伊人精品热热| 日韩欧美第一区| 亚洲激情一二三区| 国产揄拍国内精品对白| 色狠狠色噜噜噜综合网| 精品伦理精品一区| 亚洲精品国久久99热| 国产中文字幕一区| 欧美日韩另类一区| 国产精品国产精品国产专区不片 | 欧美精品久久99久久在免费线 | 久久伊人蜜桃av一区二区| 亚洲色图都市小说| 激情深爱一区二区| 欧美日韩卡一卡二| 国产精品美女久久久久久久久 | 欧美亚洲国产一卡| 国产欧美一区二区精品性| 五月天网站亚洲| 91一区二区在线观看| 久久精品人人做人人综合| 免费人成黄页网站在线一区二区| 91精品办公室少妇高潮对白| 国产亚洲精品福利| 另类成人小视频在线| 欧美日韩一区中文字幕| 国产精品国产自产拍高清av王其| 韩国成人在线视频| 日韩一区二区在线观看视频播放| 亚洲自拍偷拍欧美| 色婷婷精品大在线视频 | 精品噜噜噜噜久久久久久久久试看 | 精品黑人一区二区三区久久| 亚洲亚洲人成综合网络| 91色.com| 亚洲精品国产无天堂网2021| 成人性生交大片免费看中文| 久久综合色播五月| 国产一区在线观看视频| 精品久久久久久久久久久久包黑料| 亚洲va天堂va国产va久| 欧美日韩国产小视频在线观看| 亚洲卡通动漫在线| 色丁香久综合在线久综合在线观看| 中文字幕制服丝袜一区二区三区| 国产乱子轮精品视频| 久久久99精品免费观看不卡| 国产一区免费电影| 国产精品毛片大码女人|