Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
scripts/sorttable.h
static void *sort_orctable(void *arg) { int i; int *idxs = NULL; int *tmp_orc_ip_table = NULL; struct orc_entry *tmp_orc_table = NULL; unsigned int *orc_ip_size = (unsigned int *)arg; unsigned int num_entries = *orc_ip_size / sizeof(int); unsigned int orc_size = num_entries * sizeof(struct orc_entry); ...
[ 1, 0 ]
Linux Kernel
scripts/sorttable.h
static void get_mcount_loc(uint_t *_start, uint_t *_stop) { FILE *file_start, *file_stop; char start_buff[20]; char stop_buff[20]; int len = 0; file_start = popen(" grep start_mcount System.map | awk '{print $1}' ", "r"); if (!file_start) { fprintf(stderr, "get start_mcount_loc error!"); return; ...
[ 1, 0 ]
Linux Kernel
scripts/unifdef.c
static void Eelif(void) { error("Inappropriate #elif"); }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static void print(void) { flushline(true); }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static void Strue(void) { drop(); ignoreoff(); state(IS_TRUE_PREFIX); }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static void Ftrue(void) { nest(); Strue(); }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static void Mpass(void) { memcpy(keyword, "if ", 4); Pelif(); }
[ 1, 0 ]
Linux Kernel
scripts/unifdef.c
static void unnest(void) { if (depth == 0) abort(); depth -= 1; }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static Linetype op_strict(int *p, int v, Linetype at, Linetype bt) { if (at == LT_IF || bt == LT_IF) return (LT_IF); return (*p = v, v ? LT_TRUE : LT_FALSE); }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static Linetype op_ge(int *p, Linetype at, int a, Linetype bt, int b) { return op_strict(p, a >= b, at, bt); }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static Linetype op_ne(int *p, Linetype at, int a, Linetype bt, int b) { return op_strict(p, a != b, at, bt); }
[ 0, 0 ]
Linux Kernel
scripts/unifdef.c
static const char *skipargs(const char *cp) { const char *ocp = cp; int level = 0; cp = skipcomment(cp); if (*cp != '(') return (cp); do { if (*cp == '(') level++; if (*cp == ')') level--; cp = skipcomment(cp + 1); } while (level != 0 && *cp != '\0'); if (level == 0) return...
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static void rawdata_f_data_free(struct rawdata_f_data *private) { if (!private) return; aa_put_loaddata(private->loaddata); kvfree(private); }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry, umode_t mode, void *data, char *link, const struct file_operations *fops, const struct inode_operations *iops) { struct inode *inode = new_inode(dir...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static struct aa_loaddata *aa_simple_write_to_buffer(const char __user *userbuf, size_t alloc_size, size_t copy_size, loff_t *pos) { struct aa_loaddata *data; ...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static ssize_t policy_update(u32 mask, const char __user *buf, size_t size, loff_t *pos, struct aa_ns *ns) { struct aa_loaddata *data; struct aa_label *label; ssize_t error; label = begin_current_label_crit_section(); error = aa_may_manage_policy(label, ns, mask); if (error) ...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static ssize_t profile_replace(struct file *f, const char __user *buf, size_t size, loff_t *pos) { struct aa_ns *ns = aa_get_ns(f->f_inode->i_private); int error = policy_update(AA_MAY_LOAD_POLICY | AA_MAY_REPLACE_POLICY, buf, size, pos, ns); aa_put_ns(ns...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int ns_revision_open(struct inode *inode, struct file *file) { struct aa_revision *rev = kzalloc(sizeof(*rev), GFP_KERNEL); if (!rev) return -ENOMEM; rev->ns = aa_get_ns(inode->i_private); if (!rev->ns) rev->ns = aa_get_current_ns(); file->private_data = rev; return 0; }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static __poll_t ns_revision_poll(struct file *file, poll_table *pt) { struct aa_revision *rev = file->private_data; __poll_t mask = 0; if (rev) { mutex_lock_nested(&rev->ns->lock, rev->ns->level); poll_wait(file, &rev->ns->wait, pt); if (rev->last_read < rev->ns->revision) mask |= EPOLLIN | EP...
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
void __aa_bump_ns_revision(struct aa_ns *ns) { WRITE_ONCE(ns->revision, READ_ONCE(ns->revision) + 1); wake_up_interruptible(&ns->wait); }
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static void profile_query_cb(struct aa_profile *profile, struct aa_perms *perms, const char *match_str, size_t match_len) { struct aa_perms tmp = {}; struct aa_dfa *dfa; unsigned int state = 0; if (profile_unconfined(profile)) return; if (profile->file.dfa && *match_str == AA...
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int aa_sfs_seq_open(struct inode *inode, struct file *file) { return single_open(file, aa_sfs_seq_show, inode->i_private); }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int seq_rawdata_release(struct inode *inode, struct file *file) { struct seq_file *seq = (struct seq_file *)file->private_data; if (seq) aa_put_loaddata(seq->private); return single_release(inode, file); }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int seq_rawdata_hash_show(struct seq_file *seq, void *v) { struct aa_loaddata *data = seq->private; unsigned int i, size = aa_hash_size(); if (data->hash) { for (i = 0; i < size; i++) seq_printf(seq, "%.2x", data->hash[i]); seq_putc(seq, '\n'); } return 0; }
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int rawdata_release(struct inode *inode, struct file *file) { rawdata_f_data_free(file->private_data); return 0; }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static void remove_rawdata_dents(struct aa_loaddata *rawdata) { int i; for (i = 0; i < AAFS_LOADDATA_NDENTS; i++) { if (!IS_ERR_OR_NULL(rawdata->dents[i])) { aafs_remove(rawdata->dents[i]); rawdata->dents[i] = NULL; } } }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
void __aafs_profile_migrate_dents(struct aa_profile *old, struct aa_profile *new) { int i; AA_BUG(!old); AA_BUG(!new); AA_BUG(!mutex_is_locked(&profiles_ns(old)->lock)); for (i = 0; i < AAFS_PROF_SIZEOF; i++) { new->dents[i] = old->dents[i]; if (new->dents[i]) ...
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int profile_depth(struct aa_profile *profile) { int depth = 0; rcu_read_lock(); for (depth = 0; profile; profile = rcu_access_pointer(profile->parent)) depth++; rcu_read_unlock(); return depth; }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static const char *rawdata_get_link_base(struct dentry *dentry, struct inode *inode, struct delayed_call *done, const char *name) { struct aa_proxy *proxy = inode->i_private; struct aa_label *...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static void __aa_fs_list_remove_rawdata(struct aa_ns *ns) { struct aa_loaddata *ent, *tmp; AA_BUG(!mutex_is_locked(&ns->lock)); list_for_each_entry_safe(ent, tmp, &ns->rawdata_list, list) __aa_fs_remove_rawdata(ent); }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static struct aa_profile *__first_profile(struct aa_ns *root, struct aa_ns *ns) { AA_BUG(!root); AA_BUG(ns && !mutex_is_locked(&ns->lock)); for (; ns; ns = __next_ns(root, ns)) { if (!list_empty(&ns->base.profiles)) return list_first_entry(&ns->base.profiles, s...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static struct aa_profile *__next_profile(struct aa_profile *p) { struct aa_profile *parent; struct aa_ns *ns = p->ns; AA_BUG(!mutex_is_locked(&profiles_ns(p)->lock)); if (!list_empty(&p->base.profiles)) return list_first_entry(&p->base.profiles, typeof(*p), base.list); /* is next profile a sibling, par...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static void p_stop(struct seq_file *f, void *p) { struct aa_profile *profile = p; struct aa_ns *root = f->private, *ns; if (profile) { for (ns = profile->ns; ns && ns != root; ns = ns->parent) mutex_unlock(&ns->lock); } mutex_unlock(&root->lock); aa_put_ns(root); }
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int seq_show_profile(struct seq_file *f, void *p) { struct aa_profile *profile = (struct aa_profile *)p; struct aa_ns *root = f->private; aa_label_seq_xprint(f, root, &profile->label, FLAG_SHOW_MODE | FLAG_VIEW_SUBNS, GFP_KERNEL); seq_putc(f, '\n'); return 0; }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int profiles_release(struct inode *inode, struct file *file) { return seq_release(inode, file); }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int __init entry_create_dir(struct aa_sfs_entry *fs_dir, struct dentry *parent) { struct aa_sfs_entry *fs_file; struct dentry *dir; int error; dir = securityfs_create_dir(fs_dir->name, parent); if (IS_ERR(dir)) return PTR_ERR(dir); fs_dir->dentry = dir; for ...
[ 1, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static void __init entry_remove_file(struct aa_sfs_entry *fs_file) { if (!fs_file->dentry) return; securityfs_remove(fs_file->dentry); fs_file->dentry = NULL; }
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static const char *policy_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *done) { struct aa_ns *ns; struct path path; int error; if (!dentry) return ERR_PTR(-ECHILD); ns = aa_get_current_ns(); path.mnt = mntget(aafs_mnt); path.dentry = d...
[ 0, 0 ]
Linux Kernel
security/apparmor/apparmorfs.c
static int policy_readlink(struct dentry *dentry, char __user *buffer, int buflen) { char name[32]; int res; res = snprintf(name, sizeof(name), "%s:[%lu]", AAFS_NAME, d_inode(dentry)->i_ino); if (res > 0 && res < sizeof(name)) res = readlink_copy(buffer, buflen,...
[ 1, 0 ]
Linux Kernel
security/apparmor/audit.c
int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule) { struct aa_audit_rule *rule; switch (field) { case AUDIT_SUBJ_ROLE: if (op != Audit_equal && op != Audit_not_equal) return -EINVAL; break; default: return -EINVAL; } rule = kzalloc(sizeof(struct aa_audit_rule), GFP_K...
[ 1, 0 ]
Linux Kernel
security/apparmor/audit.c
int aa_audit_rule_known(struct audit_krule *rule) { int i; for (i = 0; i < rule->field_count; i++) { struct audit_field *f = &rule->fields[i]; switch (f->type) { case AUDIT_SUBJ_ROLE: return 1; } } return 0; }
[ 1, 0 ]
Linux Kernel
security/apparmor/audit.c
int aa_audit_rule_match(u32 sid, u32 field, u32 op, void *vrule) { struct aa_audit_rule *rule = vrule; struct aa_label *label; int found = 0; label = aa_secid_to_label(sid); if (!label) return -ENOENT; if (aa_label_is_subset(label, rule->label)) found = 1; switch (field) { case AUDIT_SUBJ_R...
[ 1, 0 ]
Linux Kernel
security/apparmor/domain.c
static int label_compound_match(struct aa_profile *profile, struct aa_label *label, bool stack, unsigned int state, bool subns, u32 request, struct aa_perms *perms) { struct aa_profile *tp; struct label_it i; struct pa...
[ 1, 0 ]
Linux Kernel
security/apparmor/domain.c
static int label_match(struct aa_profile *profile, struct aa_label *label, bool stack, unsigned int state, bool subns, u32 request, struct aa_perms *perms) { int error; *perms = nullperms; error = label_compound_match(profile, label, stack, state, subns, reques...
[ 0, 0 ]
Linux Kernel
security/apparmor/domain.c
static int change_profile_perms(struct aa_profile *profile, struct aa_label *target, bool stack, u32 request, unsigned int start, struct aa_perms *perms) { if (profile_unconfined(profile)) { perms->allow = AA_MAY_CHANG...
[ 0, 1 ]
Linux Kernel
security/apparmor/domain.c
static const char *next_name(int xtype, const char *name) { return NULL; }
[ 0, 0 ]
Linux Kernel
security/apparmor/domain.c
struct aa_label *x_table_lookup(struct aa_profile *profile, u32 xindex, const char **name) { struct aa_label *label = NULL; u32 xtype = xindex & AA_X_TYPE_MASK; int index = xindex & AA_X_INDEX_MASK; AA_BUG(!name); /* TODO: move lookup parsing to unpack time so this is a strai...
[ 0, 1 ]
Linux Kernel
security/apparmor/domain.c
static struct aa_label *x_to_label(struct aa_profile *profile, const struct linux_binprm *bprm, const char *name, u32 xindex, const char **lookupname, const char **info) { struct aa_label *new = NULL; struct aa_...
[ 1, 1 ]
Linux Kernel
security/apparmor/domain.c
static struct aa_label *handle_onexec(struct aa_label *label, struct aa_label *onexec, bool stack, const struct linux_binprm *bprm, char *buffer, struct path_cond *cond, ...
[ 0, 1 ]
Linux Kernel
security/apparmor/domain.c
static struct aa_label *build_change_hat(struct aa_profile *profile, const char *name, bool sibling) { struct aa_profile *root, *hat = NULL; const char *info = NULL; int error = 0; if (sibling && PROFILE_IS_HAT(profile)) { root = aa_get_profile_rcu(&profile->parent)...
[ 1, 0 ]
Linux Kernel
security/apparmor/file.c
static u32 map_mask_to_chr_mask(u32 mask) { u32 m = mask & PERMS_CHRS_MASK; if (mask & AA_MAY_GETATTR) m |= MAY_READ; if (mask & (AA_MAY_SETATTR | AA_MAY_CHMOD | AA_MAY_CHOWN)) m |= MAY_WRITE; return m; }
[ 0, 0 ]
Linux Kernel
security/apparmor/file.c
int aa_audit_file(struct aa_profile *profile, struct aa_perms *perms, const char *op, u32 request, const char *name, const char *target, struct aa_label *tlabel, kuid_t ouid, const char *info, int error) { int type = AUDIT_APPARMOR_AUTO; DEFINE_AUDIT_DATA(sa, LS...
[ 1, 0 ]
Linux Kernel
security/apparmor/file.c
int aa_path_link(struct aa_label *label, struct dentry *old_dentry, const struct path *new_dir, struct dentry *new_dentry) { struct path link = {.mnt = new_dir->mnt, .dentry = new_dentry}; struct path target = {.mnt = new_dir->mnt, .dentry = old_dentry}; struct path_cond cond = {d_backing_inode(o...
[ 0, 0 ]
Linux Kernel
security/apparmor/file.c
static void update_file_ctx(struct aa_file_ctx *fctx, struct aa_label *label, u32 request) { struct aa_label *l, *old; spin_lock(&fctx->lock); old = rcu_dereference_protected(fctx->label, lockdep_is_held(&fctx->lock)); l = aa_label_merge(old, label, GFP_ATOMIC); if (l) { if (l...
[ 0, 0 ]
Linux Kernel
security/apparmor/file.c
static int __file_path_perm(const char *op, struct aa_label *label, struct aa_label *flabel, struct file *file, u32 request, u32 denied, bool in_atomic) { struct aa_profile *profile; struct aa_perms perms = {}; vfsuid_t vfsuid = i_uid_into_vfsuid(file_mnt_us...
[ 0, 1 ]
Linux Kernel
security/apparmor/file.c
static int __file_sock_perm(const char *op, struct aa_label *label, struct aa_label *flabel, struct file *file, u32 request, u32 denied) { struct socket *sock = (struct socket *)file->private_data; int error; AA_BUG(!sock); if (!denied && aa_label_is_sub...
[ 0, 1 ]
Linux Kernel
security/apparmor/file.c
static void revalidate_tty(struct aa_label *label) { struct tty_struct *tty; int drop_tty = 0; tty = get_current_tty(); if (!tty) return; spin_lock(&tty->files_lock); if (!list_empty(&tty->tty_files)) { struct tty_file_private *file_priv; struct file *file; /* TODO: Revalidate access to co...
[ 0, 1 ]
Linux Kernel
security/apparmor/include/apparmorfs.h
static inline void __aa_fs_remove_rawdata(struct aa_loaddata *rawdata) {}
[ 0, 0 ]
Linux Kernel
security/apparmor/include/audit.h
static inline int complain_error(int error) { if (error == -EPERM || error == -EACCES) return 0; return error; }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/cred.h
static inline struct aa_label *cred_label(const struct cred *cred) { struct aa_label **blob = cred->security + apparmor_blob_sizes.lbs_cred; AA_BUG(!blob); return *blob; }
[ 1, 0 ]
Linux Kernel
security/apparmor/include/cred.h
static inline struct aa_label *aa_cred_raw_label(const struct cred *cred) { struct aa_label *label = cred_label(cred); AA_BUG(!label); return label; }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/cred.h
static inline struct aa_label *aa_current_raw_label(void) { return aa_cred_raw_label(current_cred()); }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/cred.h
static inline void end_current_label_crit_section(struct aa_label *label) { if (label != aa_current_raw_label()) aa_put_label(label); }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/file.h
static inline void aa_free_file_ctx(struct aa_file_ctx *ctx) { if (ctx) { aa_put_label(rcu_access_pointer(ctx->label)); kfree_sensitive(ctx); } }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/label.h
static inline struct aa_label *aa_get_label(struct aa_label *l) { if (l) kref_get(&(l->count)); return l; }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/label.h
static inline struct aa_label *aa_get_newest_label(struct aa_label *l) { if (!l) return NULL; if (label_is_stale(l)) { struct aa_label *tmp; AA_BUG(!l->proxy); AA_BUG(!l->proxy->label); tmp = aa_get_label_rcu(&l->proxy->label); AA_BUG(!tmp); return tmp; } return aa_get_label(l);...
[ 1, 0 ]
Linux Kernel
security/apparmor/include/label.h
static inline struct aa_proxy *aa_get_proxy(struct aa_proxy *proxy) { if (proxy) kref_get(&(proxy->count)); return proxy; }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/lib.h
static inline bool path_mediated_fs(struct dentry *dentry) { return !(dentry->d_sb->s_flags & SB_NOUSER); }
[ 1, 0 ]
Linux Kernel
security/apparmor/include/lib.h
static inline struct aa_policy *__policy_find(struct list_head *head, const char *name) { struct aa_policy *policy; list_for_each_entry_rcu(policy, head, list) { if (!strcmp(policy->name, name)) return policy; } return NULL; }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/policy.h
static inline struct aa_profile * aa_get_profile_rcu(struct aa_profile __rcu **p) { struct aa_profile *c; rcu_read_lock(); do { c = rcu_dereference(*p); } while (c && !kref_get_unless_zero(&c->label.count)); rcu_read_unlock(); return c; }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/policy.h
static inline int AUDIT_MODE(struct aa_profile *profile) { if (aa_g_audit != AUDIT_NORMAL) return aa_g_audit; return profile->audit; }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/policy_ns.h
static inline void aa_put_ns(struct aa_ns *ns) { if (ns) aa_put_profile(ns->unconfined); }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/policy_ns.h
static inline struct aa_ns *__aa_lookup_ns(struct aa_ns *base, const char *hname) { return __aa_lookupn_ns(base, hname, strlen(hname)); }
[ 0, 0 ]
Linux Kernel
security/apparmor/include/policy_ns.h
static inline struct aa_ns *aa_lookup_ns(struct aa_ns *view, const char *name) { return aa_lookupn_ns(view, name, strlen(name)); } #endif
[ 0, 0 ]
Linux Kernel
security/apparmor/include/task.h
static inline struct aa_task_ctx *task_ctx(struct task_struct *task) { return task->security + apparmor_blob_sizes.lbs_task; }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static void free_proxy(struct aa_proxy *proxy) { if (proxy) { aa_put_label(rcu_dereference_protected(proxy->label, true)); memset(proxy, 0, sizeof(*proxy)); RCU_INIT_POINTER(proxy->label, (struct aa_label *)PROXY_POISON); kfree(proxy); } }
[ 1, 0 ]
Linux Kernel
security/apparmor/label.c
void aa_proxy_kref(struct kref *kref) { struct aa_proxy *proxy = container_of(kref, struct aa_proxy, count); free_proxy(proxy); }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static void __proxy_share(struct aa_label *old, struct aa_label *new) { struct aa_proxy *proxy = new->proxy; new->proxy = aa_get_proxy(old->proxy); __aa_proxy_redirect(old, new); aa_put_proxy(proxy); }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static int ns_cmp(struct aa_ns *a, struct aa_ns *b) { int res; AA_BUG(!a); AA_BUG(!b); AA_BUG(!a->base.hname); AA_BUG(!b->base.hname); if (a == b) return 0; res = a->level - b->level; if (res) return res; return strcmp(a->base.hname, b->base.hname); }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static bool vec_is_stale(struct aa_profile **vec, int n) { int i; AA_BUG(!vec); for (i = 0; i < n; i++) { if (profile_is_stale(vec[i])) return true; } return false; }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
void aa_label_destroy(struct aa_label *label) { AA_BUG(!label); if (!label_isprofile(label)) { struct aa_profile *profile; struct label_it i; aa_put_str(label->hname); label_for_each(i, label, profile) { aa_put_profile(profile); label->vec[i.i] = (struct aa_profile *)(LABEL_POISON +...
[ 1, 0 ]
Linux Kernel
security/apparmor/label.c
static void label_free_switch(struct aa_label *label) { if (label->flags & FLAG_NS_COUNT) aa_free_ns(labels_ns(label)); else if (label_isprofile(label)) aa_free_profile(labels_profile(label)); else aa_label_free(label); }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static void label_free_rcu(struct rcu_head *head) { struct aa_label *label = container_of(head, struct aa_label, rcu); if (label->flags & FLAG_IN_TREE) (void)aa_label_remove(label); label_free_switch(label); }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static void label_free_or_put_new(struct aa_label *label, struct aa_label *new) { if (label != new) aa_label_free(new); else aa_put_label(new); }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static int label_cmp(struct aa_label *a, struct aa_label *b) { AA_BUG(!b); if (a == b) return 0; return vec_cmp(a->vec, a->size, b->vec, b->size); }
[ 1, 0 ]
Linux Kernel
security/apparmor/label.c
int aa_label_next_confined(struct aa_label *label, int i) { AA_BUG(!label); AA_BUG(i < 0); for (; i < label->size; i++) { if (!profile_unconfined(label->vec[i])) return i; } return i; }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
struct aa_profile *__aa_label_next_not_in_set(struct label_it *I, struct aa_label *set, struct aa_label *sub) { AA_BUG(!set); AA_BUG(!I); AA_BUG(I->i < 0); AA_BUG(I->i > set->size); AA_BUG(!sub); AA_BUG(I->j < 0); ...
[ 1, 0 ]
Linux Kernel
security/apparmor/label.c
static bool __label_replace(struct aa_label *old, struct aa_label *new) { struct aa_labelset *ls = labels_set(old); AA_BUG(!ls); AA_BUG(!old); AA_BUG(!new); lockdep_assert_held_write(&ls->lock); AA_BUG(new->flags &FLAG_IN_TREE); if (!label_is_stale(old)) __label_make_stale(old); if (old->flags & ...
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static struct aa_label *__label_insert(struct aa_labelset *ls, struct aa_label *label, bool replace) { struct rb_node **new, *parent = NULL; AA_BUG(!ls); AA_BUG(!label); AA_BUG(labels_set(label) != ls); lockdep_assert_held_write(&ls->lock); AA_BUG(label->flags & FLAG_...
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static struct aa_label *vec_create_and_insert_label(struct aa_profile **vec, int len, gfp_t gfp) { struct aa_label *label = NULL; struct aa_labelset *ls; unsigned long flags; struct aa_label *new; int i; AA_BUG(!vec); if (len == 1) return aa_get_la...
[ 0, 1 ]
Linux Kernel
security/apparmor/label.c
struct aa_label *aa_label_find(struct aa_label *label) { AA_BUG(!label); return vec_find(label->vec, label->size); }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
struct aa_label *aa_label_insert(struct aa_labelset *ls, struct aa_label *label) { struct aa_label *l; unsigned long flags; AA_BUG(!ls); AA_BUG(!label); if (!label_is_stale(label)) { read_lock_irqsave(&ls->lock, flags); l = __label_find(label); read_unlock_irqres...
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static struct aa_labelset *labelset_of_merge(struct aa_label *a, struct aa_label *b) { struct aa_ns *nsa = labels_ns(a); struct aa_ns *nsb = labels_ns(b); if (ns_cmp(nsa, nsb) <= 0) return &nsa->labels; return &nsb->labels; }
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
struct aa_label *aa_label_merge(struct aa_label *a, struct aa_label *b, gfp_t gfp) { struct aa_label *label = NULL; AA_BUG(!a); AA_BUG(!b); if (a == b) return aa_get_newest_label(a); /* TODO: enable when read side is lockless * check if label exists before taking lock...
[ 0, 1 ]
Linux Kernel
security/apparmor/label.c
static int label_components_match(struct aa_profile *profile, struct aa_label *label, unsigned int start, bool subns, u32 request, struct aa_perms *perms) { struct aa_profile *tp; struct label_it i; struct aa_per...
[ 1, 0 ]
Linux Kernel
security/apparmor/label.c
static inline bool use_label_hname(struct aa_ns *ns, struct aa_label *label, int flags) { if (label->hname && (!ns || labels_ns(label) == ns) && !(flags & ~FLAG_SHOW_MODE)) return true; return false; } #define update_for_len(total, len, size, str) ...
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
static int aa_profile_snxprint(char *str, size_t size, struct aa_ns *view, struct aa_profile *profile, int flags, struct aa_ns **prev_ns) { const char *ns_name = NULL; AA_BUG(!str && size != 0); AA_BUG(!profile); if (!view) view = profiles_ns(p...
[ 1, 0 ]
Linux Kernel
security/apparmor/label.c
static inline bool display_mode(struct aa_ns *ns, struct aa_label *label, int flags) { if ((flags & FLAG_SHOW_MODE)) { struct aa_profile *profile; struct label_it i; label_for_each(i, label, profile) { if (aa_ns_visible(ns, profile->ns, flags & FLAG_VIEW_SUBNS) && ...
[ 1, 0 ]
Linux Kernel
security/apparmor/label.c
int aa_label_acntsxprint(char __counted **strp, struct aa_ns *ns, struct aa_label *label, int flags, gfp_t gfp) { int size; AA_BUG(!strp); AA_BUG(!label); size = aa_label_snxprint(NULL, 0, ns, label, flags); if (size < 0) return size; *strp = aa_str_alloc(size + 1, gfp); if...
[ 0, 0 ]
Linux Kernel
security/apparmor/label.c
void aa_label_seq_xprint(struct seq_file *f, struct aa_ns *ns, struct aa_label *label, int flags, gfp_t gfp) { AA_BUG(!f); AA_BUG(!label); if (!use_label_hname(ns, label, flags)) { char *str; int len; len = aa_label_asxprint(&str, ns, label, flags, gfp); if (len < 0) { ...
[ 0, 0 ]