policy.h (73f488cd903938e78979d50e081a0314ad142351) policy.h (56974a6fcfef69ee0825bd66ed13e92070ac5224)
1/*
2 * AppArmor security module
3 *
4 * This file contains AppArmor policy definitions.
5 *
6 * Copyright (C) 1998-2008 Novell/SUSE
7 * Copyright 2009-2010 Canonical Ltd.
8 *

--- 16 unchanged lines hidden (view full) ---

25
26#include "apparmor.h"
27#include "audit.h"
28#include "capability.h"
29#include "domain.h"
30#include "file.h"
31#include "lib.h"
32#include "label.h"
1/*
2 * AppArmor security module
3 *
4 * This file contains AppArmor policy definitions.
5 *
6 * Copyright (C) 1998-2008 Novell/SUSE
7 * Copyright 2009-2010 Canonical Ltd.
8 *

--- 16 unchanged lines hidden (view full) ---

25
26#include "apparmor.h"
27#include "audit.h"
28#include "capability.h"
29#include "domain.h"
30#include "file.h"
31#include "lib.h"
32#include "label.h"
33#include "net.h"
33#include "perms.h"
34#include "resource.h"
35
36
37struct aa_ns;
38
39extern int unprivileged_userns_apparmor_policy;
40

--- 178 unchanged lines hidden (view full) ---

219 unsigned char class)
220{
221 if (profile->policy.dfa)
222 return aa_dfa_match_len(profile->policy.dfa,
223 profile->policy.start[0], &class, 1);
224 return 0;
225}
226
34#include "perms.h"
35#include "resource.h"
36
37
38struct aa_ns;
39
40extern int unprivileged_userns_apparmor_policy;
41

--- 178 unchanged lines hidden (view full) ---

220 unsigned char class)
221{
222 if (profile->policy.dfa)
223 return aa_dfa_match_len(profile->policy.dfa,
224 profile->policy.start[0], &class, 1);
225 return 0;
226}
227
228static inline unsigned int PROFILE_MEDIATES_AF(struct aa_profile *profile,
229 u16 AF) {
230 unsigned int state = PROFILE_MEDIATES(profile, AA_CLASS_NET);
231 __be16 be_af = cpu_to_be16(AF);
232
233 if (!state)
234 return 0;
235 return aa_dfa_match_len(profile->policy.dfa, state, (char *) &be_af, 2);
236}
237
227/**
228 * aa_get_profile - increment refcount on profile @p
229 * @p: profile (MAYBE NULL)
230 *
231 * Returns: pointer to @p if @p is NULL will return NULL
232 * Requires: @p must be held with valid refcount when called
233 */
234static inline struct aa_profile *aa_get_profile(struct aa_profile *p)

--- 66 unchanged lines hidden ---
238/**
239 * aa_get_profile - increment refcount on profile @p
240 * @p: profile (MAYBE NULL)
241 *
242 * Returns: pointer to @p if @p is NULL will return NULL
243 * Requires: @p must be held with valid refcount when called
244 */
245static inline struct aa_profile *aa_get_profile(struct aa_profile *p)

--- 66 unchanged lines hidden ---