// SPDX-License-Identifier: GPL-2.0-only/* * AppArmor security module * * This file contains AppArmor policy attachment and domain transitions * * Copyright (C) 2002-2008 Novell/SUSE * Copyright 2009-2010 Canonical Ltd. */#include<linux/errno.h>#include<linux/fdtable.h>#include<linux/file.h>#include<linux/mount.h>#include<linux/syscalls.h>#include<linux/tracehook.h>#include<linux/personality.h>#include<linux/xattr.h>#include"include/audit.h"#include"include/apparmorfs.h"#include"include/cred.h"#include"include/domain.h"#include"include/file.h"#include"include/ipc.h"#include"include/match.h"#include"include/path.h"#include"include/policy.h"#include"include/policy_ns.h"/** * aa_free_domain_entries - free entries in a domain table * @domain: the domain table to free (MAYBE NULL) */voidaa_free_domain_entries(structaa_domain*domain){inti;if(domain){if(!domain->table)return;for(i=0;i<domain->size;i++)kzfree(domain->table[i]);kzfree(domain->table);domain->table=NULL;}}/** * may_change_ptraced_domain - check if can change profile on ptraced task * @to_label: profile to change to (NOT NULL) * @info: message if there is an error * * Check if current is ptraced and if so if the tracing task is allowed